2

While reverse engineering an Android process, I wanted to explore the openat function. I noticed that there is a symbol "openat" and another symbol "__openat". What is the difference between these two?

Furthermore, if I use info function openat, I can see more openat related symbols. Can someone also explain what are the differences between these?

__dl___openat_2
__dl___openat
__openat_2@plt
openat
openat64
__openat_2
__openat
__openat_2@plt
__openat_2@plt
openattr
__openat_2@plt
sun.nio.fs.UnixNativeDispatcher.openatSupported
openat@plt
Java_sun_nio_fs_UnixNativeDispatcher_openat0
__openat_2@plt

UPDATE

Suppose I want to get a function pointer to openat, I can do this inside Android Studio

    int (*getptr)(int, const char*, int, ...);
    getptr = openat;

However, I cannot do it for __openat since this function does not seem to exist.

At least this is one difference between the two that I know.

2
  • 1
    isn't this libc file the source code for it?
    – mimak
    Commented May 16, 2023 at 8:44
  • Hi @mimak Thanks for pointing that out. That leads me to another observation (I added as an update to the post).
    – localacct
    Commented May 16, 2023 at 9:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.