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

Module.getExportByName must use full path name for custom loaded library #10

Open
huan opened this issue Jul 17, 2021 · 0 comments
Open

Comments

@huan
Copy link
Owner

huan commented Jul 17, 2021

I have the following dynamic library files under Linux:

huan@dev:~/wechaty/sidecar-demos$ ls -l src/libfactorial.so 
-rw-rw-r-- 1 huan huan 15648 Jul 17 15:06 src/libfactorial.so
huan@dev:~/wechaty/sidecar-demos$ LD_PRELOAD=./src/libfactorial.so frida /bin/cat 
     ____
    / _  |   Frida 14.2.18 - A world-class dynamic instrumentation toolkit
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at https://frida.re/docs/home/
Spawned `/bin/cat`. Use %resume to let the main thread start executing! 
[Local::cat]-> Process.enumerateModulesSync().map(x => x.name)
[
    "cat",
    "libfactorial.so",
    ...,
]
[Local::cat]-> Module.getExportByName('libfactorial.so', 'factorial')
Error: libfactorial.so: unable to find export 'factorial'
    at value (frida/runtime/core.js:194)
[Local::cat]-> Module.getExportByName('/home/huan/wechaty/sidecar-demos/src/libfactorial.so', 'factorial')
"0x7fa2494630f9"
[Local::cat]-> Module.getExportByName(null, 'factorial')
"0x7fa2494630f9"
[Local::cat]->

Result

  1. Module.getExportByName('libfactorial.so', 'factorial')

Error: libfactorial.so: unable to find export 'factorial' at value (frida/runtime/core.js:194)

  1. Module.getExportByName('/home/huan/wechaty/sidecar-demos/src/libfactorial.so', 'factorial')

"0x7fa2494630f9"

  1. Module.getExportByName(null, 'factorial')

"0x7fa2494630f9"

I would like to expect all the above three calls will return to the right address.

Does this expected, or it should be treated as a bug?

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

1 participant