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

Migration to .NET unified runtime #16

Open
FuzzySecurity opened this issue May 3, 2024 · 3 comments
Open

Migration to .NET unified runtime #16

FuzzySecurity opened this issue May 3, 2024 · 3 comments

Comments

@FuzzySecurity
Copy link

It would be great to build for the unified runtime of .NET:
https://dotnet.microsoft.com/en-us/download/dotnet

This way we can also use it on Linux and MacOS and it would have support for Arm(64) 🙏

@5andr0
Copy link

5andr0 commented Nov 29, 2024

C++/CLI support is windows only dotnet/runtime#4116 (comment)
There are no plans to make this cross platform.
To use frida bindings in .NET core on linux/macos we need interop code generation to access the frida-core runtime library directly via P/Invoke.
https://github.com/mono/CppSharp would be great.
Frida core native api is GObject introspection based, so it would make sense to use https://github.com/gircore/gir.core for wrapper code generation. I tried, but I can only get hold of the frida-core.gir file from my build, but not the dependencies:

<!-- Frida-1.0.gir generated by valac-0.58.exe 0.58.0-frida, do not modify. -->
<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<include name="FridaGDB" version="1.0"/>
<include name="GObject" version="2.0"/>
<include name="Gio" version="2.0"/>
<include name="Gee" version="0.8"/>
<include name="GLib" version="2.0"/>
<include name="FridaFruityInjector" version="1.0"/>
<include name="FridaGum" version="1.0"/>
<include name="FridaLLDB" version="1.0"/>
<include name="FridaFruity" version="1.0"/>
<include name="OpenSSL" version="1.0"/>
<include name="FridaDroidy" version="1.0"/>
<include name="FridaDroidyInjector" version="1.0"/>
<include name="FridaJDWP" version="1.0"/>
<include name="FridaAXML" version="1.0"/>
<include name="FridaBarebone" version="1.0"/>
<include name="Json" version="1.0"/>
<package name="frida-core"/>

Vala has a meson option to generate gir files, but I have no idea how to do that for these dependencies.

@oleavr
Copy link
Member

oleavr commented Nov 29, 2024

C++/CLI support is windows only dotnet/runtime#4116 (comment)

There are no plans to make this cross platform.

To use frida bindings in .NET core on linux/macos we need interop code generation to access the frida-core runtime library directly via P/Invoke.

https://github.com/mono/CppSharp would be great.

Frida core native api is GObject introspection based, so it would make sense to use https://github.com/gircore/gir.core for wrapper code generation. I tried, but I can only get hold of the frida-core.gir file from my build, but not the dependencies:


<!-- Frida-1.0.gir generated by valac-0.58.exe 0.58.0-frida, do not modify. -->

<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">

<include name="FridaGDB" version="1.0"/>

<include name="GObject" version="2.0"/>

<include name="Gio" version="2.0"/>

<include name="Gee" version="0.8"/>

<include name="GLib" version="2.0"/>

<include name="FridaFruityInjector" version="1.0"/>

<include name="FridaGum" version="1.0"/>

<include name="FridaLLDB" version="1.0"/>

<include name="FridaFruity" version="1.0"/>

<include name="OpenSSL" version="1.0"/>

<include name="FridaDroidy" version="1.0"/>

<include name="FridaDroidyInjector" version="1.0"/>

<include name="FridaJDWP" version="1.0"/>

<include name="FridaAXML" version="1.0"/>

<include name="FridaBarebone" version="1.0"/>

<include name="Json" version="1.0"/>

<package name="frida-core"/>

Vala has a meson option to generate gir files, but I have no idea how to do that for these dependencies.

The frida-core build system used to produce a broken gir, but this was recently fixed. Could you try building it from latest git? The .gir can be found in build/src/api.

@5andr0
Copy link

5andr0 commented Nov 29, 2024

Latest git also produces only frida-core.gir with included deps but no gir files for the dependencies. Without the dep files gir.core is not able to resolve all the types used from those deps.

Since I have your attention, did you see my PR in frida/frida-java-bridge#339 to support static java methods?
Also this frida/gumjs-readable-stream#1 fixes building in a local environment

Thank you so much for managing this behemoth of a project 💪 The complexity is insane

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

3 participants