from
fastapi
import
FastAPI, Query
from
fastapi.responses
import
JSONResponse
import
frida
import
uvicorn
app
=
FastAPI()
FIXED_KEY
=
"65102933"
FIXED_IV
=
"32028092"
@app
.get(
"/decrypt"
)
def
decrypt(
encryptedData:
str
=
Query(..., description
=
"The encrypted data to be decrypted"
)
):
encryptedData
=
encryptedData.replace(
" "
, "
").replace("
\\n
", "
")
def
on_message(message, data):
if
message[
"type"
]
=
=
"send"
:
print
(
"[* message]"
, message[
"payload"
])
elif
message[
"type"
]
=
=
"error"
:
print
(
"[!] error:"
, message[
"stack"
])
jsCode
=
process
=
frida.get_usb_device().attach(
"嘟嘟牛在线"
)
script
=
process.create_script(jsCode)
script.on(
"message"
, on_message)
script.load()
getDecryptData
=
script.exports.get_decrypt_info(encryptedData, FIXED_KEY, FIXED_IV)
return
JSONResponse({
"result"
: getDecryptData})
if
__name__
=
=
"__main__"
:
uvicorn.run(app, host
=
"127.0.0.1"
, port
=
50000
)