-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdump.js
More file actions
39 lines (34 loc) · 999 Bytes
/
Copy pathdump.js
File metadata and controls
39 lines (34 loc) · 999 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
35
36
37
38
39
const base = Process.getModuleByName("libg.so").base;
function getMessageType(message) {
let vtable = message.readPointer();
let getMessageType = new NativeFunction(
vtable.add(40).readPointer(),
"int",
[],
);
return getMessageType();
}
function getEncodingLength(message) {
let stream = message.add(8);
let size = stream.add(20).readS32();
let offset = stream.add(24).readS32();
return offset > size ? offset : size;
}
Interceptor.attach(base.add(0xa20100), {
onEnter(args) {
this.message = args[1];
},
onLeave() {
let type = getMessageType(this.message);
let length = getEncodingLength(this.message);
console.log("Recieved message of type:", type);
console.log("Length:", length);
let payloadPtr = this.message.add(8).add(56).readPointer();
let payload = payloadPtr.readByteArray(length);
console.log(payload);
File.writeAllBytes(
`/data/data/com.natesworks.royaleoffline/${type}.bin`,
payload,
);
},
});