Board index » delphi » Appending exe to exe file
Sergei Salnikov
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Sergei Salnikov
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Appending exe to exe fileHello All. Is the anybody here knows how to append EXE file Thanx . |
Peter Moraliysk
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Appending exe to exe fileQuoteSergei Salnikov wrote: That's a difficult task but not impossible.Since exe files have a crc checksum in their file header dos knows exactly the end of the file and treats the rest of it as garbage.It's difficult to do that with a basic pascal knowage.You should dig asm.If you do you can use int 21h ah=4bh (Don't ask me how since I'm not an asm coder!).The simpliest solution in pascal is probably to find the end of the exe you're running,copy the data after it in a temporary exe file and execute it ;) Hope you don't want to do any destructive tool. Regards, |
Scott Earnes
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Appending exe to exe fileQuotePeter Moraliyski wrote: Quote> That's a difficult task but not impossible.Since exe files have base executable is determind by a page count plus a possible overflow value, both of which are obtained from the EXE header. I've used a unit with the following functions: function flength (var name : pathstr) : longint; var begin function EXElength (var name : pathstr) : longint; type var begin function appendedfile (var name : pathstr) : boolean; begin Quote> It's difficult to do that with a basic pascal knowage. as far as the EXE header and loader are concerned. Quote> You should dig asm.If you do you can use int 21h rather odd. From what I can tell, you give it the pathname, but you can't specify an offset. So the result, *if* you could get it to work, would be to end up reloading the same program. Copying and calling the second .EXE could be a possibility, but is probably Quote> Regards, Scott Earnest | SPAM protection in effect. Remove | setech@_ix.netcom.com | "_" as needed for true addresses. | earnests@_homenet.lm.com | UIN:1136443 EFnet:pale_blue | sinykal@_{*word*104}space.org | URL: http://www.netcom.com/~setech | |
R.E.Dona
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:Appending exe to exe fileQuoteScott Earnest <setech@_ix.netcom.com> wrote: front-end to an existing program. One point that hasn't been mentioned yet is that most of the This record prefixes components such as debug information, The TVision resource file defines: TVision helpfile defines: For example, the following was removed from tStream.Init to allow Function tStream.AlignResource VAR Found, Stop: Boolean; ...red -- |