Skip to content

Basic implementation of the Windows loader in Rust

Notifications You must be signed in to change notification settings

d0ntrash/load_library_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

load_library_rs

About

Basic implementation of the Windows loader in Rust. This implementation is still a work in progress and some parts like relocation and execution of TLS callbacks are still missing. However, it can already be used to load DLLs and call the entry point.

Example

To load a dll, simply run load_library_rs and specify the path to the dll you want to load. Don’t forget the terminating null-byte. The entry point will then be called automatically.

use load_library_rs::load_library;

fn main() {
    load_library("C:\\Users\\user\\Desktop\\testdll.dll\0");
}

To test this, you can use a simple test dll like this one: testdll from memN0ps.

Todos

  • Relocation
  • Use load_library_rs recursively for imports
  • Link module to PEB
  • Fix TLS Callbacks
  • Do some sanity checks

Credits

The code is mainly based on the DarkLoadLibrary C implementation.

About

Basic implementation of the Windows loader in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages