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 


A little help with understanding code injection?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
UnIoN
Expert Cheater
Reputation: 2

Joined: 17 May 2011
Posts: 146

PostPosted: Mon Jan 13, 2014 8:26 pm    Post subject: Reply with quote

pls read my edited post
Back to top
View user's profile Send private message
vng21092
Grandmaster Cheater
Reputation: 15

Joined: 05 Apr 2013
Posts: 644

PostPosted: Mon Jan 13, 2014 8:38 pm    Post subject: Reply with quote

this was strictly for learning purposes, up until now all I knew was how to find pointers and NOP instructions, and that only gets so far so I wanted to dig a little deeper into coding. And I've got GREAT news! I figured it out
_______________________

[Enable]
alloc(newmem,2048)
label(returnhere)
label(infinitehealth)
label(infinitehealth_2)
label(infinitehealth_status)
registersymbol(infinitehealth_status)
label(oneshotkill)
label(oneshotkill_2)
label(oneshotkill_status)
registersymbol(oneshotkill_status)
label(originalcode)

newmem:
cmp [esi+5c],0
je infinitehealth
cmp [esi+5C],7FF
je oneshotkill
jmp originalcode

infinitehealth:
cmp [infinitehealth_status],1
je infinitehealth_2
jmp originalcode

infinitehealth_2:
mov [esi+00000150],64
jmp returnhere

oneshotkill:
cmp [oneshotkill_status],1
je oneshotkill_2
jmp originalcode

oneshotkill_2:
mov [esi+00000150],0
jmp returnhere

originalcode:
mov [esi+00000150],ecx
jmp returnhere

infinitehealth_status:
dd 0
oneshotkill_status:
dd 0

"iw5sp.exe"+2205A:
jmp newmem
nop
returnhere:

[Disable]
"iw5sp.exe"+2205A:
mov [esi+00000150],ecx
unregistersymbol(infinitehealth_status)
unregistersymbol(oneshotkill_status)
dealloc(newmem)
_______________________

Instead of the enemy ID being 2047, 2047 was a decimal value, when in the auto assembler needed a hex value, I figured this because "mov [esi+00000150],64" 64 HEX = 100 DEC, 2047 HEX = 7FF, NOW the code works perfectly, and I separated the code so the infinite health and one shot kill can work independently of each other. Thanks a lot for everything =]

Back to top
View user's profile Send private message
UnIoN
Expert Cheater
Reputation: 2

Joined: 17 May 2011
Posts: 146

PostPosted: Mon Jan 13, 2014 9:26 pm    Post subject: Reply with quote

glad you finaly sorted it out, i bet you feel great now that you solved it for yourself

another tip for you:
if dealing with numbers, you can write for example
Code:
mov [eax],(int)200
mov [eax],(float)2.99
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 programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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