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 


[Help] Editing code

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

Joined: 25 Jun 2020
Posts: 1

PostPosted: Thu Jun 25, 2020 8:36 am    Post subject: [Help] Editing code Reply with quote

I've been trying to edit the damage of my weapon. I have found the part of the code that edits the value, but I don't know assembly well enough to edit it correctly.
This is the code around it (with the line in red):
add esp,10
mov [edi+000000AC],eax
test eax,eax
jle 0E0FCB7F

From what I understand, that line means "take the value in eax, and put it in the adress edi+000000AC
So by replacing eax with 0, that would mean that health is set to 0 when I hit.
However, doing that, Cheat Engine warns me that "the generated code is 10 bytes long, but the selected opcode is 6 bytes long! Do you want to replace the incomplete opcodes with NOP's?". In the past, this has always crashed it, so I don't know what to do. Any ideas?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Thu Jun 25, 2020 10:13 am    Post subject: Reply with quote

Make a code injection script.

Highlight that instruction in the disassembler, go to Tools -> Auto Assembler, and then select Template -> AOB Injection. Give a unique name to the injection (not just INJECT) and click through the other stuff. Add this instruction:
Code:
...
newmem:
  xor eax,eax  // sets eax to 0
  mov [edi+AC],eax
  jmp return
...

Try the CE tutorial. There are plenty of guides and videos of other people completing it if you need help.

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