Static analysis of an unknown compression format
blog.lse.epita.fr
Static analysis of an unknown compression format
1–10 of 14 posts
Re: Static analysis of an unknown compression format
#2Wouldn't this be a trivial and somewhat useful thing to see structure in binary files?
Re: Static analysis of an unknown compression format
#3Is there any tool to generate bitmaps from binary files? For example using each byte as grey value and letting the user specify the column width. Or with more than one byte and then using color. Wouldn't this be a trivial and somewhat useful thing to see structure in binary files?
Re: Static analysis of an unknown compression format
#4Is there any tool to generate bitmaps from binary files? For example using each byte as grey value and letting the user specify the column width. Or with more than one byte and then using color. Wouldn't this be a trivial and somewhat useful thing to see structure in binary files?
Re: Static analysis of an unknown compression format
#5Is there any tool to generate bitmaps from binary files? For example using each byte as grey value and letting the user specify the column width. Or with more than one byte and then using color. Wouldn't this be a trivial and somewhat useful thing to see structure in binary files?
When doing simple graphics work at university, I would name files that contained nothing but pixel data foo.raw and IIRC some image editors would offer the options you mention when opening the files, then display them fine. Maybe that was before .raw got associated with cameras (and presumably more complex).
Re: Static analysis of an unknown compression format
#6Is there any tool to generate bitmaps from binary files? For example using each byte as grey value and letting the user specify the column width. Or with more than one byte and then using color. Wouldn't this be a trivial and somewhat useful thing to see structure in binary files?
With the entropy and ASCII printable filters setup, it makes repeating patterns and TEXT sections pretty clear.
Re: Static analysis of an unknown compression format
#7Is there any tool to generate bitmaps from binary files? For example using each byte as grey value and letting the user specify the column width. Or with more than one byte and then using color. Wouldn't this be a trivial and somewhat useful thing to see structure in binary files?
and related: http://corte.si/posts/visualisation/entropy/index.html (visualizing entropy in binary files)
I used his software on an unknown format from the 1988 game Circuit's Edge to find out if/where the file was encrypted or compressed. It works well and was able to give me a (very) general idea of where in the file I needed to look further.
Edit: Nope, I remembered incorrectly. I used it on the game's .exe to tell me if I was dealing with a compressed executable. It turned out that it was compressed and so I went on a search for an ancient unpacker.
See before and after:
edge.exe packed: http://imgur.com/PlHGl
edge.exe unpacked: http://imgur.com/jeFLb
Re: Static analysis of an unknown compression format
#8Is there any tool to generate bitmaps from binary files? For example using each byte as grey value and letting the user specify the column width. Or with more than one byte and then using color. Wouldn't this be a trivial and somewhat useful thing to see structure in binary files?
import sys
import math
from PIL import Image
def getSize(len, width):
h = int(math.ceil(float(len) / width))
return (width, h)
def getImage(file, width=256):
d = file.read()
s = getSize(len(d), width)
im = Image.new('L', s)
im.putdata(d)
return im
def main():
if len(sys.argv) [width]'
return
with open(sys.argv[1], 'rb') as f:
if len(sys.argv) > 3:
width = int(sys.argv[3])
img = getImage(f, width)
else:
img = getImage(f)
img.save(sys.argv[2])
if __name__ == "__main__":
main()
Here's a visualization of user32.dll on Windows. Notice how you can actually make out the images that are embedded in the resources!Re: Static analysis of an unknown compression format
#9Re: Static analysis of an unknown compression format
#10Is there any tool to generate bitmaps from binary files? For example using each byte as grey value and letting the user specify the column width. Or with more than one byte and then using color. Wouldn't this be a trivial and somewhat useful thing to see structure in binary files?
echo P4 > file
echo "640 480" >> file
echo 255 >> file
cat binaryBlob >> file