SCC: fix aggregate lvalues, PPC socketcalls, concat, and target selection - #12
Open
plafosse wants to merge 7 commits into
Open
SCC: fix aggregate lvalues, PPC socketcalls, concat, and target selection#12plafosse wants to merge 7 commits into
plafosse wants to merge 7 commits into
Conversation
Covers #563, #628, #1422, #1423, #2181, #2391, and #6577.
|
|
plafosse
marked this pull request as ready for review
August 21, 2026 13:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses the currently open Binary Ninja issues labeled
Component: SCC, with implementation changes, documentation updates, and regression coverage. The changes are split into issue-focused commits, followed by one shared test-suite commit.Issues fixed
Fixes scc unions in structs binaryninja-api#563 — Nested unions and aggregate lvalues. SCC now recursively computes addresses through nested structs, unions, pointers, dereferences, and array indexes. This fixes reads, writes, address-taking, and pre/post increment or decrement while evaluating side-effecting bases and indexes only once.
Fixes Powerpc socketcall is not setup properly binaryninja-api#628 — PowerPC socket calls. Linux/PPC networking wrappers now use the legacy
socketcallABI, placing syscall 102 inr0, the operation inr3, and a pointer to packed arguments inr4. Regression tests validate all 16 wrappers on bothppcandppcel.Fixes SCC Documentation Fixes binaryninja-api#1422 — SCC help and documentation. Unsupported options and the unimplemented
__initial_<reg>helper are no longer advertised, while the stale claim that byte blacklisting is unimplemented has been removed. The Python wrapper and docs now use--markov-chain-filecorrectly and describe the supported architectures and retained compatibility parameters accurately.Fixes SCC: jump to end of buffer option emits syscall(exit) binaryninja-api#1423 — Concatenation control flow.
--concatnow transfers control to the byte after the generated output instead of callingexit, including when global initialization creates branching control flow. Exact-length and aligned padding now participate in linker layout until relocations and__endconverge on the real output boundary.Fixes SCC: Predefined API on Windows x86_64 target broken binaryninja-api#2181 — Windows x64 predefined APIs. The MessageBox example now uses SCC's runtime-provided declaration instead of introducing a conflicting manual import declaration. Regression coverage verifies both direct use of predefined Windows APIs and compatible redeclarations on the x64 Windows target.
Closes invalid handling address math in long mode binaryninja-api#2391 — Full-width x64 address calculations. The current backend already emits correct 64-bit frame setup and address calculations, so no implementation change was required. Raw-binary and ELF PIE regressions now require the appropriate REX.W encodings and verify RIP-relative global targets, preventing the reported truncation from returning.
Fixes scc defaults to 32-bit shellcode without warning, causing unexpected behavior binaryninja-api#6577 — Implicit target architecture. Normal compilation now warns when it defaults to 32-bit x86, while
--execselects and reports the native x86/x64 target or fails clearly on unsupported hosts. Invalid explicit architectures fail immediately, and late--arch,-m32, or-m64options retain precedence regardless of argument order.Tests
ppcandppcel.ctest --test-dir <build-dir> --output-on-failure— 3/3 tests passed.