from
reqable
import
*
import
frida
import
json
script
=
None
def
on_message(message,data):
print
(message)
def
decryptData(script, data):
return
script.exports.decrypt(data)
def
load():
devices
=
frida.get_usb_device()
session
=
devices.attach(
"cn.nvlee.cmpguw"
)
filepath
=
r
"C:\Users\Administrator\Desktop\scripts\script.js"
with
open
(filepath) as f:
jscode
=
f.read()
script
=
session.create_script(jscode)
script.on(
"message"
,on_message)
script.load()
return
script
def
onRequest(context, request):
script
=
load()
data
=
json.loads(
str
(request.body))[
"data"
]
result
=
decryptData(script, data)
print
(
"request result => "
, result)
return
request
def
onResponse(context, response):
script
=
load()
data
=
json.loads(
str
(response.body))[
"data"
]
result
=
decryptData(script, data)
print
(
"response result => "
, result)
return
response