View previous topic :: View next topic |
Author |
Message |
shakib187 Expert Cheater
Reputation: 0
Joined: 24 May 2007 Posts: 215
|
Posted: Mon Apr 27, 2015 9:26 am Post subject: Get Asynckeystate in ASM |
|
|
Code: |
pushad
pushfd
push 'x'
call GetAsyncKeyState
shr ax,#15
cmp ax,1
popfd
popad
jne originalcode
mov [eax+000000AC],(float)10
mov eax,[eax+000000AC]
jmp returnhere
originalcode:
mov [eax+000000AC],(float)85
mov eax,[eax+000000AC]
exit:
jmp returnhere
"game.exe"+297E0C:
jmp newmem
nop
returnhere:
|
ax always = 1 for some reason my key is not pressed!!!
|
|
Back to top |
|
 |
Fresco Grandmaster Cheater
Reputation: 4
Joined: 07 Nov 2010 Posts: 600
|
|
Back to top |
|
 |
shakib187 Expert Cheater
Reputation: 0
Joined: 24 May 2007 Posts: 215
|
Posted: Mon Apr 27, 2015 10:16 am Post subject: |
|
|
still not working ax is always 1
|
|
Back to top |
|
 |
Fresco Grandmaster Cheater
Reputation: 4
Joined: 07 Nov 2010 Posts: 600
|
Posted: Mon Apr 27, 2015 10:22 am Post subject: |
|
|
While you debug keep x pressed at all times.
Otherwise find some other code to test the function.
Try the CE Trainer.
First step, make a code that increases health with 1 whenever you press x, keep in mind that the place where you inject the code has to be constantly in execution, so find a code that accesses not writes, it also have to access the address no matter if the game is paused...
_________________
... Fresco |
|
Back to top |
|
 |
shakib187 Expert Cheater
Reputation: 0
Joined: 24 May 2007 Posts: 215
|
Posted: Mon Apr 27, 2015 10:24 am Post subject: |
|
|
Fresco wrote: | While you debug keep x pressed at all times.
Otherwise find some other code to test the function.
Try the CE Trainer.
First step, make a code that increases health with 1 whenever you press x, keep in mind that the place where you inject the code has to be constantly in execution, so find a code that accesses not writes, it also have to access the address no matter if the game is paused... |
While I debug? what do you mean by this??
and okay I'll go try and make a script that will increase by 1
and its in constant execution.
edit: nvm I got it, apparently you couldnt have pushfd
Last edited by shakib187 on Mon Apr 27, 2015 10:26 am; edited 1 time in total |
|
Back to top |
|
 |
Geri Moderator
Reputation: 111
Joined: 05 Feb 2010 Posts: 5636
|
Posted: Mon Apr 27, 2015 10:25 am Post subject: |
|
|
First of all, you have used popfd before the jne instruction, which means that you have made the compare and then deleted the result of the compare. popfd has to come after the jump.
Here is my template:
pushfd
pushad
push '1'
call GetAsyncKeyState
shr ax,#15
cmp ax,1
popad
jne originalcode
...
popfd
If that won't fix it, then replace #15 with (int)15.
_________________
Last edited by Geri on Mon Apr 27, 2015 10:26 am; edited 1 time in total |
|
Back to top |
|
 |
Fresco Grandmaster Cheater
Reputation: 4
Joined: 07 Nov 2010 Posts: 600
|
Posted: Mon Apr 27, 2015 10:25 am Post subject: |
|
|
the fact that CE tells you the value of ax is called "debugging"
By snooping around the code of a program it is said that you "debug" said program.
_________________
... Fresco |
|
Back to top |
|
 |
shakib187 Expert Cheater
Reputation: 0
Joined: 24 May 2007 Posts: 215
|
Posted: Mon Apr 27, 2015 10:28 am Post subject: |
|
|
Thanks Geri, that was it.
Thanks Fresco also
|
|
Back to top |
|
 |
|