Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from p7zip to 7zip #735

Merged
merged 1 commit into from
Nov 3, 2024
Merged

switch from p7zip to 7zip #735

merged 1 commit into from
Nov 3, 2024

Conversation

stkw0
Copy link
Contributor

@stkw0 stkw0 commented Nov 3, 2024

The latest 7zip version supports unix systems, so it can be used instead of the old unix port (last version of p7zip is from 2016, see https://sourceforge.net/projects/p7zip/).

Related with this I have a small question. How to have multiple extractors for the same signature? I have seen in display.rs that it supports multiple extractors, but I didn't see an argument for the signature types in the Extractor type.

@devttys0 devttys0 merged commit 5590bb2 into ReFirmLabs:master Nov 3, 2024
4 checks passed
@devttys0 devttys0 self-assigned this Nov 3, 2024
@devttys0
Copy link
Collaborator

devttys0 commented Nov 3, 2024

Thanks!

Currently only one extractor can be defined per signature (signatures are associated with extractors in magic.rs). However, a signature parser may override the defined extractor by specifying an alternative preferred extractor when returning a SignatureResult structure.

@qkaiser
Copy link

qkaiser commented Nov 9, 2024

I would suggest that an update to ./src/extractors/sevenzip.rs be made in order to use 7zzs as it's now installed by the dependency installer since b624a5e

Without this, the Docker container is now broken since the 7zip version being installed is 7zip:

https://github.com/ReFirmLabs/binwalk/blob/master/dependencies/ubuntu.sh#L8

So either:

  • get back to 7z and stick to it
  • move to 7zzs and remove the 7zip install in dependencies/ubuntu.sh

Symlinks are also possible, but this will be even messier.


This is the current status with docker container:

[2024-11-09T14:59:31Z ERROR binwalk::extractors::common] Failed to execute command 7zz["x", "-y", "-o.", "/output/input.fw.extracted/0/zip_0.bin"]: No such file or directory (os error 2)
[2024-11-09T14:59:31Z ERROR binwalk::extractors::common] Failed to spawn external extractor for 'zip' signature: No such file or directory (os error 2)

                                                                                      /output/input.fw
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DECIMAL                            HEXADECIMAL                        DESCRIPTION
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0                                  0x0                                ZIP archive, file count: 2, total size: 7330597 bytes
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[-] Extraction of zip data at offset 0x0 failed!
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Analyzed 1 file for 86 file signatures (188 magic patterns) in 5.0 milliseconds

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.

3 participants