herrcore / punbup

Python unbup script for McAfee .bup files (with some additional fun features). This script is fully implemented in python it's not just another wrapper around 7zip!
Other
36 stars 16 forks source link

Warns at the possibility of a corrupted bup, with stream size of 0 #5

Closed PoorBillionaire closed 9 years ago

PoorBillionaire commented 9 years ago

It's not very common, but occasionally one of McAfee's bup files gets corrupted - in these cases, the pointers to the stream data are maxed out with "0xFF" and the stream cannot be parsed properly. One commonality in these corrupt instances is that olefile can see a Details stream and parse it out; however it has no content.

Example of using punbup.py on a corrupted bup file:

dev@computer$ python punbup.py 7df51251e1e1a90.bup Successfully extracted all files to 7df51251e1e1a90. dev@computer$ cd 7df51251e1e1a90 dev@computer:7df51251e1e1a90$ cat Details dev@computer$

I propose a modification to check the size of each stream olefile is able to identify. If the file size is 0, simply print a warning message. Aside from printing a warning message for an empty OLE stream, there is no change in behavior:

dev@computer$ python punbup.py 7df51251e1e1a90.bup Warning: The "Details" stream reports a size of 0. Possibly a corrupt bup. Successfully extracted all files to 7df51251e1e1a90. dev@computer$ cd 7df51251e1e1a90 dev@computer$ cat Details dev@computer$