l00sy4 / ClementineLdr

Reflective loader written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clementine

Clementine is a fresh take on reflective loading

Description

The loader attempts to reserve memory for the PE at it's preferred address, in order to avoid performing relocation. Afterwards it will allocate each section and proceed with relocation if needed. The DOS and NT headers are left out, as having them in private memory doesn't make sense. Finally it resolves imports and finishes by calling the user-defined function

The injector is planned to be simple, as it's purpose will be to show off the loader itself

The helper component contains the code I used to calculate the function names' hashes

Features

  • API hashing without walking the PEB. Since the injector will be backed by a file, it can safely call LoadLibrary and pass the address to the loader

  • !WILL BE CHANGED! As call stacks from LoadLibrary, NtAllocateVirtualMemory and NtProtectVirtualMemory leading to unbacked RX memory can lead to detections, Clementine uses TpAllocWork to execute callbacks, as per the second reference

  • Sets up exception handlers and executes TLS callbacks, if they exist

In Progress
  • Sleep mask

  • Inject PE in chunks and clean up after allocation

  • Hooks

  • x86 support

Usage

Gonna fill this in when the project is done

Credits

About

Reflective loader written in Rust

License:GNU General Public License v3.0


Languages

Language:Rust 100.0%