ok, well, it's only like 80 lines longer than my last program which compiled at 4.5kb, consists of the same style coding, yet this compiles to 21kb! what's going on here? any suggestions for bringing the file size back down?
Posted on 2002-02-08 13:59:16 by mc`
oh yeah, by the way, this is my disk imaging program, can read images from any type of drive, and write them back to anything writeable (excluding cd-r's.. for now). only works on nt based systems, but will compile for anyone. run the compiled program with no arguments to see how it's used.
Posted on 2002-02-08 14:01:07 by mc`
hehe, whoops, found a little bug in the usage display.. i suppose i should check things over a little more before posting my code. anyway, to fix, in the data section, replace the sUsage through sUsage4 lines with this..

sUsage db "usage: dimage3 -f file_name -d drive_letter",10,13,0
sUsage2 db 9,"-f file_name",9,9,"specifies image file name",10,13,0
sUsage3 db 9,"-d drive_letter",9,9,"specifies drive letter",10,13,0
sUsage4 db 9,"-r",9,9,9,"writes image file from disk drive",10,13,0

just appended some 0's to the end to make the strings display correctly
Posted on 2002-02-08 14:10:21 by mc`
jeez i'm sloppy.. you need this too, i just put it in windows.inc here..

Cylinders LARGE_INTEGER <>
MediaType dd ?
TracksPerCylinder dd ?
SectorsPerTrack dd ?
BytesPerSector dd ?
Posted on 2002-02-08 14:22:02 by mc`
To get you file smaller you should use some uninialised data.
things like this:
pszImg db MAX_PATH dup(0)

pszDrv db MAX_PATH dup(0)
dBuff dd 4096 dup(0)
dRet dd 0

are all adding bytes set to zero into your executable you could save a lot of space by defining them as ?, you could put them in a .data? section but it is not required
hope this helps
Posted on 2002-02-08 14:27:46 by Quantum
wow i'm dumb, moved 7 things into .data? and it dropped the exe size to 4.0kb! even smaller than the original, many thanks Quantum, i can't believe i forgot about that.
Posted on 2002-02-08 14:32:23 by mc`