AheadLibEx (Rust) is a Windows DLL proxy generator. It reads a target DLL, parses its export table, and generates a proxy DLL project that forwards exports to the original DLL.
中文文档请见 README.zh-CN.md.
source: proxy sources onlyvs2022: Visual Studio 2022 solution and projectvs2026: Visual Studio 2026 solution and projectcmake:CMakeLists.txtfor MSVC or MinGW-w64 builds
- Export forwarding code based on the input DLL’s export table (names, ordinals, and forwarders)
- Proxy sources
- x86: C proxy source
- x64: C proxy source + jump table (MASM for MSVC-like toolchains, GAS for GNU-like toolchains)
- A
.deffile for controlling exports when the build system uses it - Optional project files (Visual Studio or CMake), depending on the selected output
domain: DLL export parsing and core domain modelapplication: generation orchestration and UI event logicinfrastructure: templates and file generationpresentation: GUI
GUI:
- Launch
aheadlibex-rs.exewith no arguments, then select a DLL and output directory.
CLI:
aheadlibex-rs.exe <source|vs2022|vs2026|cmake> <dll_path> <output_dir> [--origin-mode <system|samedir|custom>] [--origin-name <name.dll>] [--origin-path <path>]
Examples (default system mode):
aheadlibex-rs.exe source "C:\path\to\foo.dll" "C:\path\to\out"
aheadlibex-rs.exe vs2022 "C:\path\to\foo.dll" "C:\path\to\out"
aheadlibex-rs.exe vs2026 "C:\path\to\foo.dll" "C:\path\to\out"
aheadlibex-rs.exe cmake "C:\path\to\foo.dll" "C:\path\to\out"
Generated proxy sources must load the original DLL. This project supports multiple load modes.
system(default): load from%SystemRoot%\System32\<dll>samedir: load from the proxy DLL directory using a renamed filename (default name:<stem>_orig.dll)custom: load from a custom path (absolute, UNC, or relative to the proxy DLL directory)
Examples (custom load modes):
aheadlibex-rs.exe vs2022 "C:\path\to\foo.dll" "C:\path\to\out" --origin-mode samedir --origin-name "foo_orig.dll"
aheadlibex-rs.exe source "C:\path\to\foo.dll" "C:\path\to\out" --origin-mode custom --origin-path "\\server\share\foo.dll"
Option notes:
--origin-nameis used by--origin-mode samedir--origin-pathis used by--origin-mode custom
- Visual Studio outputs: open the generated solution and build.
- CMake output: configure and build with your preferred generator. For example:
cmake -S . -B build
cmake --build build --config Release
The generated filenames are based on the input DLL stem (e.g. version.dll -> version).
source:
- x86:
<stem>_x86.c,<stem>_x86_jump.asm,<stem>_x86_jump.S,<stem>.def - x64:
<stem>_x64.c,<stem>_x64_jump.asm,<stem>_x64_jump.S,<stem>.def
cmake:
CMakeLists.txt- Same files as
sourcefor the detected architecture.
vs2022:
AheadlibEx_<stem>.sln<stem>.vcxproj,<stem>.vcxproj.filters,<stem>.vcxproj.user- x86:
<stem>_x86.c,<stem>_x86_jump.asm,<stem>.def - x64:
<stem>_x64.c,<stem>_x64_jump.asm,<stem>.def
vs2026:
AheadlibEx_<stem>.slnx<stem>.vcxproj,<stem>.vcxproj.filters,<stem>.vcxproj.user- x86:
<stem>_x86.c,<stem>_x86_jump.asm,<stem>.def - x64:
<stem>_x64.c,<stem>_x64_jump.asm,<stem>.def
Notes:
.asmis MASM (MSVC/clang-cl toolchains)..Sis GAS (GNU-like toolchains). Visual Studio outputs only include.asm.
- Export list is generated from the input DLL’s export table.
- xmake project generation has been removed (as of 2026-02-03).
- Author: i1tao
- Repository: https://github.com/i1tao/aheadlibex
- Original idea and C++ implementation: AheadLibEx
- Based on AheadLib-x86-x64 by strivexjun
- Thanks to JetBrains for providing free licenses such as RustRover for my open-source projects.
GPL-3.0-only. See LICENSE.