Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3875954
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:19:34+00:00 2026-05-19T22:19:34+00:00

I have zero knowledge of how the ELF format works or how to access

  • 0

I have zero knowledge of how the ELF format works or how to access its headers and data via code, however I need to check whether an ELF binary has been compressed (packed?) with UPX for Linux.

Checking the binary with strings I saw the string UPX! so I guess I can use that. Hexediting the binary shows the string and for the position in the binary I can assume it’s part of one of ELF’s headers (please correct me if I am wrong). This is a dump of that:

00000000    .ELF........................4...
00000020    ........4. ...(.................
00000040    ........................@...@...
00000060    @.....................[.UPX!....
00000080    ............T............?d..ELF

I don’t know if this looks good, sorry.

Does anyone know how to detect UPX on Linux? If not, how to access the headers and get that UPX! string (name of the header?)?

I did look into the UPX source code but everything is C++, I am looking to code this in C, and it’s really hard to follow.

Thank, any help is welcomed.

EDIT: About the bounty. They answer must give a solid example that works since I’ve tried different approaches and they not always work, like the sample below.
Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:19:35+00:00Added an answer on May 19, 2026 at 10:19 pm

    These are the tests to detect an UPX compressed file:

    >>>>(0x3c.l+0xf8)   string      UPX0 \b, UPX compressed
    >>>>(0x3c.l+0xf8)   search/0x140    UPX2
    >>>(&0x7c.l+0x26)   string      UPX \b, UPX compressed
    >>>&0x26    string      UPX \b, UPX compressed
    >>85    string      UPX     \b, UPX compressed
    

    use

    man 5 magic
    

    to see how the offsets inside the file are specified.

    For example in you program you should:

    1. open the file under test for reading
    2. skip to one of these offsets
    3. check if the expected string is there
    4. repeat until no more offsets

    Interestingly enough, in my ubuntu 64bit, UPX compressed files are not detected because this test is missing from /usr/share/misc/magic:

    >>180   string      UPX!        UPX compressed (64-bit)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just made the registration form for my website, however I have zero knowledge
I have zero experience with COM. I actually never thought, I'll need to do
I inherited a TCL script (I have zero familiarity with the language) and need
This is a question for experienced C/C++ developpers. I have zero knowledge of compiling
I need to display all tables that have zero records. I tried, select *
I have zero to many bookings per day, and I need some measure of
I have zero experience with manipulating image files of any sort with code, so
I used ASEM51 assembler so I could assemble this given code. I have zero
I have to do a project in Corba.I have absolutely zero knowledge of corba.Things
I have zero experience writing applications with Swing, but I have one application with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.