.exe file to text file and back

This is a discussion on .exe file to text file and back within the Pascal forums in Programming Languages category; i have to make 2 programs: a program that converts .exe or .dll or .zip etc. into text file and a program that reads same text file and writes same binary file back. example data.exe->data.txt- >(transfer)->data.txt->data.exe the final text file can look like 4d 5a 90 00 etc. or 1100010011110 etc. or À¾Bÿ¾@e@ etc. or ascii(021) ascii(019) ascii(077) ascii(111), i dont care. why i need it: else program transfers files from a location to another like email atachments but only accepts text files. i expect that on the other side, after conversion, the .exe file or .zip file etc. will ...

Go Back   Application Development Forum > Programming Languages > Pascal

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 05-29-2008, 07:00 AM
radu
Guest
 
Default .exe file to text file and back

i have to make 2 programs: a program that converts .exe or .dll
or .zip etc. into text file and a program that reads same text file
and writes same binary file back. example data.exe->data.txt-
>(transfer)->data.txt->data.exe

the final text file can look like 4d 5a 90 00 etc. or 1100010011110
etc. or À¾Bÿ¾@e@ etc. or ascii(021) ascii(019) ascii(077)
ascii(111), i dont care.
why i need it: else program transfers files from a location to another
like email atachments but only accepts text files.
i expect that on the other side, after conversion, the .exe file
or .zip file etc. will work.
i found it very difficult reading binary files with blockread and how
does it looks what it reads?
any help or explaining would be much apreciated. thank you.
Reply With Quote
  #2  
Old 05-29-2008, 07:16 AM
Marco van de Voort
Guest
 
Default Re: .exe file to text file and back

On 2008-05-29, radu <lungu.radu@gmail.com> wrote:
> i have to make 2 programs: a program that converts .exe or .dll
> or .zip etc. into text file and a program that reads same text file
> and writes same binary file back. example data.exe->data.txt-
>>(transfer)->data.txt->data.exe

> the final text file can look like 4d 5a 90 00 etc. or 1100010011110
> etc. or À¾Bÿ¾@e@ etc. or ascii(021) ascii(019) ascii(077)
> ascii(111), i dont care.


These have existed for aeons, search for uuencode/uudecode or mime/unmime.

> i found it very difficult reading binary files with blockread and how
> does it looks what it reads?


It doesn't. It reads binary, IOW it just looks up the address in memory of
whatever variable you pass, and starts banging <count> bytes into it. And it
doesn't care if it fits.

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:02 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.