Home Download Buy Blog Forum Support

Binary File Reading Plugin

Re: Binary File Reading Plugin

Postby facelessuser on Tue Nov 08, 2011 4:35 am

What's that? Editing in Hex Viewer? You don't say...
Image

You can see edited bytes highlighted with red underlines. Also, clips of the UI elements.

The experimental branch is here if you want to try it out.
I still need to add some knobs in the settings to tweak and do more testing.
facelessuser
 
Posts: 1544
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Tue Nov 08, 2011 5:33 pm

FYI, there was a regression with exporting to a new file; changing the export path when dumping the bin file does not currently work. The export path is not getting updated.

Use caution, with the experimental branch. All things will be in flux until I can get back to the main branch. The experimental branch is just to get feedback on the general UI and such while I am polishing it up.
facelessuser
 
Posts: 1544
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Wed Nov 09, 2011 4:12 am

Didn't have as much to do as I thought. Hex editing is now on the Master Branch. I made sure the exporting to a different file works. I also added a number of confirmation panels to make sure you don't change the view if you have edits. I can't really protect the hex edits if you accidentally close the file. ST2 doesn't really allow you to cancel events like closing etc (I wish it did). If I leave the dirty indicator, it can be confusing to users when they are prompted to save; save does not export the bin file, but simply saves the text representation of it to a file. I might implement a failsafe to export to a temp file if a close is invoked while the hex view is dirty and then alert the user and ask them if they want to keep it or not, but that will be later in the week.

I did add overwrite protection, so if the file exists, it will make you confirm you want to overwrite. The master branch should be safe to use.

At this point, I am just trying to shake out any bugs left before release, that and maybe add the failsafe I talked about earlier.

You may need to restart ST2 if you drop this in while ST2 is running. This is due to dependencies.

Let me know if anyone runs into issues.
facelessuser
 
Posts: 1544
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby mah on Wed Nov 09, 2011 8:45 pm

facelessuser wrote:
3) An ability to add extension-specific representation. For example, if the extension is BMP, rather than just displaying a simple set of words and their ascii, display the BMP structure header and display the body in standard hex format. Perhaps this is well beyond the intention of Hex Viewer.

Can you provide more in depth explanation to BMP structure headers? Is there an hex editor that does this sort of thing that I could view as an example? I would like to take a look into this before I give a yes or a no.
http://www.hexworkshop.com/ is the only editor I've seen that does this. The screenshot they have on the front page sort of shows the feature -- the lower left is displaying the contents of some pre-defined structure. Looking at their screen shots page at http://www.hexworkshop.com/screen_shots.html I see they've done a lot since the last time I eval'd their tool.

Is there a way to bind a key to the "Hex Viewer: Toggle Hex View" command?

Yes, you just use the standard key binding methodology. I will post an example in a bit.

Got it; thanks!
mah
 
Posts: 13
Joined: Mon Aug 29, 2011 3:47 pm

Re: Binary File Reading Plugin

Postby facelessuser on Wed Nov 09, 2011 8:53 pm

Should have a release by this weekend or sooner. I have some protection in now for a hex tab getting closed with unsaved edits. There doesn't seem to be a way to catch the entire window getting closed...so don't close your window unless you are done :) .

I opted to just save the buffer and settings in memory if the tab was closed with unsaved edit. A panel will then be displayed that asks if you would like to restore the tab, if the panel is dismissed or the default "no" is entered, then the saved data will be dismissed. If you type in "yes" to confirm, then the tab will be restored with all your edits. (I may flip the logic on this to restore by default).

I should have these changes up by tonight. After that, I just need to make sure everything is stable and officially release it and then get it in Package Control.
facelessuser
 
Posts: 1544
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Wed Nov 09, 2011 9:01 pm

http://www.hexworkshop.com/ is the only editor I've seen that does this. The screenshot they have on the front page sort of shows the feature -- the lower left is displaying the contents of some pre-defined structure. Looking at their screen shots page at http://www.hexworkshop.com/screen_shots.html I see they've done a lot since the last time I eval'd their tool.

I will consider it possibly for the future. There would be a lot of overhead to do this depending on what kind of structure it is analyzing, so it may not be something that gets done.

If I were to add something like this, I would try and add a general framework that would allow structure maps to be defined and added without having to continually modify the core code for new structures. I will just have to see.

Thanks for the suggestion though.
facelessuser
 
Posts: 1544
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Fri Nov 11, 2011 2:08 am

Made a pull request for Package Control. Tonight or tomorrow, I will create an official forum thread in the plugin section.
facelessuser
 
Posts: 1544
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Fri Nov 11, 2011 7:33 pm

Let's say you have a file (binary or otherwise) and you wanted to get the md5 checksum of it. Well, that is no problem.

Just open open a hex view of the file and execute the checksum command. Also, there is an option to show the checksum on export.

It is also configurable to use md5, sha1, sha224, sha256, sha384, sha512.

This will be in tonights commit

Image
facelessuser
 
Posts: 1544
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Sat Nov 12, 2011 2:54 am

Checksum feature now on Master. Also a highlighting bug fix. I need to open an official thread, but it is Friday and I have spent to much time on the recently.

Oh, HexViewer is on Package Control.
facelessuser
 
Posts: 1544
Joined: Tue Apr 05, 2011 7:38 pm

Previous

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 7 guests