#compiler #obfuscation #security #macro

macro aegis_vm_macro

Proc-macro for VM-protected functions - RustAegis

11 releases

0.2.51 Dec 16, 2025
0.2.5 Dec 16, 2025
0.1.52 Dec 1, 2025
0.1.4 Nov 29, 2025

#1922 in Procedural macros


Used in aegis_vm

MIT license

385KB
7K SLoC

RustAegis Macros

Proc-macro crate for RustAegis - a code virtualization and obfuscation framework.

Usage

This crate is re-exported by aegis_vm. You should use aegis_vm directly:

[dependencies]
aegis_vm = "0.2.2"
use aegis_vm::vm_protect;

#[vm_protect]
fn secret_function(x: u64) -> u64 {
    x + 42
}

// NEW in v0.2.2: Native function calls work automatically!
fn external_check() -> bool { true }

#[vm_protect]
fn protected_with_calls() -> bool {
    let result: bool = external_check();  // Auto-wrapped
    result
}

Features

  • VM Bytecode Compilation: Converts Rust AST to custom VM bytecode
  • Native Function Calls: External functions automatically wrapped and callable from VM
  • String Obfuscation: aegis_str! macro for compile-time string encryption
  • White-Box Cryptography: AES key derivation without exposing keys
  • Protection Levels: debug, standard, paranoid

Important Notes

  • Use explicit bool type annotations: let x: bool = func();
  • Rust macros (println!, etc.) not supported - use wrapper functions
  • Supported types: u64, u32, i64, i32, u16, u8, bool, char

License

MIT

Dependencies

~1.4–2MB
~42K SLoC