Skip to content

Conversation

@nmatt0
Copy link
Contributor

@nmatt0 nmatt0 commented Oct 24, 2025

Problem

Binwalk currently uses the external 7zz tool to extract CPIO archives. However, 7zz does not support ASCII CPIO archives (SVR4 format), causing extraction failures with the error "Cannot open the file as archive". This affects firmware images that use initramfs embedded in kernel images, which commonly use this CPIO format.

Solution

Implemented a native internal CPIO extractor following the existing pattern used by the RomFS extractor.

I can privately provide the firmware file that was the test case for this change.

@impervius
Copy link
Contributor

Are you sure that this is a real problem? I can't reproduce it.

I am creating an archive in this way

$ find . | cpio -o -H newc > /tmp/test_file
$ file test_file
test_file: ASCII cpio archive (SVR4 with no CRC)

And binwalk extracts it with no issues at all.

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