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

Additional format request, UPX detection and extraction support #1012

Open
abclution opened this issue Nov 19, 2024 · 3 comments
Open

Additional format request, UPX detection and extraction support #1012

abclution opened this issue Nov 19, 2024 · 3 comments
Assignees
Labels
format:executable format request Format support request by 3rd party.

Comments

@abclution
Copy link

abclution commented Nov 19, 2024

I searched for any issues (open/closed) with upx in them and zero came up which surprised me.

Summary

Would be good to support UPX.
https://github.com/upx/upx

Very commonly found on embedded linux devices like ip cameras used to compress executables. Packages are available in most distros.

Someone previously asked the emba team to include it, but they mentioned it would be a good feature add for unblob and I agee. The initial poster never followed up here and I figured I would.

Original emba issue: e-m-b-a/emba#1067

Dependency is available with apt install upx or through https://github.com/upx/upx.

Documentation: https://upx.github.io

Motivation

Well, in my case I use this for disassembling and analyzing ipcamera firmware using emba.
Emba is in essence not finding what I need due the the files being analyzed while still compressed by UPX.

Another person months ago was supposed to inform unblob but upon a search I found nothing..
e-m-b-a/emba#1067

@qkaiser
Copy link
Contributor

qkaiser commented Nov 19, 2024

@abclution can you share the firmware where those UPX files are found ?

@qkaiser
Copy link
Contributor

qkaiser commented Nov 19, 2024

We can implement a check in the ELF handler, similar to the one we do for kernels in ElfChunk.

We can look for the UPX! magic within the header and parse the l_info struct (see https://github.com/upx/upx/blob/d7ba31cab8ce8d95d2c10e88d2ec787ac52005ef/src/stub/src/include/linux.h#L730).

If the l_info is valid (good checksum, good version, good format), then we can call upx -d instead of the usual carving.

@abclution
Copy link
Author

Sure thing, here is one, most bins are upx compressed.

UPXcompressionfirmwaredump.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:executable format request Format support request by 3rd party.
Projects
None yet
Development

No branches or pull requests

2 participants