Skip to content

Commit 423b140

Browse files
authored
Merge pull request #8 from swiftly-solution/dev
2 parents 0ac5f39 + 56f55c9 commit 423b140

File tree

7 files changed

+996
-674
lines changed

7 files changed

+996
-674
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
[target.x86_64-pc-windows-msvc]
3+
rustflags = ["-C", "target-feature=+crt-static"]

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ version = "0.1.0"
44
edition = "2024"
55

66
[lib]
7-
crate-type = ["staticlib"]
7+
crate-type = ["staticlib", "dylib"]
8+
9+
[features]
10+
default = []
11+
debug_c_bindings = []
812

913
[profile.release]
1014
opt-level = 3
1115
lto = true
1216

17+
1318
[dependencies]
1419
anyhow = "1.0.100"
1520
object = "0.37.3"

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ This library mainly read data from original binary file instead of from memory,
1515
- Find symbol
1616
- Get module base address
1717
- Install trampoline to vtable with enough bytes padded with NOP (for safetyhook to hook empty virtual function)
18+
- Find all CEmbeddedNetworkVar NetworkStateChanged function index
19+
- Follow xref safely
1820

1921
## Compiling
2022

@@ -26,6 +28,20 @@ Run the following command to compile.
2628
cargo build --release
2729
```
2830

31+
### Debug Mode for C Bindings
32+
33+
To enable debug output for all C binding errors, compile with the `debug_c_bindings` feature:
34+
```
35+
cargo build --release --features debug_c_bindings
36+
```
37+
38+
When enabled, all error returns in C bindings will print detailed debug information to stdout, including:
39+
- Error code
40+
- Error message
41+
- File name and line number where the error occurred
42+
43+
This is useful for debugging integration issues with the C API.
44+
2945
## Linking and building
3046

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

0 commit comments

Comments
 (0)