[fpc-pascal] How to get address of MyFunction in MyFunction?

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Jul 18 14:42:21 CEST 2010


On 18 Jul 2010, at 13:14, Žilvinas Ledas wrote:

> I want to use it this way:
> 1) Gel all @unitname.function addresses.
> 2) Use disassembler to find nearest next RET.
> 3) Then I assume that I have start and end of the function in the binary file.
> 
> It works at least for the concept-showing app with some functions and enabled optimizations when compiling. Do I have some conceptual flaw?

Yes: there is no guarantee that a function will contain only one "ret" (it is that way currently for compiler-generated code, but that can change at any time).


Jonas


More information about the fpc-pascal mailing list