Drop file here
AboutIceBuddha is an open-source (MIT license) hex viewer and generic binary file parser that runs in the browser.
See an example.
Why?I wanted to test the limits of what was possible in the browser from a static site. Because all the files are static (no database, and no server-side functionality) IceBuddha is hosted on github pages.
Ridiculous things IceBuddha does
- "Submitted" files are not uploaded anywhere. Everything happens in your browser locally.
If you're concerned, you can clone and host this project locally by running it in a simple web server, such as using "python -m SimpleHTTPServer" in the folder you clone the repo to.
- You can take your python parse scripts, and run them directly on files to generate JSON data, without using your browser, as explained here
Similar projects/products010 editor: Windows & Mac (commercial), odd format for binary templates to parse files, but looks similar to C structs and is often referenced.
Synalize It!: Mac only (commercial); XML based grammar format which means limited capability for more advanced binary file formats.
File parsingIceBuddha can parse a few of the main structures in the following file types:
- PE files (.exe, .dll, .sys)
- GIF image files
- Mach-O (Mac OS X files)
Expanding and adding your own file parsingFile types are automatically identified in drop.js via the function "ChooseParseScript". Look at pe.py to see an example of how files are parsed.
- Change the
PEin the line
ib = icebuddha.IceBuddha(filedata, "PE")to be name of your file type.
- The line
imageDosHeader = ib.parse(0, "IMAGE_DOS_HEADER", """creates a structure at offset
IMAGE_DOS_HEADER. Then the next lines in that file describe what is in that structure.
- Known variable types are:
CHAR, and anything unknown: 1 byte
WORD: 2 bytes
DWORD: 4 bytes
ULONGLONG: 8 bytes
ibis the root object, so we then append
imageDosHeaderto that. Later we append objects to
- The line
e_lfanew = imageDosHeader.getInt("e_lfanew")gets the value of
PE.IMAGE_DOS_HEADER.e_lfanewin the file it parses, and sets the variable
e_lfanewwhich is then used as the offset in the next line.
- Usually you can specify an offset simply by using something like
imageNtHeader.end()to specify the end of the previous object.
- To describe a bit field, you can look at what I did for
- Finally, you just need to return everything with the lines
parser = Parse()
- You can have loops, other functions, and other logic in your code, as shown in gif.py.
- You can also describe what a value means as shown with the function
setMeaningFromConstantsin the file mach_o.py
- You can set the endianness as shown with
setBigEndianin the file mach_o.py
Project statusIceBuddha is mostly abandoned (last update on 2014-11-13). It does a lot of stuff, but a lot of things are impossible for a webapp based on static files (ex. saving files).