Re: Reading in a file as raw hex bytes?



The file you are asking about is a non-standard hex dump of a binary
file.
By non-standaard I mean it shows lines of only 10 bytes when a more
normal dump is by 16 bytes per line to match file segments of
multiples of 256 bytes.

So it is formatted in the sense that it has an 8-digit byte counter, a
space, 20 hex digits representing 10 binary values of bytes (0-255)
then the ascii characters themselves from the file in grooups of 10
byes each line.

So all you ahve to do is read the dump file and SKIP OVER THE FIRST 8
counting bytes, plus 1 space plus 20 bytes hex (and the next
unspecified field which has been closed down) and read ONLY THE LAST
10 BYTES for that line.

So you read the whole file as lines of 10 bytes and write out just 10
bytes per line read in (as unformmated binary, writing 1 10-byte
string with no added cr-lf).
The result is the original file that was hex-dumped.

Another way id to read the file with a text editor that allows
removing columns of text (like Worstar does), and simply remove all
the left side for the whole file, leaing the original 10 byes plus cr-
lf of the display.
Then remove all right-hand side cr-lf pairs (another 2-byte hidden
column) and what is left is the original file, which you then save.


.



Relevant Pages

  • Re: Reading text file characters
    ... > If anyone is still with this thread, I did a hex dump suggested by ... > What doesn't show up in the numbers below is the last line of the hex ... Hex 1A is ASCII EOF. ... Since the first EOF marks the end, ...
    (microsoft.public.vb.general.discussion)
  • Perl program to decode memory dump to timestamps in 10046 trace files.
    ... Dump of memory from 0x0BBEEA10 to 0x0BBEEA1B ... three doubleword hex arguments, ... as a timestamp, according to Note 376618.1. ...
    (comp.databases.oracle.server)
  • Re: Please help: Swyftcard or Swyftware software for Apple II
    ... Looks like Paul R. Santa-Maria started OCR'ing the Hex ... dump from the patent in 2004... ... assuming that Swyftware is a similar size to the Swyftcard ... I'd probably need help in getting this back into Apple II format ...
    (comp.sys.apple2)
  • Re: Newsreader usage in this group
    ... > Choose Hex Dump File from File menu ... > (Open files are shown in the window) ... > Click Dump ... persists in another window. ...
    (uk.comp.sys.mac)