Comments (6)
Does the library libunity.so
export some symbols? If so, could you use plthook_open_by_address()
?
#include <dlfcn.h>
#include <plthook.h>
plthook_t *plthook;
// The following code is same with what plthook_open does on Android except symbol names.
void *handle = dlopen("libunity.so", RTLD_LAZY | RTLD_NOLOAD);
if (handle == NULL) {
... error ...
}
void *addr = dlsym(handle, "any_symbol_name_exported_by_libunity_so");
if (addr != NULL) {
... error ...
}
int rv = plthook_open_by_address(&plthook, addr);
if (rv != 0) {
... error ...
}
from plthook.
Thank you.
'plthook_open_by_address' succeeds, but then 'plthook_replace' fails, with the error:
"no such function: glBindBuffer"
So just to be sure I'm on the right page here: I should be calling dlopen/dlsym/plthook_replace on the library where the CALL I want to hook is located, not the library that holds the implememntation of the function (in my case, glBindBuffer).
Also, do I need to wait until the PLT entry for glBindBuffer for libunity.so is resolved?
Thanks again.
from plthook.
Also, do I need to wait until the PLT entry for glBindBuffer for libunity.so is resolved?
It depends on whether you use the fourth argument of plthook_replace
.
I recommend that you don't. See Usage.
from plthook.
Thanks. I did not use the fourth parameter.
Are my assumptions above correct?
Thank you so much for your help
from plthook.
Are my assumptions above correct?
No. If your code don't use the parameter, it doesn't depend on whether the PLT entry is resolved or not.
from plthook.
I'll try debugging it further, thanks :)
from plthook.
Related Issues (20)
- fp leak HOT 1
- Possible buffer overflow HOT 1
- I try to hook "glDrawElements", but it doesn't work. HOT 2
- [Android] Hook dlopen HOT 1
- Failed to find symbol when using C# runtime. HOT 2
- plthook_elf.c: plthook_open() fails on executables with local hint symbols (__INIT_ARRAY, _end) HOT 1
- How to hook a member function of some class in C++ ? HOT 2
- plthook_replace error: no such function: malloc HOT 2
- A minor typo issue.
- A fatal error about the handle is invalid HOT 6
- ssize_t rv was not decleared HOT 1
- undefined reference to `plthook_open` HOT 1
- Why mprotect not needed for osx? HOT 2
- Hook function inside shared library opened via `dlopen()` with `RTLD_DEEPBIND`? HOT 2
- hook function from vtable
- Library doesn't support the new LC_DYLD_CHAINED_FIXUPS and LC_DYLD_EXPORTS_TRIE macos linker commands HOT 5
- Could not find memory region containing address HOT 1
- Can I hook the function called by a referenced library? HOT 6
- Not found function "recv" and any functions from Socket API in libc HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plthook.