keyongtech


  keyongtech > win32.programmer.* > win32.programmer.kernel > 08/2006

 #1  
08-06-06, 05:50 PM
Jacky Luk
If I have

idata:0x401230 GetEnvironmentStrW

Normally you calculate the apiaddr,
GetProcAddress(...);
you get the hi-address of the module say 0x71012290
This is the callee address
If I want to get the caller address,
how to get it? 0x401230 which is determined during making a call in
disassembler.
Thanks
Jack
 #2  
08-06-06, 05:54 PM
Jacky Luk
I realize that this address is embedded in the application
right?


"Jacky Luk" <jl> 撰寫於郵件新聞:OBCBqhXuGHA.2392...
[..]
 #3  
08-06-06, 07:45 PM
David Jones
Jacky Luk wrote:

> If I have
>
> idata:0x401230 GetEnvironmentStrW
>
> Normally you calculate the apiaddr,
> GetProcAddress(...);
> you get the hi-address of the module say 0x71012290
> This is the callee address
> If I want to get the caller address,
> how to get it? 0x401230 which is determined during making a call in
> disassembler.


I'm not following. You want to find out where in your code you are
calling an API function? If you're inside the called function, look
at the return address on the stack. If you're inside the calling
function, um, you're already there - just look where you are (eip).

.... but why would you need to know this in the first place? The
only valid reason I can think of offhand is a stack trace when logging
an exception -- see the StackWalk64 API.

David
 #4  
08-06-06, 08:09 PM
Jochen Kalmbach [MVP]
Hi David!

> .... but why would you need to know this in the first place? The
> only valid reason I can think of offhand is a stack trace when logging
> an exception -- see the StackWalk64 API.


See: Walking the callstack
[url down]

;-)
 #5  
08-07-06, 02:22 PM
Jacky Luk
Are there any open-source projects for extracting the caller address of an
API?
Thanks
Jack


"Jacky Luk" <jl> 撰寫於郵件新聞:uE0ayjXuGHA.5032...
[..]
Similar Threads
How do I get the IP address of caller using HTTP/S

I've created a WCF WebService that uses basicHttpbinding that is hosted in IIS7. From within the Service I need to get the IP address of the caller, how can I do this? P.S....

C# ASP .NET (VS2005) - how to obtain caller's IP address

Hi, Can someone point me to an MSDN or other location where I can obtain the caller's IP Address? I'd like to put this in the "WebMethod" portion of the program. The intent...

how to get to the src file given a caller address?

Hi, I'm trying to trace a memory leak and managed to get the caller's address (CallersAddress) for my driver. How do I pinpoint which src line it is? cheers

How to discover the caller's IP address?

Hi, I need to know the IP addresses of the PCs that are connected to my SQL Server. The master.dbo.sysprocesses table contains the field net_address. This is supposed to be...

How to discover the caller's IP address?

Hi, I need to know the IP addresses of the PCs that are connected to my SQL Server. The master.dbo.sysprocesses table contains the field net_address. This is supposed to be...


All times are GMT. The time now is 01:14 AM. | Privacy Policy