#!/bin/sh
# DF-0785 build: harness (deterministic overflow) + image crafter.
# Run on the DragonFly guest (has /usr/bin/cc) or any POSIX host with a C compiler.
set -e
cd "$(dirname "$0")"

echo "[build] crafting NTFS evil image (ir_size=256, va_datalen=896 => 640B overflow)"
python3 craft_img.py ntfs_evil.img 256 896

echo "[build] compiling deterministic harness (buggy)"
cc -O2 -o harness harness.c

echo "[build] compiling deterministic harness (fixed)"
cc -O2 -o harness_fixed harness_fixed.c

echo "[build] DONE"
ls -l ntfs_evil.img harness harness_fixed
