Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Need Urgent Help with Assembly plz

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ta_trainer
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2006
Posts: 76

PostPosted: Sat Jan 31, 2009 6:43 pm    Post subject: Need Urgent Help with Assembly plz Reply with quote

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
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Sat Jan 31, 2009 7:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Sat Jan 31, 2009 8:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sun Feb 01, 2009 9:57 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sun Feb 01, 2009 12:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Sun Feb 01, 2009 1:22 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
ta_trainer
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2006
Posts: 76

PostPosted: Tue Feb 03, 2009 4:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites