You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varExitProcess=newApiHook();ExitProcess.OnCallBack=function(API,ret){Emu.pop();varExitCode=Emu.isx64 ? Emu.ReadReg(REG_RCX) : Emu.pop();error("{0}(0x{1})".format(API.name,ExitCode.toString(16)));Emu.Stop();returntrue;// true if you handle it false if you want Cmulator to handle it and set PC .};ExitProcess.install('kernel32.dll','FatalExit');ExitProcess.install('kernel32.dll','ExitProcess');ExitProcess.install('ntdll.dll','RtlExitUserThread');ExitProcess.install('ntdll.dll','RtlExitUserProcess');ExitProcess.install('ucrtbase.dll','exit');ExitProcess.install('ucrtbase.dll','_Exit');
A good use of args prop.
varsprintf=newApiHook();/*int WINAPIV wsprintf( LPSTR , LPCSTR , ... );*/sprintf.OnCallBack=function(API,ret){sprintf.args[0]=Emu.isx64 ? Emu.ReadReg(REG_RCX) : Emu.ReadDword(Emu.ReadReg(REG_ESP)+4);sprintf.args[1]=Emu.isx64 ? Emu.ReadReg(REG_RCX) : Emu.ReadDword(Emu.ReadReg(REG_ESP)+8);Emu.HexDump(sprintf.args[0],16);Emu.HexDump(sprintf.args[1],16);// i think implementing this in JS is hard // so just let the library handle it :D returntrue;// we handled the Stack and other things :D .};sprintf.OnExit=function(API){varbuffer=sprintf.args[0];varFormat=sprintf.args[1];Emu.HexDump(buffer,16);Emu.HexDump(Format,16);warn("{0}(0x{1},'{2}') ".format(API.name,buffer,Format.toString(16)));}sprintf.install('user32.dll','wsprintfA');sprintf.install('user32.dll','wsprintfW');