hello,
this is an expert topic and winner have expert answer.
I have a Binary File and save multiple files in this Binary file.
this file is QuickBasic BSAVE binary data
please help me Experts
Regards,
Thanks
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ehsanPosted May 22, 2008, 4:47 PM
Thanks For Your response Johnny GC.
I Found 0xFD result for valid bsave file header but I can't extract the (((Files))) into this file in C#
this is first lines in hex editor
.........................lq........8...mOC20.......>.OMEGA [email protected]__3USER FAT12@.@T!.....U.......@.... `<...O.@.+..........!..% .#..&..'.....+p.-../..1 [email protected]`.7..9..;..=..?..A [email protected]`.G..I..K..M..O..Q [email protected]`.W..Y..[..].._..a [email protected]`.g..i..k..m..o..q [email protected]`.w..y..{..}...... ..@..`................. ..@..`.C............... .
please help me more
Thanks Advance
Regards
Johnny GCPosted May 22, 2008, 1:03 PM
I do not know this type of format but I`ve worked a lot with binary files, not only in c#, so, this is your header info googled:
so it seems you need to open file stream and do a repetitive read, this read will consist in:
1. first 7 bytes to know what data and size you have
2. the next X bytes where X is the Length (bytes 6+7 from header)
note that the length of the data may be bytes 6+7 from header or bytes 6+7 from header MINUS 7 cause 7 is header`s length
for example, lets say you have this 7 bytes in the beginning:
0x01 0x02 0x03 0x04 0x05 0x06 0x07
you have a segment identified with 0x0203, an address of 0x0405 and a length of 0x0607 which is 1543 in decimal thus you need to read then 1543 or 1543-7 bytes (if the length includes header)
OPEN FILE
POSITION BEGINNING
LOOP
READ 7
CHECK LENGTH
READ LENGTH || LENGTH-7
ENDLOOP
hope this helps