Repository navigation
[AUTOMATED] List embedded images and archives, and name them in decompiled code - #1682
Merged
Merged
Conversation
…piled code A PNG, JPEG, GIF, BMP, ICO, zip, gzip, xz or zstd file stored whole in a mapped section showed only as string fragments of its header, and the code returning it printed a bare address. `kuna blobs <binary> [--json] [--extract DIR] [--kind LIST] [--section NAME] [--no-xrefs]` lists each file with its address, exact length, section and the functions that reference it. The scanner (kuna-analysis `blobs`) keeps a magic-number candidate only when its container structure walks to its end (PNG chunk CRC-32s to IEND, JPEG markers to EOI, the GIF trailer, the BMP size against its pixel array, an ICO directory of PNG or DIB images, the zip end record and central directory, a gzip stream inflated to its trailer CRC-32, the xz footer and index CRC-32s, zstd frame and block headers). No pixels are decoded, a truncated file is not reported, and one scan's work is capped. New option `blobs on|off`, default on: the same scan runs at load and each file becomes a `<kind>_<addr>` symbol typed `unsigned char[length]` where no symbol covers the address; string fragments inside a file are not planted. A constant equal to a file's first address is weighed as a pointer even below the pointer lower bound, unless the function also reads the value as a number, so a shared object whose read-only data starts in the first page returns `png_2d0` instead of `0x2d0`. Fixes Noelo-Lab#1649
Resolves the corpus-count, catalog-count, kuna-cli mod-list and stages-baseline conflicts with main 3059b7f. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKQeLQDThvbHGNoGw8h
… state the pointer escape's cost - kuna blobs lib.a:member works like the other image subcommands (added to the archive-member command list, with a CLI test). - The fixture recipe needs -fcf-protection=full to rebuild byte-for-byte. - Spec 05 and the option's use_when say that a plain number equal to a first-page file's address prints as the file too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKQeLQDThvbHGNoGw8h
Contributor
|
[AUTOMATED] Pushed three commits on top of d9ae254:
The scanner had no false positives on 4,156 binaries (system libraries and tools, Go and Rust toolchains, node, decbench x86-64/ARM/MIPS/PPC, PE). All 1,326 files found pass |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKQeLQDThvbHGNoGw8h
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0179iMKQeLQDThvbHGNoGw8h
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.
[AUTOMATED]
A PNG, JPEG, GIF, zip or gzip stored whole in a data section showed only as string fragments of its header, and the code that returns it printed a bare address.
With this change
kuna blobs blob.soprints0x2d0 png 69 .rodata 1 get_logo, and the function isunsigned char * get_logo(...)returningpng_2d0.The change
kuna blobs <binary> [--json] [--extract DIR] [--kind LIST] [--section NAME] [--no-xrefs]lists each embedded PNG, JPEG, GIF, BMP, ICO, zip, gzip, xz and zstd file with its address, exact length, section and the functions that reference it.--extractwrites the files out.kuna-analysis/src/analyzers/blobs) treats a magic number as a candidate only. A file is reported when its container walks to its end: PNG chunks toIENDwith every CRC-32, JPEG markers toEOI, GIF blocks to the trailer, the BMP size against its pixel array, an ICO directory of PNG or DIB images, the zip end record and central directory, a gzip stream inflated to its trailer CRC-32, the xz footer and index CRC-32s, zstd frame and block headers. No pixels are decoded, and a truncated PNG is not reported.blobs on|off, default on: the same scan runs at load and each file becomes a<kind>_<addr>symbol typedunsigned char[length]where no symbol already covers the address. String fragments inside a file are no longer planted.0x2d0, with or without a symbol on the array.Tests
tests/stages/kuna-blobs.xml, two passes over a stripped shared object holding a PNG, GIF, JPEG, zip, gzip and a PNG cut beforeIEND: off printsreturn 0x3c0;, the defaultreturn png_3c0;, and the cut PNG stays0x720in both.kuna-cli/tests/blobs_cli.rs(listing, owners,--extractbyte for byte,--json, filters) and scanner unit tests for all nine kinds, truncation, damaged checksums, nesting and the work cap.gzip -t,zstd -t,unzip -tand Pillow accept every one.libLLVM.so(the string scan there takes 1.2 s) and under 10 ms onbash. No existing datatest or stage expectation moved.Fixes #1649