Home Download Buy Blog Forum Support

Binary File Reading Plugin

Re: Binary File Reading Plugin

Postby facelessuser on Thu Nov 03, 2011 10:35 pm

Should have "Find Address" in tonight.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Fri Nov 04, 2011 3:35 am

Screen Shot 2011-11-03 at 9.29.12 PM.png
Screen Shot 2011-11-03 at 9.29.12 PM.png (172.89 KiB) Viewed 2822 times


This was a big update. Bigger than I planned on.

-Better highlighting of bytes
-Configurable highlighting
-Show consecutive address range in status (also indicate additional bytes not consecutive with first group)
-Show total bytes in status
-Don't highlight bytes if selection is out of range of data
-Find address input
-Hide hex settings and find commands when not in hex view
-Fix lint errors and general cleanup

Let me know what you guys think. I will probably add some configurable limits to the highlighting in the future.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby bizoo on Fri Nov 04, 2011 1:26 pm

Just put a pull request on github for my 'need4speed' branch.

Really nice plugin, I don't think there is lot more to do on it without some core implementation in ST2.
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Binary File Reading Plugin

Postby facelessuser on Fri Nov 04, 2011 3:16 pm

Just put a pull request on github for my 'need4speed' branch.

Thanks, this is much needed. I will be running some comparisons of the output, and take a look at the code. From a quick look, it looks nice, I am very pleased with this effort.

Really nice plugin, I don't think there is lot more to do on it without some core implementation in ST2.

As a viewer, I think you are right. There is are still a couple things on my agenda though.
- configurable Endianness
- maybe highlight byte when a value in the ascii column is selected
- general testing before release
- keybindings
- access to settings and keybindings from menu

After these couple of things, I will probably do an official release.

Beyond Viewing
I do have a couple of ideas on how I might implement editing. I will play around with these ideas on the side after an official release. I imagine some indirection during editing will be needed.
I think I might try to implement a shortcut to enable an input panel with the hex content from a line. That way on submission, validity checks can be applied to the edits on that line before writing back to the buffer, and then a new ascii column line can be generated on the fly. I also will need to develop an export command. I will probably have to manage undos or just have a discard edit command.

Large copy and paste blocks might be a bit trickier, but even if the plugin only allows simple edits per line, I think that would be pretty sufficient.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Fri Nov 04, 2011 6:16 pm

Thanks to bizoo, we now have faster binary loading on the master branch. Thanks again.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Sat Nov 05, 2011 1:08 am

Goofing around and added a pop up inspector panel to show info about the word, byte, etc that is selected (only works on single byte selection). It is not on the master branch yet, I need to cleanup a number of things.

The panel can be turned on or off and the endian of the value scan be configured to show it the data how you like.

I copied the naming convention from XVI32 (if you have a better suggestion, let me know). If I figure out the proper way in Python to display IEEE singles and doubles, I will add those as well.
Screenshot - 11_4_2011 , 6_52_52 PM.png
Screenshot - 11_4_2011 , 6_52_52 PM.png (6.96 KiB) Viewed 2777 times
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Sat Nov 05, 2011 7:36 pm

All planned features are in. I finished up the reverse selection of hex bytes when ascii characters are selected. The old hex view panel is removed. Fixed a small issue were the address displayed was 1 byte off.

Also polished up the inspector panel and themed it a little.

Screen Shot 2011-11-05 at 1.33.33 PM.png
Screen Shot 2011-11-05 at 1.33.33 PM.png (50.17 KiB) Viewed 2762 times


I will commit it sometime this weekend, but it is not up on the master branch yet.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Sat Nov 05, 2011 9:57 pm

Hex Viewer plugin is now in testing phase. If you can help identify bugs (if any), it would be very helpful. No new features are currently planned before release. Changes are on the master branch.

Current commit added a lot of stuff.
-Add Hex Inspector panel
-Add Hex Inspector styling
-Adjust format of hex output to allow for better isolation of ascii table; this helps to quickly identify ascii to byte index referencing.
-Adjust hex output styling for new format
-Remove Hex view panel (only toggle to hex view now)
-Adjust defaults settings
-Bug Fix: address view was one byte off
-Add menu items for settings
-Remove debug code

Screen Shot 2011-11-05 at 3.55.47 PM.png
Screen Shot 2011-11-05 at 3.55.47 PM.png (204.09 KiB) Viewed 2763 times
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Mon Nov 07, 2011 3:49 am

The viewer is pretty much done. I got the float and double added to the hex inspector, some bug fixes and general cleanup. I added key bindings etc.

I am going to give it a bit before I add it to package manager. I am trying to get some form of editing going on in an experimental branch. If it isn't going well by the end of the week, I will go ahead and add the viewer to package manager and continue the endeavor in the weeks ahead. If the edit coding is going great, I will try and get it in before the official release. I do have some rough "edit" code in right now, but no "export to bin" code yet. It looks promising though.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Binary File Reading Plugin

Postby facelessuser on Mon Nov 07, 2011 8:52 pm

Played around with the code a little bit on my lunch break today; editing is going to be coming before official release.

Currently on the experimental branch (which is has not been committed yet), I have basic editing.

You can only make changes on one line at a time. You simply select the number of bytes you want to edit and press the edit shortcut key and you can edit the bytes directly. If you want to write an ascii string directly, you would simply give the prompt the string specifier "s:" like so:

Code: Select all
s:this will be written as hex


As long as the hex bytes returned are actual hex and are no greater or lesser in number than what is selected, the buffer will be updated. Edits will be highlighted to show you there are changes. ( I would use the dirty indicator in the tab, except it is misleading; the dirty indicator is really referring to the formatted hex output, and not the actual file it is tied to, and if I enable it, it will keep prompting the user when the tab is closed to save the file. Saving the hex view tab mealy saves the formatted hex output as a file, and then you loose the association with the actual file. I cannot use the save method either, I need to export the data directly. If the Sublime Text API allowed for the canceling of "save" and "save as" on presave, I could directly tap into that and export instead of save giving the experience a more integrated feel, but that is not possible right now.)

After that you can use the export shortcut to write it back to file. I will see if I can come up with an "export as" method as well.

I have already done some basic testing of editing a file and writing the bin. It is looking pretty good. Block pasting will not be allowed, at least not in the first official release.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

PreviousNext

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 2 guests