Help Wanted

Can someone knock a prog up quickly for me? – AmazingJas

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
I would like a prog which will strip a chunk of data out of a binary file, and then create a new file containing just that data. Probably a pretty simple thing for anyone who's used to i/o coding, but I'm afraid I'm not experienced in this area.

The way it determines what data to extract, is by finding a keyword in the file (eg, "snapshot") and then start cutting from a specific number of bytes after that address, till the eof.

Or details of how to do this manually would be appreciated?

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
Actually I can be a little more specific, here's the brief:

1. Ask user/navigate to source file.
2. Ask user for image filename.
3. Seek the following term "SnapXXXXX" in the source file where XXXXX is the entered image.
4.Find the start address of the capture by adding 2311 (DEC) to the location of SnapXXXXX
5.Extract from that point, 34590 (DEC) Bytes.
6.Ask user for output file (must be existing file).
7.Copy those 34590 bytes of data into and overtop of the existing data in the destination file at file offset 2266 (8DA HEX)

If you want to know what it's for, it's a long story but it will basically allow me to code C64 stuff on my Palm, and then export my program listings back to my PC so I can them there as well.

[This message has been edited by AmazingJas (edited May 11, 2004).]

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
Blast...I thought I had the format worked out, but back to the drawing board, so hang on a bit if anyone was considering helping me. Looks like I've got some more investigation to do...
Briant

Member

Posts: 742
From: Stony Plain, Alberta, Canada
Registered: 01-20-2001
Doing what you described in your second post would be quite simple, I could whip that up for you. Let me know when you're sure what offsets and sizes you want (that could even be built in to the program, so you can view/change them at run time).

------------------
Brian
miserere nostri Domine miserere nostri

AmazingJas

Member

Posts: 437
From: Sydney, NSW, AUSTRALIA
Registered: 04-03-2003
Thanks mate, awfully nice of you. Unfortunately I found that a couple of other bytes that needed to be manipulated, the whole thing got quite a bit more complicated and so I decided to sit down and work out how to do it myself.

I'm almost done, looks like it's going to work alright too.

But thanks VERY much for the offer!