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

how can i get all exported functions? #63

Open
cyberhorse208 opened this issue Jan 16, 2024 · 2 comments
Open

how can i get all exported functions? #63

cyberhorse208 opened this issue Jan 16, 2024 · 2 comments

Comments

@cyberhorse208
Copy link

we can see functions in IDA pro like this:

__int64 __fastcall mallopt(int a1, unsigned int a2)
{
...
}

Is there any way we can use a python script to get all functions from an ELF and dump them in a log file in that format?

examples/analysis/dump_func_info.py does dumps something but i don't need.

@aundro
Copy link
Contributor

aundro commented Jan 16, 2024

examples/analysis/dump_func_info.py does dumps something but i don't need.

Do you mean the example is too complex, or that it doesn't work the way it should?

@cyberhorse208
Copy link
Author

cyberhorse208 commented Jan 17, 2024

the example works but it can't provide what i need.

i need a script to get all exported functions from an ELF, in a format like this (ret-value functionname (args)):

__int64 __fastcall mallopt(int a1, unsigned int a2)
__int64 __fastcall xxx(int a1)
__int64 xxx()

just like the functions names we can see in IDA pro's pseudocode window.

btw, i used objdump to get exported functions like this:

objdump -T xxx.so | grep 'DF'|grep '.text' | awk '{print $NF}'|c++filt

and i got something like this:

xxx(unsigned char const*, unsigned long)

as you can see the demangled function name doesn't contain return value.

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