mirror of
https://github.com/0xTriboulet/rdll-rs
synced 2026-06-06 15:14:27 +00:00
e06e807ab1390a7e08776accbe258a0478169d97
dll-rs
A Rust project that demonstrates Windows DLL functionality and WinAPI interaction.
Overview
dll-rs is a Rust template that can be compiled as both a dynamic-link library (DLL) and a regular executable. It provides an example of how to create Windows DLLs using Rust, including proper exports and Windows API integration.
Features
- Dual compilation modes (DLL and executable)
- Windows API integration through FFI
- Example exported functions
- DLL lifecycle management
Project Structure
src/main.rs- Executable entry pointsrc/lib.rs- Library implementation with DLL exports- Supporting Rust source files
Building
To build the project, use Cargo:
cargo build
Or to build in release:
cargo build --release
Usage
The project can be used in two ways:
-
As a DLL (dll-rs.dll):
- Build in release mode to generate the DLL
- The DLL exports a
DllMainfunction and example functionality
-
As an executable (debug-executable.exe):
- Run in debug mode to test DLL functionality without DLL debugging gymnastics
- Running in release mode will display a warning message
Technical Details
- Uses
cdylibandrlibcrate types - Implements Windows API bindings
- Provides internal FFI declarations for Windows types
- Includes DLL entry point handling
Requirements
- Rust 2024 edition
- Windows operating system
- Cargo build system
Licensing
- MIT or Apache 2.0
Languages
Rust
99%
C
1%