frida-cycript icon indicating copy to clipboard operation
frida-cycript copied to clipboard

Implement RTLD_NEXT

Open duraki opened this issue 3 years ago • 1 comments

RTLD_NEXT is bugged on MacOS 10.15.7//xnu.

cy# RTLD_NEXT
failed to parse cached code for RTLD_NEXT: syntax error, unexpected )
throw new ReferenceError("'RTLD_NEXT' is not defined")

While expected:

Specifies the next object after this one that defines name. This one refers to the object containing the invocation of dlsym(). The next object is the one found upon the application of a load order symbol resolution algorithm (see dlopen()). The next object is either one of global scope (because it was introduced as part of the original process image or because it was added with a dlopen() operation including the RTLD_GLOBAL flag), or is an object that was included in the same dlopen() operation that loaded this one. [1]

[1] https://pubs.opengroup.org/onlinepubs/009695399/functions/dlsym.html#tag_03_112_07

So; examine the pointer to RTLD via invoking dlopen on exacta. If next object is visible, report back to user. This way, the dlsym hierarchy would be present.

duraki avatar Mar 16 '21 08:03 duraki

I think it should just return the value, like it does for example with RTLD_GLOBAL.

$ ./build/src/cycript
cy# RTLD_GLOBAL
8
cy#

NSEcho avatar Mar 16 '21 09:03 NSEcho