Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save weldpua2008/6fa68568a0a68c816fb8c556bb7da017 to your computer and use it in GitHub Desktop.
Save weldpua2008/6fa68568a0a68c816fb8c556bb7da017 to your computer and use it in GitHub Desktop.
How can I get the architecture of a binary file?
How can I get the architecture of a binary file?
readelf -h <archive>.a | grep 'Class\|File\|Machine'
[00:32:15] /usr/lib $ readelf -h libxslt.a | grep 'Class\|File\|Machine'
File: libxslt.a(attrvt.o)
Class: ELF32
Machine: Intel 80386
File: libxslt.a(xslt.o)
Class: ELF32
Machine: Intel 80386
... #Trimmed this, it goes on a bit
File: libxslt.a(transform.o)
Class: ELF32
Machine: Intel 80386
File: libxslt.a(security.o)
Class: ELF32
Machine: Intel 80386
readelf -h /home.local/stanislavp/toolchain_extracted/toolchain_extracted/usr/bin/as| grep 'Class\|File\|Machine'
Class: ELF64
Machine: Advanced Micro Devices X86-64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment