Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-07

How to get function start and end position in executable?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Žilvinas Ledas

Hello all,

I want to implement kind of executable protection using "software guards" (*) - when function (caller) decrypts another function (callee) before calling it and encrypts it again after callee returns. As a result I need to get addresses of my functions (where the asm code starts and ends in the executable). Is there some way to export such info to external file while fpc compiles executable (or maybe afterwards to get this info from executable)?
Any suggenstions would be appreciated!

(*) J. Cappaert, N. Kisserli, D. Schellekens, B. Preneel. "Self-encrypting Code to Protect Against Analysis and Tampering", 2006 (https://www.cosic.esat.kuleuven.be/publications/article-811.pdf)

Regards
Žilvinas Ledas

Reply by email

Jonas Maebe
to Žilvinas Ledas
Žilvinas Ledas wrote
I want to implement kind of executable protection using "software guards" (*) - when function (caller) decrypts another function (callee) before calling it and encrypts it again after callee returns. As a result I need to get addresses of my functions (where the asm code starts and ends in the executable). Is there some way to export such info to external file while fpc compiles executable (or maybe afterwards to get this info from executable)?

After compiling you can run "nm -S progname" to get the symbol addresses in the first column and (where available) the symbol size in the second column.

Jonas

Reply by email

Žilvinas Ledas
to Jonas Maebe

Thanks, I'll try it!

Regards
Žilvinas

Jonas Maebe wrote 16 lines
On 16 Jul 2010, at 12:56, Žilvinas Ledas wrote: > I want to implement kind of executable protection using "software guards" (*) - when function (caller) decrypts another function (callee) before calling it and encrypts it again after callee returns. > As a result I need to get addresses of my functions (where the asm code starts and ends in the executable). Is there some way to export such info to external file while fpc compiles executable (or maybe afterwards to get this info from executable)? > After compiling you can run "nm -S progname" to get the symbol addresses in the first column and (where available) the symbol size in the second column. Jonas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email