Skip to content

Using Reloaded.Hooks on Linux #27

Open

Description

@NotNite

Hi! I use Reloaded libraries in GDWeave, a mod loader for Godot Engine games. Recently the topic of adding native Linux support has come up (shouldn't be too difficult assuming I can adjust my hooks+sigs), but I'm running into the issue that Reloaded.Hooks only works on Windows.

It looks like the dependency on Reloaded.Memory.Buffers is over 2 years old, and while the latest updates make it work cross-platform, Reloaded.Hooks hasn't been updated for it. Is this the only blocker for Linux support in Reloaded.Hooks, or am I mistaken? If so, how much effort would it be to port it to a newer version?

Thanks!

Activity

  1. Sewer56 commented on Nov 13, 2024

    @Sewer56
    Member

    The other blocker is FASM. Reloaded.Hooks relies on FASM for assembly code generation under the hood.

    FASM itself is written in assembly, 32-bit assembly. While there is a hack on Windows to make it run in 64-bit processes, the same is not possible on Linux. I tried a while back at least. I forked fasmDLL and made the exports work on Linux IIRC, not only Wimdows.

    Namely, on Linux it does not appear possible to relocate the binary in memory, so you'd need to build it with the assumption it lives at a specific memory address and always map it there. I forgot the exact technical details there. You could in theory still run the CLI tool as separate process, but that would be dreadfully slow at runtime.

    I started work on a Rust successor halfway through last year reloaded-hooks-rs. The successor IS multi-platform AND multi-architecture, however it's only around 80% done. All the 'hard' parts are done, just some final bits functionality wise, a C API, C# API and wrapper for old library are missing. I took a hiatus from it however back in March to focus on the Reloaded3 spec, and now I'm on another side project sewer56-archive-nx that's part of R3 long term. This other side subproject, will be done around new year's. After that I could pick up hooks again.

    I wouldn't expect new hooks lib to be available until some time half way through next year however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions