| View previous topic :: View next topic |
| Author |
Message |
Thunder_Bird Cheater
Reputation: 0
Joined: 27 Apr 2018 Posts: 33 Location: pakistan
|
Posted: Tue Nov 24, 2020 8:55 am Post subject: putting a condition on an assembly instruction |
|
|
| Code: |
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
newmem:
originalcode:
fstp dword ptr [ebx+000000AC]
exit:
jmp returnhere
"game.exe"+7C234:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
"game.exe"+7C234:
fstp dword ptr [ebx+000000AC]
|
this is the script(in the form of original code), what I wanna do is, compare a value(16) to another address and if it is not equal, then execute this(fstp dword ptr [ebx+000000AC]) instrcution. for that I modified the script as:
| Code: |
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
newmem:
fstp dword ptr [ebx+000000AC]
originalcode:
cmp [[mod.dll+00391C34]+244],10
jne newmem
nop
nop
nop
nop
nop
nop
exit:
jmp returnhere
"game.exe"+7C234:
jmp newmem
nop
returnhere:
[DISABLE]
dealloc(newmem)
"game.exe"+7C234:
fstp dword ptr [ebx+000000AC]
|
it simply crashes the game, any help will be appreciated.
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3340
|
Posted: Tue Nov 24, 2020 10:37 am Post subject: |
|
|
Might be crashing due to pointer being invalid, or, FPU not being popped.
Try this.
| Code: | [ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(popFPU)
newmem:
originalcode:
push eax
mov eax,[mod.dll+00391C34]
cmp [eax+244],10
pop eax
jne short popFPU
fstp dword ptr [ebx+000000AC]
exit:
jmp returnhere
popFPU:
fstp st(0)
jmp short exit
"game.exe"+7C234:
jmp newmem
nop
returnhere:
[DISABLE]
"game.exe"+7C234:
fstp dword ptr [ebx+000000AC]
dealloc(newmem)
|
PS
This is not a LUA script
|
|
| Back to top |
|
 |
Thunder_Bird Cheater
Reputation: 0
Joined: 27 Apr 2018 Posts: 33 Location: pakistan
|
Posted: Thu Nov 26, 2020 3:56 am Post subject: |
|
|
| Thanks doode worked <3
|
|
| Back to top |
|
 |
jgoemat Master Cheater
Reputation: 23
Joined: 25 Sep 2011 Posts: 264
|
Posted: Wed Jan 13, 2021 1:19 pm Post subject: |
|
|
It seems to me like your code would always execute it at least once, and get stuck in an endless loop executing the instruction over and over if the value isn't 10:
| Description: |
|
| Filesize: |
18 KB |
| Viewed: |
1442 Time(s) |

|
|
|
| Back to top |
|
 |
|