This repository is now a minimal Docker-based reproduction package for:
- building
openssl-3.4.4with the SOK imagebin2415/x86_gt:0.1 - extracting
libcrypto.so.3groundtruth withbin2415/py_gt - analyzing
.textinstruction addresses that appear inobjdumpbut not ingtBlock.pb
.
|-- ccr
|-- extract_gt
|-- protobuf_def
|-- groundtruth-gap-analysis-skill
|-- requirements.txt
`-- README.md
The retained directories are the minimum needed by the current workflow:
extract_gt/Groundtruth extraction entrypoint used by the Docker reproduction scripts.ccr/Python modules imported byextract_gt/extractBB.py.protobuf_def/Generated protobuf definitions used by both extraction and gap analysis.groundtruth-gap-analysis-skill/The Docker reproduction scripts, reusable skill, and the validatedlibcrypto.so.3analysis artifacts.
Run from the repository root:
DOCKER_USE_SUDO=1 bash groundtruth-gap-analysis-skill/docker/build_libcrypto_groundtruth.sh
DOCKER_USE_SUDO=1 bash groundtruth-gap-analysis-skill/docker/analyze_libcrypto_gap.shIf your user can access Docker directly, omit DOCKER_USE_SUDO=1.
Artifacts are written to:
/tmp/groundtruth-gap-analysis/
Important outputs:
/tmp/groundtruth-gap-analysis/openssl-3.4.4/libcrypto.so.3/tmp/groundtruth-gap-analysis/libcrypto.gtBlock.pb/tmp/groundtruth-gap-analysis/libcrypto-gap.summary.txt/tmp/groundtruth-gap-analysis/libcrypto-gap.summary.json
test -f /tmp/groundtruth-gap-analysis/libcrypto.gtBlock.pb
test -f /tmp/groundtruth-gap-analysis/libcrypto-gap.summary.txt
sed -n '1,40p' /tmp/groundtruth-gap-analysis/libcrypto-gap.summary.txtExpected key values for the validated sample:
unseen_instruction_count = 36614unseen_ratio_over_groundtruth = 0.054590481927instruction_category_counts.outside_gt_coverage = 35261instruction_category_counts.padding = 1353
The corrected gap-analysis rule is:
- Disassemble
.textwithobjdump -d -j .text. - Count only lines that have a real mnemonic.
- Ignore
objdumpcontinuation lines for long instructions. - Compare real instruction start addresses against
bb.instructions[*].vafromgtBlock.pb. - Merge unseen instruction addresses into contiguous ranges.
- Classify unseen ranges as:
paddingoutside_gt_coverage
Example of a false instruction address that must be ignored:
cf00a: 48 83 3d ee fe 46 00 cmpq ...
cf011: 00
d00c1: c7 84 24 40 01 00 00 movl ...
d00c8: 00 00 00 00cf011 and d00c8 are continuation bytes from the previous instruction, not new instruction starts.
See:
groundtruth-gap-analysis-skill/README.mdgroundtruth-gap-analysis-skill/skill/SKILL.md