Last active
March 1, 2024 10:55
-
-
Save push0ebp/5b5ac7e11b0b56b56eb58eed6172c62a to your computer and use it in GitHub Desktop.
cheat engine strlen hooker in auto assembler with calling lua function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ENABLE] | |
loadlibrary(luaclient-i386.dll) | |
luacall(openLuaServer('CELUASERVER')) | |
globalalloc(luainit, 128) | |
globalalloc(LuaFunctionCall, 128) | |
label(luainit_exit) | |
globalalloc(luaserverinitialized, 4) | |
globalalloc(luaservername, 12) | |
luaservername: | |
db 'CELUASERVER',0 | |
luainit: | |
cmp [luaserverinitialized],0 | |
jne luainit_exit | |
push luaservername | |
call CELUA_Initialize //this function is defined in the luaclient dll | |
mov [luaserverinitialized],eax | |
luainit_exit: | |
ret | |
LuaFunctionCall: | |
push ebp | |
mov ebp,esp | |
call luainit | |
push [ebp+c] | |
push [ebp+8] | |
call CELUA_ExecuteFunction | |
pop ebp | |
ret 8 | |
globalalloc(myVar,4) | |
myVar: | |
dd 0 | |
globalalloc(luaCallExample, $200) | |
label(funcName) | |
funcName: | |
db 'print(readString(parameter))',0 | |
alloc(newmem,2048) | |
label(returnhere) | |
label(originalcode) | |
label(exit) | |
newmem: //this is allocated memory, you have read,write,execute access | |
//place your code here | |
push [esp+4] | |
push funcName | |
call LuaFunctionCall | |
originalcode: | |
mov ecx,[esp+04] | |
test ecx,0003 | |
exit: | |
jmp returnhere | |
MSVCR100.strlen: | |
jmp newmem | |
nop | |
nop | |
nop | |
nop | |
nop | |
returnhere: | |
[DISABLE] | |
MSVCR100.strlen: | |
mov ecx,[esp+04] | |
test ecx,0003 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment