GithubHelp home page GithubHelp logo

Frida-core bindings about frida-rust HOT 5 CLOSED

0xchase avatar 0xchase commented on September 23, 2024
Frida-core bindings

from frida-rust.

Comments (5)

meme avatar meme commented on September 23, 2024 2

Ah, you're just not linking libresolv, you can do so like this in the build.rs:

println!("cargo:rustc-link-lib=resolv");

I encourage you to contribute to this bindings monorepo as the goal is to eventually upstream them into the Frida organization.

from frida-rust.

meme avatar meme commented on September 23, 2024 1

I do plan on writing frida-core bindings, if you're interested in working on them now I'm happy to get you started. I will add a frida-core-sys package to this repo.

from frida-rust.

meme avatar meme commented on September 23, 2024 1

Ok, this should get you started: 6db9961.

I've added frida-core, frida-core-sys and an example for you (that you can use for development).

If you need any help, let me know 😄

from frida-rust.

0xchase avatar 0xchase commented on September 23, 2024

For reference, these are the kinds of errors I'm getting

  = note: /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o): in function `do_lookup_records':
          /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:984: undefined reference to `__res_nquery'
          /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o): in function `g_resolver_records_from_res_query':
          /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:702: undefined reference to `__dn_expand'
          /usr/bin/ld: /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:713: undefined reference to `__dn_expand'
          /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o): in function `parse_res_soa':
          /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:561: undefined reference to `__dn_expand'
          /usr/bin/ld: /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:562: undefined reference to `__dn_expand'
          /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o): in function `parse_res_srv':
          /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:543: undefined reference to `__dn_expand'
          /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o):/worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:602: more undefined references to `__dn_expand' follow
          collect2: error: ld returned 1 exit status

from frida-rust.

0xchase avatar 0xchase commented on September 23, 2024

Hey,

Thanks quick response. I had created a skeleton like the one you pushed before I started encountering these errors, but perhaps this is still something you can help with. The errors don't start occurring until after adding some calls to the sys crate. For example, if in your code, I add the following test function to the Frida struct

impl Frida {
    /// Obtain a Frida handle, ensuring that the runtime is properly initialized. This may
    /// be called as many times as needed, and results in a no-op if the Frida runtime is
    /// already initialized.
    pub fn obtain() -> Frida {
        unsafe { sys::frida_init() };
        Frida {
        }
    }

    pub fn test() {
        unsafe {
            let _main_loop = sys::_frida_g_main_loop_new(std::ptr::null_mut(), 1);
            let _manager = sys::frida_device_manager_new();
        }
    }
}

Then include the crate in another and build it, I get the same error as above

  = note: /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o): in function `do_lookup_records':
          /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:984: undefined reference to `__res_nquery'
          /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o): in function `g_resolver_records_from_res_query':
          /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:702: undefined reference to `__dn_expand'
          /usr/bin/ld: /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:713: undefined reference to `__dn_expand'
          /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o): in function `parse_res_soa':
          /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:561: undefined reference to `__dn_expand'
          /usr/bin/ld: /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:562: undefined reference to `__dn_expand'
          /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o): in function `parse_res_srv':
          /worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:543: undefined reference to `__dn_expand'
          /usr/bin/ld: /home/oem/github/frida-rust/frida-gum-sys/libfrida-core.a(gthreadedresolver.c.o):/worker/frida-manylinux-x86_64/build/build/fs-tmp-linux-x86_64/glib/../../../deps/glib/gio/gthreadedresolver.c:602: more undefined references to `__dn_expand' follow
          collect2: error: ld returned 1 exit status

from frida-rust.

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.