Skip to content

Commit 6eced71

Browse files
authored
Merge pull request #9 from swiftly-solution/dev
Small Change
2 parents 423b140 + 34abbb1 commit 6eced71

30 files changed

+1101607
-78
lines changed

Cargo.lock

Lines changed: 214 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,12 @@
1-
[package]
2-
name = "s2binlib"
3-
version = "0.1.0"
4-
edition = "2024"
1+
[workspace]
2+
members = [
3+
"s2binlib",
4+
"s2binlib_binding",
5+
]
56

6-
[lib]
7-
crate-type = ["staticlib", "dylib"]
8-
9-
[features]
10-
default = []
11-
debug_c_bindings = []
7+
resolver = "2"
128

139
[profile.release]
14-
opt-level = 3
10+
opt-level = "z"
1511
lto = true
16-
17-
18-
[dependencies]
19-
anyhow = "1.0.100"
20-
object = "0.37.3"
21-
once_cell = "1.20"
22-
iced-x86 = "1.21"
23-
region = "3.0"
24-
25-
[target.'cfg(target_os = "windows")'.dependencies]
26-
windows = { version = "0.62.2", features = ["Win32_System_Memory"] }
27-
28-
[target.'cfg(target_os = "linux")'.dependencies]
29-
libc = "0.2.176"
12+
codegen-units = 1

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,31 @@ This library mainly read data from original binary file instead of from memory,
1818
- Find all CEmbeddedNetworkVar NetworkStateChanged function index
1919
- Follow xref safely
2020

21+
## Project Layout
22+
23+
- `s2binlib`: core Rust library crate exposing safe APIs.
24+
- `s2binlib_binding`: C ABI wrapper crate that links to `s2binlib` and produces the `s2binlib` DLL/LIB artifacts.
25+
2126
## Compiling
2227

2328
Prerequisites:
2429
- Rust development environment
2530

26-
Run the following command to compile.
31+
To build the C bindings (emitting `s2binlib.dll`, `libs2binlib.a`, etc.):
32+
```
33+
cargo build -p s2binlib_binding --release
34+
```
35+
36+
To build only the Rust core crate:
2737
```
28-
cargo build --release
38+
cargo build -p s2binlib --release
2939
```
3040

3141
### Debug Mode for C Bindings
3242

33-
To enable debug output for all C binding errors, compile with the `debug_c_bindings` feature:
43+
To enable debug output for all C binding errors, compile the binding crate with the `debug_c_bindings` feature:
3444
```
35-
cargo build --release --features debug_c_bindings
45+
cargo build -p s2binlib_binding --release --features debug_c_bindings
3646
```
3747

3848
When enabled, all error returns in C bindings will print detailed debug information to stdout, including:

0 commit comments

Comments
 (0)