Skip to content

Preserve Pseudo C string contents and encoding - #8579

Merged
plafosse merged 3 commits into
devfrom
test_fix_pseudoc_string_formatting
Oct 1, 2026
Merged

plafosse merged 3 commits into
devfrom
test_fix_pseudoc_string_formatting

Conversation

@plafosse

@plafosse plafosse commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Wrapped string literals could lose format specifiers, split escape sequences, or drop literal whitespace. Outlined copies could also lose their Unicode encoding or omit bytes after an embedded NUL, changing the copied data when the Pseudo C was recompiled.

Keep complete escape and format sequences when wrapping string tokens, preserve literal whitespace, and retain the detected Unicode prefix. Render memcpy constant data as complete byte escapes so embedded NULs and annotation limits cannot shorten the copy.

Related issues: Vector35/binaryninja#2063, Vector35/binaryninja#2064, Vector35/binaryninja#2065, and Vector35/binaryninja#2074.

Companion core PR: Vector35/binaryninja#2078 contains the regression tests, minimized AArch64 binaries with C sources, and four corpus oracle updates. Merge this API PR before the core PR.

Local validation:

  • Full Release/Ultimate GUI build and app signing passed.
  • Pytest: 6,407 passed, 254 skipped, including 25 new regression checks.
  • Core native tests: 541 passed. Standalone C++ tests: 234 passed, 2 skipped.
  • All four minimized reproducers compile and execute correctly after decompilation at both -O0 and -O2; the two counted-copy cases also pass with AddressSanitizer.

Existing failures in broader suites: CTest registers one test twice that fails in isolation but passes in the complete core suite; 24 Rust unit/integration tests also fail with the unmodified dev plugins; three unchanged Rust documentation examples fail to compile.

CI status: the branch build is currently unstable. The reported extension-manager network test fails because the live manifest now returns an official repository URL ending in /extensions/, while the test expects extensions without the slash. This follows the September 23 extension-server router change, and the same assertion failure reproduces with the original dev plugins. The local pytest total above excludes network tests under the default pytest configuration.

@plafosse
plafosse requested a review from bpotchik September 24, 2026 03:37
@plafosse plafosse added this to the Langara milestone Sep 24, 2026

@bpotchik bpotchik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Keep complete escape and format atoms, preserve whitespace inside literals, and avoid replaying text at the annotation parsing limit. Fixes Vector35/binaryninja#2063 and Vector35/binaryninja#2074.
Use the detected UTF-16 or UTF-32 literal prefix when rendering constant string data. Fixes Vector35/binaryninja#2064.
Render memcpy constant data as complete byte escapes. Embedded NULs and display annotation limits must not truncate a counted byte copy. Fixes Vector35/binaryninja#2065.
@plafosse
plafosse force-pushed the test_fix_pseudoc_string_formatting branch from 3de0667 to 4925d41 Compare October 1, 2026 20:03
@plafosse
plafosse merged commit 795cc47 into dev Oct 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants