| View previous topic :: View next topic |
| Author |
Message |
ta_trainer Advanced Cheater
Reputation: 0
Joined: 24 Dec 2006 Posts: 76
|
Posted: Sat Jan 31, 2009 6:43 pm Post subject: Need Urgent Help with Assembly plz |
|
|
Hi
I have the following function call that ends with this:
mov al, bl
mov large fs:0, ecx
pop ebx
mov esp, ebp
pop ebp
retn 8
if I modify the first line to "mov al, 1" to return 1 all the time, the hack works with some issues
the above function call is called from 2 different places, one of them is this:
mov eax, [esp+arg_0]
mov eax, [eax]
push esi
push eax
call the_above_function***
test al, al
setnz al
retn 4
I want this *** to return the same answer as if I have modified the first call
how can I do that
I tried replacing "call the_above_function***" with "mov al, 1" but it crashed!!!?
|
|
| Back to top |
|
 |
smartz993 I post too much
Reputation: 2
Joined: 20 Jun 2006 Posts: 2013 Location: USA
|
Posted: Sat Jan 31, 2009 7:10 pm Post subject: |
|
|
Hook after the pop ebp, and check against the value of ESP.
If the value of ESP is the address after the address of the actual CALL, then do whatever.
|
|
| Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Sat Jan 31, 2009 8:01 pm Post subject: |
|
|
You crashed because of this:
Notice the push esi; push eax? Values are being pushed onto the stack without being popped (by the function). You need to nop those and then change the call to "mov al, 1." Then it won't crash.
|
|
| Back to top |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Sun Feb 01, 2009 9:57 am Post subject: |
|
|
| rapion124 wrote: | You crashed because of this:
Notice the push esi; push eax? Values are being pushed onto the stack without being popped (by the function). You need to nop those and then change the call to "mov al, 1." Then it won't crash. |
Wrong...
These are parameters, notice the ret 8 at the function, that means it should pop 8 bytes from the stack. (and esi and eax are both 4 bytes each)
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sun Feb 01, 2009 12:45 pm Post subject: |
|
|
| Zerith wrote: | | rapion124 wrote: | You crashed because of this:
Notice the push esi; push eax? Values are being pushed onto the stack without being popped (by the function). You need to nop those and then change the call to "mov al, 1." Then it won't crash. |
Wrong...
These are parameters, notice the ret 8 at the function, that means it should pop 8 bytes from the stack. (and esi and eax are both 4 bytes each) |
I think he meant that they are not pushed when he removed the call (but left the parameters there)
|
|
| Back to top |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Sun Feb 01, 2009 1:22 pm Post subject: |
|
|
Oh, I didn't see that he replaced the call, my bad.
Well, the best thing you can do, instead of replacing the call and removing the parameters, just inject a small script:
| Code: | xor eax,eax
inc eax
retn 8 |
At the function you want to return 1.
|
|
| Back to top |
|
 |
ta_trainer Advanced Cheater
Reputation: 0
Joined: 24 Dec 2006 Posts: 76
|
Posted: Tue Feb 03, 2009 4:23 pm Post subject: |
|
|
thank you guys
I managed it as per ur help
but a CRC check cought me
as per Dark Byte, a kernal breakpoint with EAX = 1 would help
and it did
thanks to you all
|
|
| Back to top |
|
 |
|