Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


change RIP/EIP with Lua breakpoint, easy/fast template

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
marco.feigenbaum
How do I cheat?
Reputation: 0

Joined: 14 Jan 2025
Posts: 1

PostPosted: Tue Jan 14, 2025 4:50 am    Post subject: change RIP/EIP with Lua breakpoint, easy/fast template Reply with quote

Bypasses basic integrity checks (e.g., works in tutorial games, step 2, as shown by Dark Byte).
Just set the five variables.
Automatically sets RIP/EIP based on targetIs64Bit().
Not suitable for most modern games.
This example works for step 2 of games tutorial.

VARIABLES:

    allocatedName: (string) — Name of the symbol.
    addressToPatch: (string) — String that contains the offset where the breakpoint to change RIP/EIP register will be placed.
    debugType: (integer) — Debug type: 0 (default), 1 (WinDbg), 2 (VEH), 3 (kernel).
    enableAsmCode: (string) — Block of assembly code to enable.
    disableAsmCode: (string) — Block of assembly code to disable.



TEMPLATE
Code:
[ENABLE]
{$lua}
-- VARIABLES START
allocatedName = "ASymbolicSymbol"
addressToPatch = "gtutorial-x86_64.exe+400E3"
debugType = 1

enableAsmCode = [[
cmp rdx, 1
mov edx, 0
je set_edx_64
jmp originalcode

set_edx_64:
mov edx, 64

originalcode:
sub [rax+60], edx
ret
add [rax], al
]]

disableAsmCode = [[
sub [rax+60], edx
ret
add [rax], al
]]

-- VARIABLES END, DO NOT EDIT BELOW - JUST EDIT ALLOCATION AMOUNT IF NEEDED (2048)

function debugger_onBreakpoint()
    currentAddress = getAddress(allocatedName)
    if targetIs64Bit() then
        RIP = currentAddress
    else
        EIP = currentAddress
    end
    debug_continueFromBreakpoint(co_run)
end

reinitializeSymbolhandler()
autoAssemble([[
alloc(]] .. allocatedName .. [[, 2048, ]] .. addressToPatch .. [[)
registersymbol(]] .. allocatedName .. [[)
label(returnhere)
label(originalcode)
label(exit)

]] .. allocatedName .. [[:
]] .. enableAsmCode .. [[

exit:
jmp returnhere

]] .. addressToPatch .. [[:
returnhere:
]])

debugProcess(debugType)
debug_setBreakpoint(getAddress(addressToPatch))
{$asm}
[DISABLE]
{$lua}
debug_removeBreakpoint(getAddress(addressToPatch))
autoAssemble([[
dealloc(]] .. allocatedName .. [[)
unregistersymbol(]] .. allocatedName .. [[)
]] .. addressToPatch .. [[:
]] .. disableAsmCode .. [[
]])
{$asm}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites