fancycode / MemoryModule

Library to load a DLL from memory.
http://www.joachim-bauch.de/tutorials/loading-a-dll-from-memory/
Mozilla Public License 2.0
2.84k stars 759 forks source link

Creation of Rust bindings #97

Open indygreg opened 4 years ago

indygreg commented 4 years ago

Thank you for this terrific library!

I had a need to use this library from my Rust project PyOxidizer (indygreg/PyOxidizer). I hope you don't mind, but I took the liberty of creating a memory-module-sys crate that exposes the raw C interface to Rust code. The crate is now published at https://crates.io/crates/memory-module-sys. The (very basic) code lives at indygreg/rs-memory-module-sys.

If you want me to transfer ownership of the crate to your name, mark you as an author/maintainer, or want to accept the Rust code into this repository so it can live next to the canonical library, want the docs updated, etc, I would be more than willing to do that.

I very much don't want you to be unhappy about the state of the Rust crate and if there's anything you want to make its existence easier on you, let me know.

Please let me know if there's anything I can do with regards to the Rust crate. Otherwise, feel free to close this issue as unactionable.

Again, thank you for this library!

thomcc commented 1 week ago

I'm surprised it worked well for Rust, given that nearly any non-trivial Rust program will use static TLS (via std::thread_local!), which isn't supported by MemoryModule (it is somewhat supported by MemoryModulePP, but even that lists the compatibility as incomplete).