WIP VMProtect SDK for rust
protected
attributeYou need to add this script to vmprotect project for this attribute
Syntax:
```rust
fn some_fn() { ... } ```
Example:
```rust
fn stringify
protected!
macro for codeSyntax:
```rust use vmprotect::protected;
protected!(TYPE[, lock] "NAME"; { /CODE/ }) ```
Protected code block is works like any other rust block, i.e:
```rust use vmprotect::protected;
// Before protection let a = {2+3}; // After protection let a = protected!(virtualize "Addiction"; { 2 + 3 }); ```
Example:
rust
fn main() {
println!("{} + {} = {}", a, b, protected!(ultra "Adding"; {
a + b
}));
}
protected!
macro for textsSyntax:
```rust use vmprotect::protected;
protected!(TYPE "TEXT") ```
This macro returns string, which can be transformed to normal one. This string is freed when dropped, implementations is located at vmprotect::strings::{encrypted_a::EncryptedStringA, encrypted_w::EncryptedStringW}
```rust use vmprotect::protected;
// Before protection let a = "Hello, world!"; // After protection let a = protected!(cstr "Hello, world!"); // Also for wide-strings: let a = protected!(cwstr "Привет, мир!"); ```
Example:
```rust use vmprotect::protected;
fn main() { println!("Hello, {:?}!", protected!(A; "%Username%").into() as String); } ```
TODO Section, see docs for now
Example:
rust
println!("Your hwid is \"{}\"", vmprotect::licensing::get_hwid().to_str().unwrap());
Can be fixed by adding -C link-arg=-Wl,-headerpad,0x500
to rustc args
For cargo:
rs
export RUSTFLAGS="-C link-arg=-Wl,-headerpad,0x500"
(Based on http://vmpsoft.com/forum/viewtopic.php?f=2&t=6837&start=15#p10527)