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 


How to do dynamic(?) address in LUA script?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
zbAdd
How do I cheat?
Reputation: 0

Joined: 30 Jun 2014
Posts: 7

PostPosted: Wed Jul 02, 2014 11:16 pm    Post subject: How to do dynamic(?) address in LUA script? Reply with quote

Hello.

I am trying to do an infinite health on some game. That's the code below i override. Thing is the same code is used for enemies, so i had to find a (static) pointer for the player's data. So now my health is at [[jk2gamex86.dll+16F794]+218], with the base address loaded on ESI. The code below works when i have the game attached, but when it's not attached i cannot assign it to the cheat table cause it can't resolve jk2gamex86.dll+16F794.

So i am wondering, would it work if i made a trainer? Is there a more appropriate way to do this maybe?

I tried also this: registersymbol(g1, jk2gamex86.dll+16F794)
but i get an error message saying "was supposed to be added to the symbollist but it wasn't declared"

Thanks in advance.

Code:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
push eax
mov eax,[jk2gamex86.dll+16F794]
cmp eax,esi
pop eax
jz k1

originalcode:
sub edx,ebx
k1:
cmp ecx,26
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 42

Joined: 09 Nov 2005
Posts: 2672

PostPosted: Thu Jul 03, 2014 5:40 am    Post subject: Re: How to do dynamic(?) address in LUA script? Reply with quote

This doesn't belong in LUA section.

And your code is fine, when your trainer is running [jk2gamex86.dll+16F794] will get resolved to a static address to which CE can inject.

Of course you can't do anything when the game isn't running because that dll is not loaded in memory.

So use your current code as-is, compile the trainer and test it for yourself, it will work fine.

zbAdd wrote:
Hello.

I am trying to do an infinite health on some game. That's the code below i override. Thing is the same code is used for enemies, so i had to find a (static) pointer for the player's data. So now my health is at [[jk2gamex86.dll+16F794]+218], with the base address loaded on ESI. The code below works when i have the game attached, but when it's not attached i cannot assign it to the cheat table cause it can't resolve jk2gamex86.dll+16F794.

So i am wondering, would it work if i made a trainer? Is there a more appropriate way to do this maybe?

I tried also this: registersymbol(g1, jk2gamex86.dll+16F794)
but i get an error message saying "was supposed to be added to the symbollist but it wasn't declared"

Thanks in advance.

Code:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
push eax
mov eax,[jk2gamex86.dll+16F794]
cmp eax,esi
pop eax
jz k1

originalcode:
sub edx,ebx
k1:
cmp ecx,26

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Thu Jul 03, 2014 6:13 am    Post subject: Re: How to do dynamic(?) address in LUA script? Reply with quote

zbAdd wrote:
but when it's not attached i cannot assign it to the cheat table cause it can't resolve jk2gamex86.dll+16F794


It is normal. When you have this window open:

CE won't allow you to do that (assign script to cheat table).







Do this:


Assign it to cheat table.

open assigned script


You see, now it is in different mode (look at caption of form). In this mode, we can force CE to ignore syntaxchecker warning and apply changes.



And yes, it should work. (depends on pointer stability you found)

_________________
Back to top
View user's profile Send private message MSN Messenger
zbAdd
How do I cheat?
Reputation: 0

Joined: 30 Jun 2014
Posts: 7

PostPosted: Fri Jul 04, 2014 11:49 pm    Post subject: Reply with quote

Thanks guys, lots of useful replies here. I just found out later on, that the game i was trying to hack had a ton of cheats already included natively on the client. Embarassed
But that workaround with assigning the script in the table without the dynamic references, and then edit to add them, is sure very nice to know.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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