Saturday, May 18, 2013

Code: FileStructExaminer

I wrote a program, FileStructExaminer.

It's a hex file viewer, for programmers and other people who look at data files a lot. It's free, open source, and GPL-licensed. And it's the main reason I've taken a year and a half break from this blog. Changing jobs also had an impact. To explain it further I will post the FAQ.

In theory, I should begin updating this blog now, but between a more demanding job and my other hobbies, I'm not sure what I can promise in terms of updates.

Downloads:




FileStructExaminer FAQ:

1. What is this? Who? When? Where?
FileStructExaminer is like a hex editor, except that you can't edit. You can view files.  So it's like a hex viewer.  However, the main point is to see structures within the file. It was written by Omari Christian and finished in early 2013.  Right now it is hosted at dropbox. Go to Omari's Tech Blog (omaritech.blogspot.com) for the current location of the program and its code.

2. Why? How?
This was created for several reasons, mostly for fun and also to exercise my Java programming skills. I wasn't programming in Java much at work when I began the project.  It was also created because the hex editor I was using at the time didn't allow conditional statements (if, else, etc.).  I couldn't find a single free hex editor that supported conditional statements, so I wrote this one.

It was written in Java, using the Netbeans IDE.  Java was used for practice reasons and because it's easy to make a nice GUI.  Java is also pretty portable.

3. How do I use it?
Please see the User Guide.  For help with the struct file language, see Grammar.

4. Why is it so terrible?
Several reasons.  All my reasons for starting this project pretty much were killed off.  I started writing this in 2012, when I wasn't using Java much at work and had a bit of free time to work on it.  I also thought I might use it, since I was working with binary files that had a certain structure to them.  A few months later, I found myself with a new job, writing only Java code, and with very little free time at all.  I was fairly certain I wasn't going to ever use this software.  I pretty much abandoned the project.

However, I had put a lot of work into it, and it was almost at a state where it was usable, so I eventually just decided to scrap a lot of features that I was going to put into it and put only the most basic functionality into FileStructExaminer.  That way, at least it would be released and my effort wouldn't be in vain.  Maybe it would be popular and I'd finish it.

It's sorta rushed for that reason.  There are a lot of features I wanted to put into it, most notably arrays, but also more operators, struct dereferencing, a struct definitions section and more.  Alas, there was no time and I was running low on motivation.

Also, it's the biggest project I've ever worked on outside of work or school and I did it all myself.  I feel proud of what I accomplished, but I acknowledge that it could've been much better.

5. How does it work?
Upon startup it checks the settings.ini (if it exists) file for a structure file.  If it doesn't exist, it is done starting up until the user provides a structure file.  When the user provides a structure file, the file is first lexed into a text file that's easier to read (spacing added, comments removed).  The file is then parsed into a list of items (vars, conditionals, structs, ints, chars and other datatypes).  Any errors in the structure file are shown to the user in the main window.  If the structure file is error-free, the user gives the program a binary file.  The binary file is then parsed.  Every structure file item in the list is assigned a value based on the data in the binary file.  If a condition in a if-conditional is true, the items in that if-block are parsed.  If not, they are ignored.

Assuming there are no errors parsing the binary file, the structure and data of the binary file are displayed in the main window.

6. Future plans?
I had planned to release this as a first version and add features as people requested them; now I have no plans to do so.  I don't have the time or inclination to work on this project anymore.  That's why I'm releasing the code.  If people see potential in this, perhaps they can continue the project.

7. I found a bug.
Then download the code and fix it?

No comments:

Post a Comment