| Why not use C, and call the apropriate exec*() function on your executable ?
What gain would you have, to read the file as binary, and execute each instruction as read ??
Unless you're trying to debug a program, so you want to make sure at all time to know where in the program you are...
But for that, theres already a number of excelent debuggers out there..
In order to read the executable, you need to know exactly where in the executable the compiler places the preloading header, how many bytes from that the first instruction is, and then read the file instruction-wise..
Sounds to me like an awful lot of trouble, just to run the damned program within your program. |