View previous topic :: View next topic |
Author |
Message |
pox911 Grandmaster Cheater
Reputation: 28
Joined: 29 Nov 2008 Posts: 918
|
Posted: Sun Jun 02, 2013 9:59 pm Post subject: Crash on asm double compare |
|
|
i have an asm script that alters two sections of code. One pulls and stores a value of something im targeting, the other pulls everything in the area.
My first compare is testing if a buton is held down. If its just that then i can easily toggle an effect on everything in the area. If i try to add a second compare after that button toggle then it just crashes. Whether i make it point toward the stored target value or not. I did a simple compare to 0 and it still crashes.
Any idea why just adding a second compare would do that?
Edit: Oddly swapping the compares around made it not crash. Any idea why?
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Sun Jun 02, 2013 10:10 pm Post subject: |
|
|
It's hard to say without seeing the code. Assuming everything is correct, the order of the compare should not matter.
|
|
Back to top |
|
 |
pox911 Grandmaster Cheater
Reputation: 28
Joined: 29 Nov 2008 Posts: 918
|
Posted: Sun Jun 02, 2013 10:13 pm Post subject: |
|
|
Code: | BombMem:
pushad
pushfd
cmp [eax+9],00
jne BombNotPressed
push 11
call GetAsyncKeyState
shr ax,#15
cmp ax,1
jne BombNotPressed |
those are my two compares. Oddly it only crashed when the compare to 0 was after the keypress.
im probably missing something stupid but what is the compare for a single byte and not all 4?
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Jun 03, 2013 6:35 am Post subject: |
|
|
Could you give full AA script, not only a part?
_________________
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Mon Jun 03, 2013 7:37 am Post subject: |
|
|
The most often made mistake is not having popfd/popad in all possible outcomes
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Jun 03, 2013 7:59 am Post subject: |
|
|
and proper order:
GOOD:
pushfd
pushad
popad
popfd
WRONG:
pushfd
pushad
popfd
popad
_________________
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Mon Jun 03, 2013 6:41 pm Post subject: |
|
|
As already suggested, the only thing that comes to mind is improper use of popfd/popad. Also, seeing the entire script would be preferable.
|
|
Back to top |
|
 |
|