#macro #dll #intended #winapi #windows-dll #proxying #return #magic #prehook #posthook

macro dllproxymacros

Set of macros intended to ease DLL proxying through the LoadLibrary Windows API

3 releases

Uses new Rust 2024

0.1.2 May 29, 2025
0.1.1 May 29, 2025
0.1.0 Apr 20, 2025

#552 in Procedural macros

Download history 147/week @ 2025-04-20 9/week @ 2025-04-27 8/week @ 2025-05-04 19/week @ 2025-05-11 4/week @ 2025-05-18 215/week @ 2025-05-25 44/week @ 2025-06-01

282 downloads per month

MIT/Apache

16KB
320 lines

dllproxymacros

A series of macros to be used in a seperate project to easily generate Rust proxy DLLs in more modern versions of the language.

Quick Guide

Not intended to be used on their own but they can, decorate the name of the function that must be exported, the same as the DLLs exported function name with the following:

#[hooktype("dllnameliteral", "functionnameliteral")]

Where hooktype is either prehook, posthook, or fullhook.

Whne post hooking, the return value can be modified with the magic ret variable.

In a full hook, arguments must be passed and the original function call must be made with the magic func function. If the function returns, it must also return.

For all cases, the function you write must have the same signature as that of the DLL function you are trying to proxy. A prehook without this limitation is coming soon for the main crate.

Dependencies

~0.2–0.9MB
~17K SLoC