Skip to content

Repository files navigation

b2b

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.

Scope

  • 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.

Requirements

  • 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

Build

Configure and build the default release preset:

cmake --preset default
cmake --build --preset default

Run the configured test preset:

ctest --preset default --output-on-failure

Other 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 --help

Use

Start 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.toml

The 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.

Repository layout

  • include/ public C++ and plugin headers
  • src/ engine implementation
  • data/ built-in pattern and skiplist data
  • tests/ unit, regression, fuzz, and corpus verification
  • cmake/ dependency and toolchain configuration

Generated output, local build trees, and internal planning files are intentionally excluded from version control.

Contributing

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.

License

MIT. See LICENSE.

About

bin2bin obfuscator

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages