Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/racoten/reflectivepluginloader
Defensive ToolsPersistence MechanismsReverse EngineeringShellcodePost-ExploitationMalware AnalysisLearning & EducationRed TeamingPayload DevelopmentBinary Exploitation
GitHubracoten/reflectivepluginloader
4361211 days agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →

ReflectivePluginLoader

A minimal PE mapper that loads DLLs straight from memory and calls into a clean plugin interface, no LoadLibrary needed.

View Repository
Share

ReflectivePluginLoader

License: MIT

A minimal reflective PE mapper with a hot-swappable plugin interface for Windows x64. Maps a DLL straight from a byte buffer in memory, resolves its exports, and calls into a clean IPlugin ABI without touching LoadLibrary. Companion code for the blog post on reflective loaders and modular plugin architectures.

Blog Post

See the full writeup: Using Reflective Loaders to Replace LoadLibrary for Hot-Swappable Modules in C++

Quick Start

root@kitploit:~
# Configure
cmake -B build

# Build
cmake --build build --config Release

# The build produces:
#   build/Release/cmdplugin.dll   (example plugin)
#   build/Release/harness.exe     (test harness)

Usage

root@kitploit:~
# Map cmdplugin.dll from disk, run "dir C:\"
harness.exe cmdplugin.dll "dir C:\"

# Default: loads cmdplugin.dll, runs "whoami"
harness.exe

The harness reads the DLL into a byte buffer, maps it with the reflective loader, resolves the plugin exports, and dispatches the command through the IPlugin interface.

Project Structure

root@kitploit:~
ReflectivePluginLoader/
├── CMakeLists.txt              # Root build
├── Include/
│   ├── IPlugin.h               # Plugin ABI (TaskApi, IPlugin, helpers)
│   └── ReflectiveLoaderEngine.h # PE mapper + export resolver
├── Modules/
│   └── CmdPlugin/
│       ├── cmdplugin.cpp        # Example: command execution plugin
│       └── CMakeLists.txt
├── Testing/
│   ├── main.cpp                 # Test harness (loads DLL from file)
│   └── CMakeLists.txt
└── Tools/
    └── file2hex.py              # Convert a DLL to a C byte array

Writing Your Own Module

  1. Create a new directory under Modules/.
  2. Include IPlugin.h and implement the IPlugin interface:
root@kitploit:~
#include "IPlugin.h"

class MyPlugin : public IPlugin {
public:
    void init() const override { /* setup */ }
    void execute(TaskApi* task) const override { /* do work */ }
    void cleanup() const override { /* teardown */ }
};
  1. Implement the five exported functions (create_plugin, destroy_plugin, plugin_init, plugin_exec, plugin_cleanup) using HeapAlloc/placement new for CRT-safe cross-module allocation.

  2. Add a CMakeLists.txt and register it in the root CMakeLists.txt with add_subdirectory().

The host doesn't need to know what your module does internally. It maps, resolves, calls init -> execute -> cleanup, and moves on.

Known Limitations

The mapper handles the basics and deliberately stops there:

  • Supported: Base relocations, import resolution, per-section memory protections
  • Not supported: TLS callbacks, delay-load imports, forwarded exports, CFG metadata, SEH table registration

If a module needs any of those, either extend the mapper or reject the module early with a clear error. Silent half-support is the worst failure mode.

References

  • stephenfewer/ReflectiveDLLInjection - The original reflective loader
  • ired.team - Reflective DLL Injection - Walkthrough and PoC
  • fancycode/MemoryModule - Full-featured "load DLL from memory" library
  • PE Format (Microsoft) - PE/COFF specification

License

MIT

Download Tool