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 


I need help with Lua (Help will be greatly appreciated)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Stacktrace
Expert Cheater
Reputation: 1

Joined: 04 Jul 2015
Posts: 105

PostPosted: Sun Jun 19, 2016 8:43 am    Post subject: I need help with Lua (Help will be greatly appreciated) Reply with quote

Hi, I'm trying to do something un-usual here.

I'm not fluent nor do I know Lua so it's pretty tedious to what I want to be done.

I basically want a Lua script that copies a register from an address let's say..
it'll "debug" an address, find out what the register for EAX is, copy EAX and paste EAX into EDX on another address. Get it?

Move the register from an address into the register of a different address.

Move the address of EAX that is in the register of "0x1337" into the register of EDX on address "0x7060"
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Sun Jun 19, 2016 9:26 am    Post subject: Reply with quote

So, you want to set two break-on-access breakpoints on two different addresses, use one as the source for getting the value of a register, and use the other as the destination for setting the value of a register using the value of the first one?

If more than one instruction ever accesses either of those addresses, you'll have to take those into account. You'd be better off using a couple code injections to do that.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Jun 19, 2016 10:03 am    Post subject: Reply with quote

Yea, no reason to use Lua for this.
Code:
globalalloc(myvar,4)
...
code:
  mov [myvar],eax
  //original code
  jmp return
Code:
globalalloc(myvar,4)
...
code:
  cmp [myvar],0
  je @f
  mov edx,[myvar]
@@:
  //original code
  jmp return

But if you insist...
Code:
debug_setBreakpoint(address1, function()
  myvar = EAX
end)

debug_setBreakpoint(address2, function()
  if myvar then
    EDX = myvar
  end
end)
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