b2b is a Windows x64 PE transformation engine. It reads a PE image together with its matching PDB, applies a configured transformation pipeline, verifies the rewritten image, and emits a new PE plus reproducibility metadata.
The project is experimental. Unsupported instruction forms, ABI shapes, memory regions, and exception paths are rejected instead of being guessed. Production behavior must remain generic and must not depend on a particular compiler build, symbol name, RVA, or fixture layout.
- Windows x64 PE/DLL/EXE/SYS inputs
- PDB-guided function and data discovery
- Transactional transformation passes
- PE reference, relocation, CFG, and unwind handling
- Deterministic output for a fixed configuration and seed
- C++ pass and plugin interfaces
- Unit, regression, fuzz, and corpus-oriented verification
The current implementation is not a promise of complete x86-64 instruction coverage or transparent handling of every native ABI. Check the source contracts and tests before using a pass on production binaries.
- Windows x64
- Visual Studio 2022 with the MSVC toolchain, or clang-cl for the sanitizer presets
- CMake 3.25 or newer
- Git and network access for pinned CMake dependencies on a clean checkout
Configure and build the default release preset:
cmake --preset default
cmake --build --preset defaultRun the configured test preset:
ctest --preset default --output-on-failureOther presets are available in CMakePresets.json: release-msvc, asan-debug, ubsan-debug, and coverage.
To inspect the command-line interface:
build/default/bin/b2b.exe --helpStart with cfg.toml, set the input PE, matching PDB, output path, seed, selectors, and pipeline instances, then run:
build/default/bin/b2b.exe --config path\to\config.tomlThe input PE and PDB must come from the same build. A missing, stale, or incompatible PDB is rejected because function boundaries, symbols, and ABI facts cannot be recovered safely from guesses.
Fixed seeds make a run reproducible. The emitted sidecar and reproducibility records capture the resolved seed and transformation decisions; treat them as part of the build artifact.
include/public C++ and plugin headerssrc/engine implementationdata/built-in pattern and skiplist datatests/unit, regression, fuzz, and corpus verificationcmake/dependency and toolchain configuration
Generated output, local build trees, and internal planning files are intentionally excluded from version control.
Changes should preserve fail-closed behavior, deterministic reproduction, and generic contracts. Add a focused test for each supported shape and a negative test for each refusal boundary. Do not add production exceptions for one binary, compiler build, export name, RVA, or corpus fixture.
Before opening a pull request, run the default build and test preset. If a change needs a Windows-only tool, PDB, WDK, or external corpus, state that requirement and keep the default build reproducible without it.
MIT. See LICENSE.