Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between plain binary format (.bin) and Windows Executable (.exe)?

What is the difference between plain binary format (.bin) and Windows Executable (.exe)?

like image 201
Alon Gubkin Avatar asked Dec 20 '09 20:12

Alon Gubkin


3 Answers

I'm not sure what a "bin" file is in this case. Could be a firmware, could be an object file, could be anything really (it depends on context).

When talking about executables (exe files in the case of windows) these are usually self contained packages with everything required to run them packed in. These file formats usually contain all the executable data, string and other resources, linking data and exports, offsets, and other data stuffed in them. They have everything required for the OS to setup and enviroment to run them, like the dependent libraries that need to be loaded, the architecture it needs to run, etc.

There are lots of different ones in common use:

  • PE your standard windows executable and dll format (http://en.wikipedia.org/wiki/Portable_Executable)
  • ELF used by Linux and other UNIX clones (http://en.wikipedia.org/wiki/Executable_and_Linkable_Format)
  • Mach-O used by your Mac executables (http://en.wikipedia.org/wiki/Mach-O)
  • a.out sort of legacy executable package (http://en.wikipedia.org/wiki/A.out)

Lots of others (COFF, COM, etc).

If the operating system supports dynamically linkable libraries (dlls on windows, .so files on linux, dylibs on mac) then they usually share this same packaging format.

like image 174
4 revs Avatar answered Nov 04 '22 01:11

4 revs


There's no such thing as plain binary format. There's no known standard for what is in ".bin" files. Expect any data.

EXE is a file with a well-defined structure for storing code. It's called "Portable Executable" format, and has a PE header starting with MZ.

http://en.wikipedia.org/wiki/Portable_Executable

like image 22
Pavel Radzivilovsky Avatar answered Nov 04 '22 01:11

Pavel Radzivilovsky


BIN: The BIN file type is primarily associated with 'Binary File'. Binary files are used for a wide variety of content and can be associated with a great many different programs. In general, a .BIN file will look like garbage when viewed in a file editor for more info Click here

EXE: The EXE file type is primarily associated with 'Executable File' by Microsoft Corporation. An executable file is basically another name for a program. Virtually all programs that run under Windows or DOS are in the .EXE format for more info click here

like image 37
Hiyasat Avatar answered Nov 03 '22 23:11

Hiyasat