Skip to content

Instantly share code, notes, and snippets.

@novaTopFlex
Created May 22, 2024 00:37
Show Gist options
  • Save novaTopFlex/65366e2ba882ee6542a1cc6109d666ed to your computer and use it in GitHub Desktop.
Save novaTopFlex/65366e2ba882ee6542a1cc6109d666ed to your computer and use it in GitHub Desktop.
File Types from Linux `file` command

Output from gcc -m32 -o [Program] [Program].c && file Program:

Program: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=4dbc54aee00e05742077f05b5be11583c55197a3, for GNU/Linux 3.2.0, not stripped

Output from gcc -mx32 -o [Program] [Program].c && file Program:

Program: ELF 32-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /libx32/ld-linux-x32.so.2, BuildID[sha1]=f76b7461fbd56cb195d4e4fc345a33b554514043, for GNU/Linux 3.4.0, not stripped

Output from gcc -m64 -o [Program] [Program].c && file Program:

Program: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=45af653e8c033eb21897c8b8881f872d2e3619aa, for GNU/Linux 3.2.0, not stripped

Output from arm-linux-gnueabi-gcc -o Program Program.c && file Program

Program: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, BuildID[sha1]=e941cc3be7bc679f75c1d847fa1fe7e0dc8b69cf, for GNU/Linux 3.2.0, not stripped

Output from aarch64-linux-gnu-gcc -o Program Program.c && file Program

Program: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=345f5923138092249a65761b1cd07123ca9b0758, for GNU/Linux 3.7.0, not stripped

Obviously, the hashes will vary significantly depending on the specific program to be run; these hashes are for the program that simply prints "Success!" and exits zero if successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment