function hookGeneral(targetAddr:NativePointer,baseAddr:NativePointer){
Interceptor.attach(targetAddr,{
onEnter:function(args){
var mylog
=
"";
console.log(
"[Hook General]"
+
JSON.stringify(this.context))
mylog
+
=
"[Hook General]"
+
JSON.stringify(this.context)
+
"\n"
;
mylogfile.write(mylog);
mylogfile.flush();
Thread.sleep(
3
);
},onLeave:function(ret){
}
});
}
function hook2DFC9(targetAddr:NativePointer,baseAddr:NativePointer){
Interceptor.attach(targetAddr,{
onEnter:function(args){
var mylog
=
"";
console.log(
"[2DFC9]"
+
(this.context)[
'r8'
])
mylog
+
=
"[2DFC9]"
+
(this.context)[
'r8'
]
+
"\n"
;
mylogfile.write(mylog);
mylogfile.flush();
/
/
Thread.sleep(
1000
);
},onLeave:function(ret){
}
});
}
function hook2E447(targetAddr:NativePointer,baseAddr:NativePointer){
Interceptor.attach(targetAddr,{
onEnter:function(args){
var mylog
=
"";
console.log((this.context)[
'r11'
].readDouble()
+
" "
+
(this.context)[
'd9'
]);
/
/
Thread.sleep(
1000
);
},onLeave:function(ret){
}
});
}
function hook2C9A4(targetAddr:NativePointer,baseAddr:NativePointer){
Interceptor.attach(targetAddr,{
onEnter:function(args){
var mylog
=
"";
console.log("
" + (this.context)['r4'] +"
"+ (this.context)['r3'] +"
"+ (this.context)['r1'] +"
"+ (this.context)['r0'] +"
");
mylog
+
=
"
" + (this.context)['r4'] +"
"+ (this.context)['r3'] +"
"+ (this.context)['r1'] +"
"+ (this.context)['r0'] +"
\n";
mylogfile.write(mylog);
mylogfile.flush();
/
/
Thread.sleep(
1000
);
},onLeave:function(ret){
}
});
}
function hook(baseAddr:NativePointer){
console.log(
"Hooking"
);
hook2C9A4(baseAddr.add(
0x2c9a4
),baseAddr);
hookGeneral(baseAddr.add(
0x2cfb9
),baseAddr);
/
/
hook2E447(baseAddr.add(
0x2e447
),baseAddr);
/
/
hook2DFC9(baseAddr.add(
0x2dfc9
),baseAddr);
}