@@ -6,20 +6,32 @@ function log(msg)
6
6
name : '+log' ,
7
7
payload : msg
8
8
} ) ;
9
- recv ( '+log-ack' , function ( ) { } ) . wait ( ) ;
9
+ // recv('+log-ack', function () {});// .wait();
10
10
}
11
11
} ;
12
12
13
13
14
14
var ptrMessageBoxA = Module . findExportByName ( "user32.dll" , "MessageBoxA" ) ;
15
15
var MessageBoxA = new NativeFunction ( ptrMessageBoxA , 'int' , [ 'int' , 'pointer' , 'pointer' , 'int' ] , 'stdcall' ) ;
16
- log ( "ptrMessageBoxA :" + ptrMessageBoxA ) ;
17
- Interceptor . replace ( ptrMessageBoxA , new NativeCallback ( function ( hwnd , pText , pTitle , type ) {
18
- strText = Memory . readAnsiString ( pText ) ;
19
- strTitle = Memory . readAnsiString ( pTitle ) ;
20
- log ( "MessageBoxA " + strText + " with title " + strTitle ) ;
21
- strHook = Memory . allocAnsiString ( "hooked!" ) ;
22
- return MessageBoxA ( hwnd , strHook , pTitle , type ) ;
16
+ // log("ptrMessageBoxA :"+ptrMessageBoxA);
17
+ // Interceptor.replace(ptrMessageBoxA,new NativeCallback(function (hwnd,pText,pTitle,type) {
18
+ // strText=Memory.readAnsiString(pText);
19
+ // strTitle=Memory.readAnsiString(pTitle);
20
+ // log("MessageBoxA "+strText+" with title "+strTitle);
21
+ // strHook=Memory.allocAnsiString("hooked!");
22
+ // return MessageBoxA(hwnd,strHook,pTitle,type);
23
+ //
24
+ // },'int',['int','pointer','pointer','int'],'stdcall'));
23
25
24
- } , 'int' , [ 'int' , 'pointer' , 'pointer' , 'int' ] , 'stdcall' ) ) ;
26
+ var ptrMessageBoxW = Module . findExportByName ( "user32.dll" , "MessageBoxW" ) ;
27
+ var MessageBoxW = new NativeFunction ( ptrMessageBoxW , 'int' , [ 'int' , 'pointer' , 'pointer' , 'int' ] , 'stdcall' ) ;
28
+ log ( "ptrMessageBoxW :" + ptrMessageBoxW ) ;
29
+ Interceptor . replace ( ptrMessageBoxW , new NativeCallback ( function ( hwnd , pText , pTitle , type ) {
30
+ strText = Memory . readUtf8String ( pText ) ;
31
+ strTitle = Memory . readUtf8String ( pTitle ) ;
32
+ log ( "MessageBoxW " + strText + " with title " + strTitle ) ;
33
+ strHookText = Memory . allocAnsiString ( "text hooked!" ) ;
34
+ strHookTitle = Memory . allocAnsiString ( "title hooked!" ) ;
35
+ return MessageBoxA ( hwnd , strHookText , strHookTitle , type ) ;
25
36
37
+ } , 'int' , [ 'int' , 'pointer' , 'pointer' , 'int' ] , 'stdcall' ) ) ;
0 commit comments