Code Monkey home page Code Monkey logo

Comments (6)

kubo avatar kubo commented on August 18, 2024

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.

guy-adshir avatar guy-adshir commented on August 18, 2024

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.

kubo avatar kubo commented on August 18, 2024

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.

guy-adshir avatar guy-adshir commented on August 18, 2024

Thanks. I did not use the fourth parameter.
Are my assumptions above correct?

Thank you so much for your help

from plthook.

kubo avatar kubo commented on August 18, 2024

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.

guy-adshir avatar guy-adshir commented on August 18, 2024

I'll try debugging it further, thanks :)

from plthook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.