uriyay / sexton

Hex editor written in Python
0 stars 0 forks source link

Add a support in 010 Editor templates #5

Open uriyay opened 7 years ago

uriyay commented 7 years ago

010 Editor has already many templates for parsing data. Also, its template programming language is very similar to c language, so it can be used in c/c++ without much effort.

uriyay commented 7 years ago

Oh someone already did that :) http://d0cs4vage.blogspot.co.il/2015/08/pfp-python-interpreter-for-010-templates.html Installation: pip install pfp

Usage: import pfp with open(''png_template.bt') as f: template = f.read()

parse

png = pfp.parse( data_file="~/Documents/image.png", template_file='png_template.bt', )

show

desc = png._pfp__show() print desc

build

with open("/tmp/test.png", "wb") as f: png._pfp__build(f)