Qvintus Cheater
Reputation: 0
Joined: 07 Nov 2013 Posts: 32
|
Posted: Sat Jun 07, 2014 7:19 pm Post subject: [Help]CE Tutorial Step 9 (Trying ASM Script) [Solved] |
|
|
Hello there
Once more I sadly must write here to ask for help.
Trying my best here to learn ASM, so I thought why not go through the CE tutorial trying to solve as many things as possible using asm only.
I seem to not grasp how to use a cmp correctly.
I'm trying to figure out if the person getting attacked is on team 1 or 2.
Code: |
[ENABLE]
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
label(player)
label(enemy)
newmem:
cmp [ebx+10],02
je enemy
jne player
originalcode:
//mov [ebx+04],eax
//fldz
player:
nop
fldz
jmp returnhere
enemy:
mov [ebx+04],eax
fldz
jmp returnhere
exit:
jmp returnhere
"Tutorial.exe"+27E76:
jmp newmem
returnhere:
[DISABLE]
dealloc(newmem)
"Tutorial.exe"+27E76:
mov [ebx+04],eax
fldz |
I'm assuming I'm misunderstanding something, since I'm getting:
Code: | Invalid floating point operation
Press OK to ingore and risk data corruption
Press Cancel to kill program |
Then whoever has been attacked insta dies.
As you can probably see I'm trying to figure out where to go depending on ebx+10's value.
Edit: Sorry if there is a lack of info, as I'm still quite new to asm I lack the knowledge as to how much info is needed.
Edit: Apologizes for not searching enough, did some extra searching and figured out my cmp call was correct. However I forgot to return. Correct code has been updated. Any feedback as to what I can optimize is welcome!.
Best regards Qvintus
|
|