Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ version = "0.1.0"
edition = "2024"

[lib]
crate-type = ["staticlib"]
crate-type = ["staticlib", "dylib"]

[features]
default = []
debug_c_bindings = []

[profile.release]
opt-level = 3
lto = true


[dependencies]
anyhow = "1.0.100"
object = "0.37.3"
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ This library mainly read data from original binary file instead of from memory,
- Find symbol
- Get module base address
- Install trampoline to vtable with enough bytes padded with NOP (for safetyhook to hook empty virtual function)
- Find all CEmbeddedNetworkVar NetworkStateChanged function index
- Follow xref safely

## Compiling

Expand All @@ -26,6 +28,20 @@ Run the following command to compile.
cargo build --release
```

### Debug Mode for C Bindings

To enable debug output for all C binding errors, compile with the `debug_c_bindings` feature:
```
cargo build --release --features debug_c_bindings
```

When enabled, all error returns in C bindings will print detailed debug information to stdout, including:
- Error code
- Error message
- File name and line number where the error occurred

This is useful for debugging integration issues with the C API.

## Linking and building

On windows, if you are seeing linking error like `"__imp_NtReadFile"`, you also need to link `kernel32.dll` and `ntdll.dll`.
Expand Down
Loading