 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
gid2525 Expert Cheater
Reputation: 2
Joined: 21 Oct 2013 Posts: 103
|
Posted: Fri Mar 18, 2016 12:59 pm Post subject: So whats wrong with this asm script? Crashing game. |
|
|
Here it is:
| Code: |
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
cmp byte ptr [eax+3C8],20
je fs2_open_3_7_2.exe+1CA500
originalcode:
movss [edi+30],xmm1
exit:
jmp returnhere
"fs2_open_3_7_2.exe"+1CA4FB:
jmp newmem
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"fs2_open_3_7_2.exe"+1CA4FB:
movss [edi+30],xmm1
//Alt: db F3 0F 11 4F 30
|
I want to do a compare and if its equal then jump to fs2_open_3_7_2.exe+1CA500 which is the next line of code
AFTER
| Code: |
movss [edi+30],xmm1
|
That is if [eax+3C8] = 20 (decimal 32) then jump OVER movss [edi+30],xmm1 and don't run it. Otherwise do movss [edi+30],xmm1. Here is what the injection looks like:
| Code: |
04170000 - 80 B8 C8030000 20 - cmp byte ptr [eax+000003C8],20 { 32 }
04170007 - 0F84 F3A445FC - je fs2_open_3_7_2.exe+1CA500
0417000D - F3 0F11 4F 30 - movss [edi+30],xmm1
04170012 - E9 E9A445FC - jmp fs2_open_3_7_2.exe+1CA500
|
|
|
| Back to top |
|
 |
Cake-san Grandmaster Cheater
Reputation: 8
Joined: 18 Dec 2014 Posts: 541 Location: Semenanjung
|
|
| Back to top |
|
 |
gid2525 Expert Cheater
Reputation: 2
Joined: 21 Oct 2013 Posts: 103
|
Posted: Sat Mar 19, 2016 5:11 am Post subject: |
|
|
| Cake-san wrote: | | Code: |
[ENABLE]
alloc(newmem,2048)
label(returnhere)
newmem:
cmp byte ptr [eax+3C8],20
je returnhere
movss [edi+30],xmm1
jmp returnhere
"fs2_open_3_7_2.exe"+1CA4FB:
jmp newmem
returnhere:
[DISABLE]
dealloc(newmem)
"fs2_open_3_7_2.exe"+1CA4FB:
db F3 0F 11 4F 30
//movss [edi+30],xmm1
|
 |
Strange, still crashes. I can NOP movss [edi+30],xmm1 and it does not crash. Whats the deal with that?
|
|
| Back to top |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Sat Mar 19, 2016 5:17 am Post subject: |
|
|
Did you let Cheat Engine generate the injection cdoe for you?
Also, are you sure eax always holds a value? Because if eax i.e. is zero, then you'll get an error or memory leaks (which will cause the game to crash) when trying to read a value from [eax+3c8].
|
|
| Back to top |
|
 |
|
|
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
|
|