LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to get all invoked system API of a program (https://www.linuxquestions.org/questions/programming-9/how-to-get-all-invoked-system-api-of-a-program-465874/)

George2 07-20-2006 07:28 AM

how to get all invoked system API of a program
 
Hello everyone,


Suppose we have the source codes, how to get all invoked system API (like printf, open, etc.) other than program self-defined API? Are there any existing tools?

Either on Windows or on Linux platform is ok.


thanks in advance,
George

bigearsbilly 07-20-2006 07:40 AM

is truss on linux?

strace might do what you want

do man -k system | grep calls

George2 07-21-2006 01:34 AM

Thank you bigearsbilly!


Quote:

Originally Posted by bigearsbilly
is truss on linux?

strace might do what you want

do man -k system | grep calls

I have checked that strace can only get the system calls, when the program runs. But as you know, program may invoke different system calls according to different scenarios. So, I think the best way is to analyze the complete list of invoked system calls, is to analyze statically other than dynamically (when program runs) by analyzing the executable file -- other than the running process, agree?


Could strace analyze statically on an executable file other than the running process? Any comments?


regards,
George

jlliagre 07-21-2006 02:12 AM

Quote:

Suppose we have the source codes, how to get all invoked system API (like printf, open, etc.) other than program self-defined API? Are there any existing tools?
Yes, simply run this command:

Code:

nm -u <your-binary-program>


All times are GMT -5. The time now is 07:05 AM.