Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumenting function calls with symbol names #433

Open
qinkunbao opened this issue Mar 2, 2021 · 2 comments
Open

Instrumenting function calls with symbol names #433

qinkunbao opened this issue Mar 2, 2021 · 2 comments

Comments

@qinkunbao
Copy link

Hi,

I am reading the document from

http://s2e.systems/docs/Howtos/LuaInstrumentation.html

It demonstrates an example on instrumenting a function by its address. I was wondering if the same goal can
be achieved with a symbol name. It will be a very useful feature for us to analyze some binaries with debugging information included. Some other binary instrument tools (e.g., Intel Pin) also offer such functionalities.

@vitalych
Copy link
Member

vitalych commented Mar 2, 2021

Yes, it would be a good addition. You could add a "function_name" to the configuration and resolve it to a program counter here [1]. To resolve this, you will need to load the binary file and extract the exported functions using the Vmi plugin [2]. The vmi::ExecutableFile class lets you extract exported functions (works only for Windows PE files currently [3]).

[1] https://github.com/S2E/s2e/blob/master/libs2eplugins/src/s2e/Plugins/Lua/LuaFunctionInstrumentation.cpp#L125
[2] https://github.com/S2E/s2e/blob/master/libs2eplugins/src/s2e/Plugins/Core/Vmi.h#L70
[3] https://github.com/S2E/s2e/blob/master/libvmi/include/vmi/PEFile.h#L126

@qinkunbao
Copy link
Author

Thx

@vitalych vitalych reopened this Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants