Hi, All

A long time ago when I developed my first asm program I spent alot of time constructing files as data.

Just recently I made an installer for my programs and needed the executable to be in the form of data, so instead of doing it long hand I wrote a program to convert it to a data file.

Now I needed to convert a jpg file to data, so I modified it to handle odd file sizes.

Anyhow, enough rambling!!!

If anyone is interested in trying it out e-mail me with the subject WoW. Then you can post any comments; good, bad or indifferent here.

The File size is 5.00 KB. After you convert a file to data you will have to open it up and give it a name.

Thanks for your time and consideration,

Darrel

edit:

I was not sure where to post this.
Posted on 2005-02-06 23:00:42 by Darrel
What exactly do you mean by converting a file to data? Do you mean converting a file into a text file that is like:

dd .., .., .., ..
dd .., .. etc...

If so, a better way to do this would be to use the binary include directive. I think it's "incbin" in NASM, not sure if there's one in MASM.
Posted on 2005-02-07 00:36:14 by StefanD
Yes, you are correct StefanD.

It converts a file into a BYTE array:

BYTE xxh,xxh,xxh,etc
BYTE xxh,etc
etc

I am not familiar with NASM. I just use the basics ML, LINK,RC,etc and a MAKEFILE.

Regards,

Darrel
Posted on 2005-02-07 01:12:02 by Darrel
Hi Darrel,

The tool you are looking for is a binary to include file converter. Check Hutch's masm32 package, the folder C:\masm32 contains a bintodb tool.

Another method to embed your data ( like executables ) is to convert your file to MS COFF object file.

Here is an example:

http://www.masmforum.com/simple/index.php?topic=576.msg3889#msg3889
Posted on 2005-02-07 01:58:01 by Vortex
Hi, Vortex

Thanks for the info, you are correct. I guess this was a useless post. I was just attempting to share.

Thanks again,

Darrel

edit:

I could not find a way for Windows XP to clear the temp folder, so I wrote a little program that does it each time you log on. I just found Mark Larsen's optimization page. I'm quite sure my code is not optimized yet, but would be happy to post the code if anyone is interested.
Posted on 2005-02-07 02:20:54 by Darrel
Hi Darrel,

No problem. Your post is not useless. Every question is important.
Posted on 2005-02-07 03:52:38 by Vortex
Darrel,

It sounds like an interesting tool, you should post it somewhere. If you join the masmforum, it will accept files from members so you are welcome to post it there.

Regards,

hutch at movsd dot com
Posted on 2005-02-07 04:01:08 by hutch--
Hi Vortex,

Thanks for the encouragement. I didn't mean for my comment to be as negative as it came out.

Hi hutch--,

I will be happy to do that. I assume we're talking about the temp folder cleaner.

I did notice your BINTODB uses 16 bytes per row, the same as mine (Great minds think alike :-)). Mine uses hexadecimal instead of decimal tho.

Thank you both for your words of encouragement,

Darrel
Posted on 2005-02-07 14:23:30 by Darrel
If you want to skip the .asm stage and do .obj directly, have a look at http://f0dder.has.it , tool section, and get "bin2o".
Posted on 2005-02-07 18:35:18 by f0dder
Hi f0dder,

Thanks for the info. Correct me if I'm wrong, but isn't an .obj file the same as a .lib file.

I got the idea for the temp folder cleaner from you. In some posts regarding self-deleting programs. I decided your method was the one I would implement. Anyhow when I found my temp folder there was a complete operating system in there!!!!

As of now I'm just converting files to data for installation purposes.

Thanks again, for your time and consideration,

Darrel
Posted on 2005-02-07 23:38:46 by Darrel
Hi Darrel,

Basically, a static library ( .lib ) is a collection of object files containing functions. Once assembled to an object file, a function can be a member of static libraries. Check the lib tool from the Masm32 package, it creates static libs from object files. These libraries are easier to use compared to indivual object files during linking stage.

Another type of lib files is an import library which is completely different from static libs. An import library informs the linker about the association of imported functions with DLLs.

f0dder's bin2o tool is a very usefull one, the purpose of this tool is to convert any type of binary file ( .inc , .exe etc. ) to an object file making easy to embed datas to your main executable.
Posted on 2005-02-08 05:01:31 by Vortex