Hi,
Would it be possible to write a program to strip the windows files from an EXE file and then write another one to place the Files from another os into the EXE file? Also, chase, jAAman, carbonbased, get rid of the inopropriate post please.
EXE question
EXE question
"Real corn makes it special!" -The Grim Adventures of Billy and Mandy
MMM...Caffeine
Intel Inside, Idiot Outside
MMM...Caffeine
Intel Inside, Idiot Outside
I recently heard of a program called exe2com that strips an exe file down to a com one. Would it be possible to strip an exe file down to com, then, add info to the com file so that another os could use windows exe files?
"Real corn makes it special!" -The Grim Adventures of Billy and Mandy
MMM...Caffeine
Intel Inside, Idiot Outside
MMM...Caffeine
Intel Inside, Idiot Outside
exe2com IIRC only works with MZ type exe files and not PE
MZ I think just has some extra info like stack size and preferred memory address or something like that and is NOT relocatable, but PE will have RELOCATIONS wich means you have to
1.read/interpret the header(for linker stuff)
2.change the relocations to actual memory locations(or leave it that way if you support relocations in your format)
3.interpret the header again to convert it to your header
4.copy it to your header applying sections and such
but yea i don't remeber if it was MZE or PE or both but 1 is so simple you can just attach a template header onto a com/bin file and work perfectly
btw what do you need this for? if you need it to convert your kernel to .exe then well I would need to know what compiler your using
MZ I think just has some extra info like stack size and preferred memory address or something like that and is NOT relocatable, but PE will have RELOCATIONS wich means you have to
1.read/interpret the header(for linker stuff)
2.change the relocations to actual memory locations(or leave it that way if you support relocations in your format)
3.interpret the header again to convert it to your header
4.copy it to your header applying sections and such
but yea i don't remeber if it was MZE or PE or both but 1 is so simple you can just attach a template header onto a com/bin file and work perfectly
btw what do you need this for? if you need it to convert your kernel to .exe then well I would need to know what compiler your using
MZ executables are relocatable, dos did come with a program for converting DOS 'MZ' files, into CP/M style 'com' files (called exe2bin), however (iirc) it wouldnt work unless the program was compiled specifically for it (couldnt work if they were relocatable, or it specified a stack -- both required by the specification)MZ I think just has some extra info like stack size and preferred memory address or something like that and is NOT relocatable
doneAlso, chase, jAAman, carbonbased, get rid of the inopropriate post please
Hello..
As mentioned here, MZ exes can only converted into com and so on. Now from your question I can guess that you want to convert a standard exe to a file say "xyz" that can be executed in your OS.
Now for this you have to make your APIs windows (or rather DOS) compatible.. When a DOS program to print "Hello World" is compiled.. the DOS interrupts are assembled(int 21 I guess). So when such file executes it calls int 21 without knowing in which OS it is..
So you need to change such calls to your own API calls.. You have to map them...
Hope I was on right track.. its 5 AM.. so I am half in bed..
As mentioned here, MZ exes can only converted into com and so on. Now from your question I can guess that you want to convert a standard exe to a file say "xyz" that can be executed in your OS.
Now for this you have to make your APIs windows (or rather DOS) compatible.. When a DOS program to print "Hello World" is compiled.. the DOS interrupts are assembled(int 21 I guess). So when such file executes it calls int 21 without knowing in which OS it is..
So you need to change such calls to your own API calls.. You have to map them...
Hope I was on right track.. its 5 AM.. so I am half in bed..
Currently working on "TAJ: India's first object oriented operating system"...
http://www.viralpatel.net
http://www.geocities.com/taj_os
http://www.viralpatel.net
http://www.geocities.com/taj_os