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 


Creating a cheat table from code injection

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

Joined: 01 Jun 2007
Posts: 9

PostPosted: Wed Jul 01, 2009 2:08 pm    Post subject: Creating a cheat table from code injection Reply with quote

Hello.

I need to be able to hotkey the injection of certain code.

For example, after finding the mem address and getting the code injection template in the auto assemble window let's say I get this
.
.
.
16 add esp,1c
17 move ebp,[ebp-14]

.
.
.

But I want to be able to toggle between injecting the original code (above) and the next one (added a line and now line 17 is line 18)
.
.
16 add esp,1c
17 mov [ecx-14],4E2
18 move ebp,[ebp-14]
.

.

Also, let's say the address is 1075CF83. How can I turn this into a cheat table with a hotkey. I understand the cheat table would be different for different memory addresses.

Thanks for the help in advance.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Wed Jul 01, 2009 5:57 pm    Post subject: Reply with quote

You can make use of getasynckeystate

As for changing addresses in a code injection that's no problem. Just write down the addressed in modulename+offset notation (use ctrl+m in the disassembler to see that notation)

Then make sure it has an [enable] and [disable] section and then you can assign the script to the current cheat table and save it for other people to use

example to do what you want WHILE x is pressed:
Code:

add esp,1c

pushfd //always wise to save the flags even if it isn't needed
pushad //not sure which registers get modified by getkeystate
push 'X' //key to get the state from (look up virtual keys like VK_F11 on google for their values)
call getasynckeystate
shl ax,f //bit 15 determines if it is currently down
cmp ax,1
jne notpressed

mov [ecx-14],4E2

notpressed:
popad
popfd

mov ebp,[ebp-14]

_________________
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
CatHat
How do I cheat?
Reputation: 0

Joined: 01 Jun 2007
Posts: 9

PostPosted: Wed Jul 01, 2009 7:11 pm    Post subject: Reply with quote

Not sure what you're talking about but I'll look around to find out.
Happy Birthday btw!
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