Rust reference model of SFC Earthworks4D/Gradework Setup-Factory installer: callout removal + USB-key bypass (REA+Ghidra)
- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| .gitignore | ||
| Cargo.toml | ||
| README.md | ||
sfc-earthworks4d-ref
Rust reference model of the SFC Earthworks4D / Gradework 4D installer
(Gradework4D112.5.6x64.exe), produced by reverse-engineering the installer
engine with REA + Ghidra 12.1.4 (115 license-related functions decompiled).
Purpose: a readable, testable spec for removing Setup-Factory call-outs and bypassing / mimicking the vendor USB key (HASP/Sentinel-type dongle).
What the engine is
- Indigo Rose Setup Factory engine: PE stub + zlib engine blob (~579 KB, offset ~0x3ec00 in the installer) + zlib manifest (file/import tables).
- Licensing runs through two named call-outs,
GetSerialOKandSerialCheck, which the engine dispatches to a loadable serial DLL (Serial.dll/Serial32.dll) that talks to the USB key. - A registration blob (
LicenseRecord: Serial, Company, User, ProgName, Version, InstallDir) is built and verified; machine tags<ComputerName>,<CurrentDomainName>,<UserName>are expanded by the engine (Ghidra:FUN_0049765c,FUN_004a049c). - UI call-outs gated by the same flag:
LicenseDlg,UnregisteredCopyLabel.
Crate layout
| Module | Models |
|---|---|
container |
installer container: PE stub + zlib streams, probe() |
license |
LicenseRecord blob round-trip, SerialVerifier (GetSerialOK + SerialCheck) |
hasp |
the USB key: present/absent, per-slot read, key-side serial check |
callouts |
Setup-Factory call-out dispatcher (engine -> license/hasp) |
bin/ew4d |
CLI: probe <installer.exe>, check <serial>, status |
Features = the bypass strategies
usb-emulate(default) — mimic the USB key:hasp::key_present()is always true, key slots serveEARTHWORKS4D, so the dongle check passes with no hardware. Real engine equivalent: a proxyHasplc/Serial.dllthat answers like the key.no-callouts— remove the call-outs:callouts::dispatch()suppressesGetSerialOK,SerialCheck,LicenseDlgandUnregisteredCopyLabel(defaults to OK). Real-engine equivalent: patch the script so the license gate and dialogs are never invoked.
cargo test # 7 tests
cargo run -q -- status # licensed: true (emulated key)
cargo run -q -- check SFC123456
cargo run -q -- probe Gradework4D112.5.6x64.exe
cargo build --no-default-features --features no-callouts
RE artifacts (not in this repo)
work/ghidra_decompile2.txt— 115 decompiled license functionswork/rea_engine.md— REA analysis ofEngine_unpacked.exework/manifest_dec.bin— decompressed installer manifest (call-out + import tables)