| View previous topic :: View next topic |
| Author |
Message |
h4c0r-BG Master Cheater
Reputation: 0
Joined: 29 Nov 2006 Posts: 449 Location: The yogurt country
|
Posted: Sun Nov 23, 2008 11:24 am Post subject: [Delphi] Spying a value in an API (without hooking) |
|
|
I want to spy permanently the value of glDisable which it holds without hooking the function itself because it makes FPS LAG in the game.
I've been wondering if there is a nicer way to do do it like "only spying it" without modifying the original API code.
The function holds only one cardinal value.
void glDisable(
GLenum cap
);
Any sugestions?
_________________
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Sun Nov 23, 2008 6:06 pm Post subject: |
|
|
The only way I can think of off hand would be to scan the stack of the target process for an address that would be the return from the call.
i.e:
| Code: | push cap
call glDisable
blah blah blah // Find this return address on stack
|
You can then pull the value off the stack based on that assumption. Keep in mind the stack gets overwritten a lot, and as a whole this method is just a novelty. You did ask for a way other than hooking, amirite?
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Mon Nov 24, 2008 12:34 pm Post subject: |
|
|
| Code: |
*(WORD*)GlDisable = 0xcc;
WaitForDebugEvent();
|
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Mon Nov 24, 2008 2:25 pm Post subject: |
|
|
| BanMe wrote: | | Code: |
*(WORD*)GlDisable = 0xcc;
WaitForDebugEvent();
|
|
* ( BYTE * ) ?
_________________
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Mon Nov 24, 2008 10:03 pm Post subject: |
|
|
| samuri25404 wrote: | | BanMe wrote: | | Code: |
*(WORD*)GlDisable = 0xcc;
WaitForDebugEvent();
|
|
* ( BYTE * ) ? |
This is still hooking, so shouldn't even be considered.
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Tue Nov 25, 2008 12:52 pm Post subject: |
|
|
| Read the stacks of the call.
|
|
| Back to top |
|
 |
|