Thread: Running Exe's
View Single Post
Old 08-15-2006, 06:53 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
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.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote