Suppose I compile a C/C++ file to binary. Say, the file defines a function foo()
.
How would I locate this function in the binary? By locating, I mean find the exact position.
I assume the question depends on whether we are considering Windows or Linux, so lets say the executable is in PE format.
Does the compiler erase all naming, so that locating the function by name is impossible? That is, I must do a pattern search in the binary?
I know that DLL's has an export table, which could help in locating the function within, but executables on Windows do not have such table...