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 


Need to copy and add a value to a temporary variable?

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

Joined: 22 Dec 2014
Posts: 1

PostPosted: Mon Dec 22, 2014 2:36 am    Post subject: Need to copy and add a value to a temporary variable? Reply with quote

Let's say I have found a ram value for money or score, and I wanted to keep it stored in a variable outside of the program's ram - so I can keep the value saved even after I close the game.
What would be the easiest way to achieve that? Would that require me to know LUA scripting or C programming?
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: Mon Dec 22, 2014 5:52 am    Post subject: Reply with quote

some basic LUA and a bit of assembler knowledge is needed

First this lua command:
Code:

sharedblock=allocateSharedMemory("anameyoumadeup", 4096)
print(string.format("The block is now at %x", sharedblock))
registerSymbol("sharedblock",sharedblock)


this will allocate a block of memory that will keep it's contents even when the process has terminated.
To access it again, just target any other process (could be a new instance of the game) and then execute that lua command again.
The new process will get a memory block with the previous contents (the address can be different so keep that in mind)

e.g to use it in a code injection:
Code:

alloc(newmem, 2048)
label(returnhere)
label(originalcode)

newmem:
mov [sharedblock+xxx],ecx

originalcode:
...
jmp returnhere

12345678:
jmp newmem
returnhere:


then when the game has closed target a new process and execute the lua command. Then you can watch the previous memory, or re-activate the auto assembler command so it hooks it again and updates the new location

One thing you need to keep track of though is if you've already executed allocateSharedMemory once in that process as it will make a copy every time, even if it's already in. Which could eventuality (after 30 thousand times or so) make the game run out of memory

_________________
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
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