针对特定领域的基础设施,用于分析、生成和操作语法上正确但语义上不符合规范的视频文件。
H26Forge is domain-specific infrastructure for analyzing, generating, and manipulating syntactically correct but semantically spec-non-compliant H.264 video files.
H26Forge has three key features:
This tool and its findings are described in the H26Forge paper.
See MOTIVATION.md to see how a H26Forge simplifies a previously manual PoC generation process.
You can downloaded the latest build on the releases page.
An up-to-date version of Rust is required to build H26Forge. Be sure to call rustup update.
Python 3 is required for editing videos.
Linux/Mac
./make.shWindows
./make.batThese scripts just call cargo build --release and copy the binary to the top level directory.
To generate a video with the default configuration, run:
./h26forge generate -o out.264To use a custom randomness range, modify (or copy and create a new file) the syntax element range in config/default.json and run:
./h26forge generate -o out.264 -c config/default.jsonA simple script is included to generate a batch of 100 videos to a temporary folder. You can run it via:
./scripts/gen_100_videos.shThe videos will be output to tmp/.
Another script is included to generate 100 videos using config/chrome.json.
./scripts/gen_100_chrome_videos.shYou can open the videos in a browser by opening tmp//play_videos.html.
See GETTINGSTARTED.md for more usage details.
See Example: CVE-2022-22675 PoC to see the capabilities of editing syntax elements.
Contributions are welcome! Running cargo doc will produce the code documentation, available at target/doc/h26forge/index.html.
Some unit tests are available. You can run cargo test to see their output.
The H.264 (08/2021) Spec is 844 pages long, containing instructions for parsing the bitstream into syntax elements and reproducing video frames.
We can use the ITU test vectors to identify spec conformance for a particular profile. The ITU Test Vectors are available here.
To run the test vectors, you can run ./scripts/download_and_run_avcv1_test_vectors.sh. Alternatively, you can run
python scripts/end-to-end-tester.py --testdir where `` points to any folder with .264 files.
FM1_BT_B.264 and FM1_FT_E.264 fail. The two failing videos use FMO, and have issues with CAVLC CoeffToken recovery, seemingly with getting the correct nC value based on neighbor values.WB_10bit_QP21_1920x1088 and WB_10bit_QP21_I-Only_1920x1088 are too big to test.W.R. Vasquez, S. Checkoway, and H. Shacham. “The Most Dangerous Codec in the World: Finding and Exploiting Vulnerabilities in H.264 Decoders.” In J. Calandrino and C. Troncoso, eds., Proceedings of USENIX Security 2023. USENIX, Aug. 2023.
The following bugs have been found with H26Forge's video generator. If you use H26Forge to find and report an issue, please let us know so we can include it in this list.
暂无开放 Issues,或尚未同步最近议题。