views:

263

answers:

6

I have to read some data stored by a third party application in an Acess 2000 database. The vendor is no longer around to ask questions.

One table contains image data that appears to be compressed - because the original application can export the contents of the blob field to an embedded png image in a xls export file.

I have extracted the contents of the record using ADO and Delphi (TADOBlobStream), saved it to disk and opened it with a hex editor.

The first 100 characters in hex are as follows

F8 1B 00 00 07 C0 24 27 01 40 7F 20 EC 5D 24 2D 88 5C F0 A7 49 91 4A C4 EA 85 D2 98 6A B5 79 D7 B7 2B D5 48 F8 1B 00 00 07 C0 24 27 01 40 7F 20 EC 5D 24 2D 88 5C F0 A7 49 91 4A C4 EA 85 D2 98 6A B5 79 D7 B7 2B D5 48 1A 9A C8 D3 54 E3 A3 E4 F5 29 C6 97 22 95 6A 8E 10 BD 3E 4B 0B 11 AA 6D A8 C6 87 92

Can anyone tell me if this conforms to a commonly used compression algorithm. The 3rd party application would seems to use the zlib encoding method because of the presence of an encoding dll in its bin directory. But using zlib to decompress does not yield a PNG. FYI, the saved file is about 20% of the size of the PNG file embedded into the XLS.

Thanks

A: 

Universal Extractor can give you some answers. It is open source. http://legroom.net/software/uniextract

Havenard
A: 

You said when you used zlib to decompress it that it wasn't a PNG. Have you checked to see if its some other image format? Maybe JPEG or GIF - maybe even a bitmap?

Joshua
A: 

Thanks for the link to the Universal extractor - unfortunately it could not determine the compression type. I've also tried renaming the file and opening as a jpeg, bmp etc. No luck yet.

Welcome to Stack Overflow. What you have posted here is listed as an *answer* to your question — you had to click the "answer your question" button before you could type anything. But it's obviously not an answer. Please use the "add comment" command to reply to others' answers. You're not allowed to comment until you reach a certain reputation level, but that rule is waived for everything on your own question's page. (Commenting also *notifies* the answerer that you have commented, whereas answerers don't get told about other answers.)
Rob Kennedy
Thanks Rob, I can see the add comment button (for this) but could not see it to respond to the other answers.
You need to be logged in using the same account. I thought you were, since your icon looks the same, but apparently not. You can use the "contact us" link at the bottom of the page to ask an admin to merge your accounts.
Rob Kennedy
A: 

I'm not sure how to test it but Pkware at least used to market (presumably they still do but I haven't looked in ages) a compressor meant for incorporation into a program. It is designed to work on a raw stream of data in memory and thus it won't leave any obvious signature on the data it compresses.

I would try feeding your data stream to their decompressors (I'm aware of two very different versions) and see if they spit out something that looks more reasonable.

Their SDK's are here: http://www.pkware.com/software-developer-tools-margin/software-developer-kits

I used the old dos-era one, the Windows version was too expensive and I never dealt with it.

Loren Pechtel
+4  A: 

Try a differencing attack.

  1. Extract two images from the database using the report / program as described.
  2. Perform a binary difference on the PNG files.
  3. Perform a binary difference on the source blobs in the database.

Compare the differences between the files in blob format and PNG format. This should help in determining if the blob data is a completely different format or just a wrapper.

Also try comparing two different image blobs to each other - see what changes and what (if anything) stays the same.

Will Bickford
A: 

I was curious about this so I decided to take a look. I needed to get it into binary form, so to save the next guy some work, I did this in python. Hope it helps:

#!/usr/bin/python
from zlib import decompress; 

f = open('/tmp/data', 'w+'); 
s = "";
for b in [int(x, 16) for x in ("F8 1B 00 00 07 C0 24 27 01 40 7F 20 " +
 "EC 5D 24 2D 88 5C F0 A7 49 91 4A C4 EA 85 D2 98 6A B5 79 D7 B7 2B " +
 "D5 48 F8 1B 00 00 07 C0 24 27 01 40 7F 20 EC 5D 24 2D 88 5C F0 A7 " +
 "49 91 4A C4 EA 85 D2 98 6A B5 79 D7 B7 2B D5 48 1A 9A C8 D3 54 E3 " +
 "A3 E4 F5 29 C6 97 22 95 6A 8E 10 BD 3E 4B 0B 11 AA 6D A8 C6 87 92".split(" ")]:
  s += chr(b);

s = decompress(s);
f.write(s);
f.close();
Mark Renouf
So much for that idea: Traceback (most recent call last): File "<stdin>", line 1, in <module>zlib.error: Error -3 while decompressing data: incorrect header check
Mark Renouf
You can convert hex to binary and vice versa in vim using %!xxd and %!xxd -r.
Will Bickford