Code: Select all
dbk_initialize()
openProcess([[cheatengine-x86_64.exe]])
reinitializeSymbolhandler()
autoAssemble([[
alloc(NewVirtualProtectEx,256, VirtualProtectEx )
alloc(OriginalVirtualProtectEx, 8, VirtualProtectEx)
registersymbol(NewVirtualProtectEx)
registersymbol(OriginalVirtualProtectEx)
label(notself)
NewVirtualProtectEx:
cmp ecx,ffffffff
jne short notself
jmp [OriginalVirtualProtectEx]
notself:
xor rax,rax
ret
]])
s=generateAPIHookScript("VirtualProtectEx", "NewVirtualProtectEx", "OriginalVirtualProtectEx")
--stupid bug in generateAPIHookScript forgets the alloc originalcall0
s=[[alloc(originalcall0, 64, VirtualProtectEx)
]]..s
autoAssemble(s)
dbk_useKernelmodeOpenProcess()
dbk_useKernelmodeProcessMemoryAccess()