Skip to content
/ Lunar Public
forked from Dewera/Lunar

A lightweight native DLL mapping library that supports mapping directly from memory

License

Notifications You must be signed in to change notification settings

zanzo420/Lunar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lunar

A lightweight native DLL mapping library that supports mapping directly from memory


Features

  • WOW64 and x64 support
  • Imports and delay imports are resolved
  • Relocations are performed
  • Sections are mapped with the correct memory protection
  • Headers are mapped with the correct memory protection
  • Exception handling is setup for both SEH and C++ exceptions
  • Security cookie is initialised
  • Entry point and TLS callbacks are called with ProcessAttach and ProcessDetach

Installation


Getting started

The example below demonstrates a basic implementation of the library

var libraryMapper = new LibraryMapper(process, dllBytes);

// Map the DLL into the process

libraryMapper.MapLibrary();

// Unmap the DLL from the process

libraryMapper.UnmapLibrary();

Constructors

LibraryMapper(Process, Memory<byte>)

Provides the functionality to map a DLL from memory into a remote process

LibraryMapper(Process, string)

Provides the functionality to map a DLL from disk into a remote process


Properties

DllBaseAddress

The base address of the DLL in the remote process after it has been mapped


Methods

MapLibrary()

Maps the DLL into the remote process

UnmapLibrary()

Unmaps the DLL from the remote process


Caveats

  • Attempting to inject into a system level process will require your program to be run in administrator mode
  • Mapping requires the presence of a PDB for ntdll.dll, and, so, the library will automatically download the latest version of this PDB from the Microsoft symbol server and cache it in %temp%/Lunar/PDB

Contributing

Pull requests are welcome

For large changes, please open an issue first to discuss what you would like to add

About

A lightweight native DLL mapping library that supports mapping directly from memory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%