Skip to content

[WIP] Binary recompilation patching#206

Draft
zoogies wants to merge 23 commits into
mainfrom
feat/binary-patching
Draft

[WIP] Binary recompilation patching#206
zoogies wants to merge 23 commits into
mainfrom
feat/binary-patching

Conversation

@zoogies
Copy link
Copy Markdown
Collaborator

@zoogies zoogies commented May 20, 2026

Uses llvm-mctoll to decompile binaries, and adds a patch output mode in CVEAssert to produce patch files that can be combined with the decompilation output to produce remediated il. Still largely WIP

@zoogies zoogies self-assigned this May 20, 2026
@zoogies zoogies requested a review from rjsmith1999 May 20, 2026 16:08
@zoogies zoogies added enhancement New feature or request CVEAssert Related to CVEAssert component labels May 20, 2026
@zoogies zoogies marked this pull request as draft May 20, 2026 16:52
# Conflicts:
#	resolve-cveassert/src/arith_san.cpp
@zoogies zoogies marked this pull request as ready for review May 20, 2026 17:15
@zoogies
Copy link
Copy Markdown
Collaborator Author

zoogies commented May 20, 2026

I've introduced a split for behavior between output and gated, set in the vulnerabilities.json like so:

{
  "vulnerabilities": [
    {
        ...
        "output": "patch",
        "gated": true
    }
  ]
}

When gated is true, CVEAssert will output sanitizer maps with default values set to true for target sanitizers. These can be turned off with remediate.py. When output is set to patch, a resolve-patch.ll file will be generated by CVEAssert, but when it's set to inline, the remediation will be baked into the binary produced by the build.

@zoogies zoogies marked this pull request as draft May 21, 2026 13:25
@zoogies
Copy link
Copy Markdown
Collaborator Author

zoogies commented May 21, 2026

I'm going to focus on covering as many edge cases as possible with the recompilation, I've already found a few of them with llvm-mctoll

@zoogies zoogies removed the request for review from rjsmith1999 May 21, 2026 13:26
@zoogies
Copy link
Copy Markdown
Collaborator Author

zoogies commented May 22, 2026

This PR is a bit noisy now, as I've added a bunch of samples for resolve-patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CVEAssert Related to CVEAssert component enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant