View previous topic :: View next topic |
Author |
Message |
7ru3817 Newbie cheater
Reputation: 0
Joined: 21 May 2010 Posts: 14
|
Posted: Thu Mar 03, 2011 6:02 am Post subject: Hooking Variadic functions |
|
|
I can't find any help for hooking this kind of functions for example
int sprintf ( char * str, const char * format, ... );
|
|
Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Thu Mar 03, 2011 8:47 am Post subject: |
|
|
Such functions as those usually use the cdecl calling convention. Since it is the caller that cleans the stack, there can be any number of parameters. See MSDN's comparison of different calling conventions here.
Last edited by Innovation on Thu Apr 19, 2012 5:32 pm; edited 1 time in total |
|
Back to top |
|
 |
7ru3817 Newbie cheater
Reputation: 0
Joined: 21 May 2010 Posts: 14
|
Posted: Thu Mar 03, 2011 9:18 am Post subject: |
|
|
Yea I know that but how trampoline will looks like if I don't know how many parametres i need to push?
|
|
Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Thu Mar 03, 2011 9:34 am Post subject: |
|
|
why the fuck would you wanna hook that shit ?
|
|
Back to top |
|
 |
7ru3817 Newbie cheater
Reputation: 0
Joined: 21 May 2010 Posts: 14
|
Posted: Thu Mar 03, 2011 9:51 am Post subject: |
|
|
The function I want to hook is not sprintf but it is very similar.
|
|
Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Fri Mar 04, 2011 8:55 pm Post subject: |
|
|
Use the parameters that you know are pushed onto the stack to deduce the total number of parameters there are.
|
|
Back to top |
|
 |
|