Code Monkey home page Code Monkey logo

Comments (4)

CasualX avatar CasualX commented on August 25, 2024

Right now the answer is: sort of... and you'd have to implement it yourself.

The long answer is that it's tricky due to Rust's strict memory aliasing rules, I'm using shared borrows all over the place to reference parts of the PE file exposed through that specific object's API. However that means you can't at the same time modify that memory (even though it may be disjoint, Rust just sees a &[u8] spanning the whole image.

While I would like an API for setting up the PE for running from memory, due to the above considerations it is not implemented as I don't really know of a clean way to implement it in Rust.

So if you don't mind just hacking it, the proper way would be to copy the necessary information (imports, relocations, TLS) and then act on them after you've released all borrows you used to gather this information and implement it yourself.

from pelite.

im-code avatar im-code commented on August 25, 2024

I realized it. Thank you!

from pelite.

CasualX avatar CasualX commented on August 25, 2024

It turned out I was mistaken and it's fairly trivial to extend the functionality to manually map a DLL, see #12

It lacks support for:

  • Prepare an EXE for the RunPE process creation technique, right now it can only load DLLs
  • Inject a manually mapped DLL in another process, right now it can only load in your own process space.

from pelite.

CasualX avatar CasualX commented on August 25, 2024

I'll close this in favor of just tracking the pull request

from pelite.

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.