Hello...
Does anybody know how to include a binary file to memory and testing its length.
for example in Purebasic:
datasection:
sound: includebinary "sound.xm"
sondend:
endatasection
lenght.l= ?soundend-?sound
How to do that with masm without using as Resource?
Thanx in advance
you could simply open it as a file and read it into an allocated buffer
if you only want to verify the size, you could use FindFirstFile
not reading an external file...
file should be integrated as a binary in the exe...
then it is a resource
or - it is hard-defined in data
Hi hmi222,
Have a look at the fda.exe and fda2.exe utilities coming with the Masm32 installation. fda inserts binary files into the .data section.
Moved along in masm folder...
bintodb is the right thing!!!
:U
Meeehhh, I hate converting to db and putting it in my source. I prefer to keep it as a resource file, so I can easily comment it out, or change its name to point to another file, or change the file itself. (well, no need for extra tools also)
Have a look at eiother FDA utilities, they create an object module that you link into the finished binary and it creates an include file for both the data label and the data length. I literally wrote them to embed any length file into an EXE/DLL file without the limitations of the DB format or the nuisance value of putting the file into resources.
Maybe there is a simple solution in JWASM -never tryed muss say-
In "Hystory.txt" it says:
"- INCBIN directive added."
May that's something borrowed from NASM. :bg
Hi Ficko,
Jwasm's INCBIN directive works fine. Pelle's Macro Assembler supports the INCBIN statement too.
Quote from: Vortex on July 14, 2009, 04:58:19 PM
Hi Ficko,
Jwasm's INCBIN directive works fine. Pelle's Macro Assembler supports the INCBIN statement too.
GoAsm supports INCBIN as well, the SIZEOF directive will give the size of the file.
Quote from: donkey on July 14, 2009, 05:59:05 PM
Quote from: Vortex on July 14, 2009, 04:58:19 PM
Hi Ficko,
Jwasm's INCBIN directive works fine. Pelle's Macro Assembler supports the INCBIN statement too.
GoAsm supports INCBIN as well, the SIZEOF directive will give the size of the file.
Wow ! :U
Made a mental note to use this !