vm-based binary protection. custom ISA, keccak-encrypted stub, anti-debug, anti-tamper, the works.
- virtualizes marked code regions into a custom bytecode that runs on an internal VM
- encrypts the stub with multi-round keccak (duplex sponge construction, not just hashing)
- monitors for debuggers, hardware breakpoints, timing anomalies, ntdll hooks
- checksums executable sections at runtime with rotating polynomial keys
- control flow flattening + dead code insertion + opaque predicates on the native side
needs cmake 3.20+ and MSVC (VS2022). x64 only for now.
cmake -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config Release
lib goes to build/Release/pickle_protect.lib, demo exe next to it.
#include "pickle/protect.h"
using namespace pickle;
ProtectionConfig cfg{};
cfg.vm_complexity = 7;
cfg.anti_debug = true;
cfg.anti_tamper = true;
auto& eng = ProtectionEngine::instance();
eng.configure(cfg);
eng.protect_module(GetModuleHandleA(nullptr));
eng.start_monitoring();mark code with the macros:
PICKLE_PROTECT_BEGIN
// this code gets integrity-monitored
PICKLE_PROTECT_END
PICKLE_VM_BEGIN
// this code gets virtualized
PICKLE_VM_ENDinclude/pickle/ headers
src/vm/ virtual machine core + handler table + virtualizer
src/antidebug/ debugger/vm/sandbox detection
src/antitamper/ section checksums, hook detection, self-healing
src/obfuscation/ mutator, CFF, opaque predicates, string encryption
src/crypto/ keccak-f[1600], sponge cipher, stub encryption, PRNG
src/engine/ top-level protection engine, packer, marker scanner
demo/ example usage
- the anti-debug will trip if you run from certain IDEs or under a debugger (obviously). disable
cfg.anti_debugduring development - timing threshold is tuned for ~3GHz+ CPUs. if you're getting false positives on slower hardware bump
m_timing_thresholdin detect.cpp - the VM opcodes are randomized per-build via the master key. two builds with different keys produce incompatible bytecode
- keccak implementation is the full 24-round f[1600] permutation, not a reduced variant
do whatever you want with it. no warranty.