Root > Reference > All Functions > ConvertAddress

Function ConvertAddress

Previous pageReturn to chapter overviewNext page   

Convert address to code to real address of code.

 

Unit

ELowLevel

 

Syntax

 

Code (Delphi)

function ConvertAddress(

const AAddr: Pointer

): Pointer;

 

Parameters

AAddr

Address to code. Usually points to routine.

 

Return value

Adjusted address to code. See remarks. Can be the same value as AAddr.

 

Remarks

This routine is used for hooks.

 

If you have an address to routine - it can points to code itself or to JMP instruction to code. Typical example is import table.

 

This function takes address and checks if there is a JMP instruction at this address.

If there is no JMP - then function returns value unchanged.
If there is JMP opcode - then function returns target of that JMP.

Function doesn't raise access violation in case of unavailable memory.

 

Examples

 

Code (Delphi)

var

P: Pointer;

begin

P := @GetWindowText; // P can point to routine itself or stub with JMP

P := ConvertAddr(P); // now P points to routine itself

end;

 

See also




Send feedback... Build date: 2018-11-26
Last edited: 2018-11-26
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_elowlevel_convertaddress.php