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 


Hooking assembly (easy question for assembly ppl who know)
Goto page Previous  1, 2
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Sat Aug 16, 2008 3:54 pm    Post subject: Reply with quote

I think call means function.. and retn means (RET) returns back to where call was is +1 and since call was in my naked function it should stay in my naked function should leave it so i got no comment.. Plus i dont know where to learn more.

I gotta learn where CALL holds the number that tells it where to retn and modify it Laughing joking i dont think its possible!

u cant do jmp to Game Decrypt because it requires arguments I believe.

call takes arguments from pushes..
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sat Aug 16, 2008 4:52 pm    Post subject: Reply with quote

Call pushes EIP onto the stack so that RETN knows where to go. Thats why push ADDRESS + RETN = a jump. RETN uses the [esp] to return and the number with retn is to clean up the parameters if there are any.
_________________
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Sun Aug 17, 2008 3:49 am    Post subject: Reply with quote

I'd advise learning x86 assembler first :/

Sponge is right cept it pushes address of next command, eip + size of call Very Happy. But that is definately not eip+1 as pker suggests.

Additionally, JMP just changes the eip. If you JMP into a function, the RETN will ABSOLUTELY NOT go back the the command after the JMP. It will pop the first dword on the stack ([esp]) into eip.

Your options:
A - Call call
B - Jmp call jmp

A:
Change the call to Orig to call Hack
In Hack, call Orig with proper arguments (repush args to Hack)
Orig will complete its task and return into Hack
Do what you want with the now available decoded content. (if the function does not return a pointer to the decoded packet, you may have to store the pointer before the call)
Adjust stack if necissary, and return

B:
Change the call to Orig to a jump to Hack
In Hack, call Orig. No stack fuddling is necessary since you are in the same stack frame / stack isn't smashed.
Orig will complete its task and return into Hack
Do what you want with the now available decoded content.
No stack adjustments are necissary. Now you must jump to the command after the modified call to Orig, the spot Orig would normally return to.

~nog_lorp
PS: Hi spongeh!

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sun Aug 17, 2008 2:53 pm    Post subject: Reply with quote

you know what i meant nog. Smile where'd you go? Sad
_________________
Back to top
View user's profile Send private message
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Mon Aug 18, 2008 8:20 am    Post subject: Reply with quote

yeah nog dude, I havent seen you around for a shit long time, but i guess im not really here anymore ever either.
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Mon Aug 18, 2008 4:54 pm    Post subject: Reply with quote

Code cave the entire instructions

Code:

int tempsize;
char *tempbuff;
__asm{
mov tempsize, edi
mov tempbuff, eax
push edi
push eax
call myrecv
}
return tempbuff;
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Mon Aug 18, 2008 5:07 pm    Post subject: Reply with quote

in a naked function if i did.

int and char*'s outside the assembly inline function wouldn't that mess up assembly.. also I think im almost done anyways without using tempsize tempbuffer's its going alright atm.

just crashes but atleast I see first RECV undecrypted.



yes

Causes crash because EBP is my packet size -__- and
program does [EBP-4] to store values on stack... but EBP is my size so its not possible to store there..






MAN this is soo crazy...

AT LOGIN SCREEN
EBX = PACKET
EBP = SIZE

INSIDE GAME
ESI = END OF PACKET PACKET=PACKET-SIZE;
EDX = SIZE

now if i load up hack before inside game -.- will crash game
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Wed Aug 20, 2008 11:02 pm    Post subject: Reply with quote

EBP is the base pointer of the stack. You are confused.

Sponge/undead: I went to sleep oO. Naw I got bored of MS hacking, moved on to a couple legit games and some other hacking.

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Wed Aug 20, 2008 11:38 pm    Post subject: Reply with quote

d\w man.. this topic is old.. needs lock... i fixed all all works perfectly..
_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Thu Aug 21, 2008 3:08 pm    Post subject: Reply with quote

Locked due to request of OP.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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