-
-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathbytecode.ts
More file actions
34 lines (27 loc) · 760 Bytes
/
Copy pathbytecode.ts
File metadata and controls
34 lines (27 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import frida from "frida";
const processName = process.argv[2];
const source = `
rpc.exports = {
listThreads() {
return Process.enumerateThreads();
}
};
`;
async function main() {
const systemSession = await frida.attach(0);
const bytecode = await systemSession.compileScript(source, {
name: "bytecode-example"
});
const session = await frida.attach(processName);
const script = await session.createScriptFromBytes(bytecode);
script.message.connect(message => {
console.log("[*] Message:", message);
});
await script.load();
console.log("[*] Called listThreads() =>", await script.exports.listThreads());
await script.unload();
}
main()
.catch(e => {
console.error(e);
});