{"id":18357438,"url":"https://github.com/sonicstark/afl-cc-rtfsc","last_synced_at":"2025-08-01T04:33:37.423Z","repository":{"id":210035642,"uuid":"725549656","full_name":"SonicStark/afl-cc-rtfsc","owner":"SonicStark","description":"RTFSC of afl-cc.c in AFLplusplus","archived":false,"fork":false,"pushed_at":"2024-01-31T11:46:47.000Z","size":650,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T05:07:42.603Z","etag":null,"topics":["afl-compiler","afl-gcc","aflplusplus"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SonicStark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-30T11:31:26.000Z","updated_at":"2023-11-30T11:47:41.000Z","dependencies_parsed_at":"2024-01-31T12:53:09.209Z","dependency_job_id":null,"html_url":"https://github.com/SonicStark/afl-cc-rtfsc","commit_stats":null,"previous_names":["sonicstark/afl-cc-rtfsc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SonicStark/afl-cc-rtfsc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonicStark%2Fafl-cc-rtfsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonicStark%2Fafl-cc-rtfsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonicStark%2Fafl-cc-rtfsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonicStark%2Fafl-cc-rtfsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SonicStark","download_url":"https://codeload.github.com/SonicStark/afl-cc-rtfsc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SonicStark%2Fafl-cc-rtfsc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268171053,"owners_count":24207407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["afl-compiler","afl-gcc","aflplusplus"],"created_at":"2024-11-05T22:13:44.021Z","updated_at":"2025-08-01T04:33:37.353Z","avatar_url":"https://github.com/SonicStark.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# afl-cc-rtfsc\n\nRTFSC of `afl-cc.c` in AFLplusplus :)\n\n`afl-cc.c` has become bloated for a long time. I try to decompose it and understand its internal mechanisms during this process. A nice big monitor really helps me a lot.\n\nThe story starts from weird behaviors of `afl-clang-fast` which confused a friend of mine: running `afl-clang-fast` but actually same as `afl-gcc`. Not long after, I embarked on a long journey of exploring `afl-cc.c`...\n\n## release v4.08c\n\nThis is the first try, based on [Version ++4.08c (release)](https://github.com/AFLplusplus/AFLplusplus/releases/tag/v4.08c).\nOriginal source code locates in `release-4.08c-src` and the production locates in `release-4.08c-dat`.\nIt works well and successfully fixed the messes about `afl-clang-fast` and param parsing, but not elegant and compact enough.\n\n## dev-5f492da7\n\nStart to reorganize and forward all modifications to [PR 1912](https://github.com/AFLplusplus/AFLplusplus/pull/1912).\n`dev-5f492da7-src` contains original source code copied as-is upon [head 5f492da](https://github.com/AFLplusplus/AFLplusplus/commit/5f492da71793e75e145e13d4c0dd9506bac2d60c).\nThe disassembled `afl-cc.c` is preserved in `dev-5f492da7-dat`, while the develops of AFL++ prefer to *keep all tools in a single file, with the exception of afl-fuzz*.\n\n## rsp-file-parse\n\nNew implementation for parsing response file (aka rsp-file) in `afl-cc`, harness it, fuzz it, and do some regression tests against `gcc` and `clang`. \n\nRecommanded prerequisites:\n- AFLplusplus\n- clang-16\n- libclang-16-dev\n- libclang-cpp16-dev\n- libiberty-dev\n\nOverview:\n1. `afl.c`：Harness rsp-file parsing in `afl-cc`.\n2. `gcc.c`：Harness rsp-file parsing in `gcc`.\n3. `clang.cc`：Harness rsp-file parsing in `clang`.\n4. `regression.py`：Read some inputs, send each of them to two specified harnesses (named Alpha and Bravo) of rsp-file parsing, compare the two results from Alpha and Bravo, and give report on this.\n5. `build.sh`：Build harnesses mentioned above, as `afl-rsp`, `clg-rsp` and `gcc-rsp`. Also build `afl-rsp-fuzz` for fuzzing. The outputs would be located in `./build`. Please use clang for it!\n6. `corpus`：Some rsp-files as initial seeds for fuzzing. Start fuzzing like:\n   ```bash\n   afl-fuzz -f /tmp/frsp -m none -i ./corpus -o ./fuzzout -- ./build/afl-rsp-fuzz @/tmp/frsp\n   ```\n\nHarmless inconsistence found so far:\n1. `gcc` stop reading file when `\\0` was seen, while `clang` keeps reading until `EOF` was seen and regards `\\0` as a normal char. `afl-cc` follows the latter.\n2. `clang` treats `\\x0c` (aka `\\f`) and `\\x0b` (aka `\\b`) as normal chars, while as spaces in `gcc` which is same as what `isspace(3)` does. `afl-cc` follows the latter.\n3. `afl-cc` always suppresses spaces between two args, while `gcc` sometimes not.\n\n## tools\n\n - `apply-patch.sh`: Help to apply the disassembled `afl-cc.c` to AFL++ repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonicstark%2Fafl-cc-rtfsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonicstark%2Fafl-cc-rtfsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonicstark%2Fafl-cc-rtfsc/lists"}