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 


Run once code

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Fresco
Grandmaster Cheater
Reputation: 4

Joined: 07 Nov 2010
Posts: 600

PostPosted: Wed Feb 22, 2012 9:39 am    Post subject: Run once code Reply with quote

How do you make a run one code ?
I mean enable the AA code and after it was run once by the game auto disable it ? (the result would be: if player has no ammo ... a "give ammo" cheat, and this has to be run just once ... example: set ammo to 10 then stop setting ammo to 10 immediately after ammo was set to 10)

[EDIT] : how do i do that above ?

I also want to:
Set an address to 10 just once, then decrease the address till 5 and freeze it to 5 and then the address should never turn to 10 anymore.
[EDIT] Solved:

Code:
start:
pushfd
cmp [pointer],0A //(0A in hex = 10)
je decto5 //jump if pointer is equal to 10, if not write 10
mov dword ptr [pointer],A //we suppose the pointer is a 4 byte
popfd // and return
jmp reth

decto5:
cmp [pointer],5 // check if pointer = 5, if yes freeze it to 5
je freeze
popfd
dec [pointer] // of not decrease pointer
jmp reth // and return

freeze:
mov dword ptr [pointer],5 // write 5 to pointer, just to be sure
popfd
jmp reth // and return

"game.exe"+basepointer:
jmp start
reth:

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