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 


[ASK] How to change register value in CE

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
n1vX
Advanced Cheater
Reputation: 0

Joined: 27 May 2007
Posts: 61

PostPosted: Tue Mar 01, 2011 2:00 am    Post subject: [ASK] How to change register value in CE Reply with quote

Hi,
Can someone help me, I want to know how to change register value (eax) of an address with LUA script ? So I can toggle it enable/disable easily.
And how to implement it in new CE trainer ?
How to view register stack in memory disassembler (I want to know about its value).

Sorry for my bad English, I hope you understand.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Tue Mar 01, 2011 6:59 am    Post subject: Reply with quote

the following code simulates a change reg at breakpoint bp
Code:

changeregaddress=0x0045c498 --change this to the address you want
debug_removeBreakpoint(changeregaddress) --remove it if it was set

function debugger_onBreakpoint()
  if (EIP == changeregaddress) then
    hasChangedARegister=true --obsolete in 6.1
    EAX=0
    changedEAX=true  --obsolete in 6.1

    debug_continueFromBreakpoint(0) --run (bug in 6.0: it's always run)
   
    return 1 --I handled it so don't tell the user
  else
    return 0 --unexpected breakpoint, show the the user
  end
end

 
debug_setBreakpoint(changeregaddress)


as to implementing it in the trainer: Just running this code will cause the breakpoint to be set and the handler will work
So just set it under a button or at launch time

To disable just run debug_removeBreakpoint(changeregaddress)


and the register stack will show automatically when you've hit a breakpoint and it's waiting for user intput on how to continue

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
n1vX
Advanced Cheater
Reputation: 0

Joined: 27 May 2007
Posts: 61

PostPosted: Tue Mar 01, 2011 8:58 pm    Post subject: Reply with quote

Thanks Dark Byte
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 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