Skip to content

Commit

Permalink
add py
Browse files Browse the repository at this point in the history
  • Loading branch information
greycodee committed Jun 18, 2022
1 parent 1d1e295 commit 8a28ae5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions hook.py
@@ -0,0 +1,35 @@
import frida
import sys

jscode = """
Java.perform(function(){
var utils = Java.use("com.tencent.wcdb.database.SQLiteDatabase"); // 类的加载路径
utils.openDatabase.overload('java.lang.String', '[B', 'com.tencent.wcdb.database.SQLiteCipherSpec', 'com.tencent.wcdb.database.SQLiteDatabase$CursorFactory', 'int', 'com.tencent.wcdb.DatabaseErrorHandler', 'int').implementation = function(a,b,c,d,e,f,g){
console.log("Hook start......");
var JavaString = Java.use("java.lang.String");
var database = this.openDatabase(a,b,c,d,e,f,g);
send(a);
console.log(JavaString.$new(b));
send("Hook ending......");
return database;
};
});
"""


def on_message(message,data):
if message["type"] == "send":
print("[*] {0}".format(message["payload"]))
else:
print(message)

process = frida.get_remote_device()
pid = process.spawn(['com.tencent.mm'])
session = process.attach(pid)
script = session.create_script(jscode)
script.on('message',on_message)
script.load()
process.resume(pid)
sys.stdin.read()

0 comments on commit 8a28ae5

Please sign in to comment.