PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, September 13, 2022

[FIXED] What file format can be executed across windows, linux and mac

 September 13, 2022     cross-platform, elf, exe, machine-code, Out     No comments   

Issue

given some pure machine language commands, for example the following bytes:

1011100010011010000000100000000000000000
11000011

(taken from: How to write and execute PURE machine code manually without containers like EXE or ELF?)? I understand that in general there needs to be a .EXE, ELF, or .OUT wrapper, but as far as I know these formats are platform-specific just to be able to double-click and run them.

Does there exist a file format that can be double-clicked across windows, linux, and mac, and run the same machine code (assuming no external dependencies) ?


Solution

Does there exist a file format that can be double-clicked across windows, linux, and mac, and run the same machine code (assuming no external dependencies) ?

The short answer is no.

The longer answer is that you are mixing concepts and levels of abstractions: double-click is not an OS-level concept, and no OS runs a binary in response to double-click.

They all run a binary in response to execve or a CreateProcess system call, and there is no universal file format that will be acceptable to the OS on all of Linux, Mac OS and Windows.

how does unity's "windows, mac and linux standalone" game build work

In the same way a Python foo.py file works on all platforms: there is a native binary which interprets the code contained in the game. The native binary has different file format on each platform (ELF on Linux, Mach-O on Mac, PE on Windows).



Answered By - Employed Russian
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing