Home Download Buy Blog Forum Support

Hex Viewer (a hex viewer and editor)

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Mon Nov 21, 2011 7:59 am

Got whirlpool hash working with chunking. I got the python port of the hash from this one site, and it looked pretty exact with the C source. The guy who did the python port I guess assumed that the adding to the hash function worked the same as update in hashlib, so he wrapped similar, but this just wasn't the case. With a little analyzation, I was able to adapt the algorithm to mimic hashlib's update and allow for proper hashing of chunked data. Now the hash comes out correct whether chunked or not.

It works pretty good checksumming the average source code files, but if you try this on a 3MB file, it will take a bit because it is straight Python, and the algorithm is fairly complex. Because of this, I went ahead and added checksum threading. So if you are checksumming a really large file, you will see the progress in the status bar. If you want to cancel, just run the checksum command again, and the current thread will be canceled.

I am only adding these hashes because I am finding it fun figuring these out. I may allow in the future to tap in to these functions to generate hashes from selected strings etc, which is useful if you need to generate hashes in your source code. Maybe I will split out the hash code into its own plugin; we will see.

I will probably commit the whirlpool hash along with the checksum threading tomorrow.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Tue Nov 22, 2011 6:01 am

I was going to port it myself, but someone already ported Tiger192 hash algorithm. Again, it wasn't allowing chunking, but I added that in and wrapped it like hashlib. So, I have now postponed the commit till tomorrow. I will commit both whirlpool and tiger192 hash for checksumming, and I think I am done playing with hashes for now.

I may add in some kind of command that will allow you to enter a string and return your desired hash. It isn't really directly related to hex editing, but since I spend this time adding in all of these hashes, might as well give access to them.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Wed Nov 23, 2011 1:23 am

#Version 0.8
- New hash algorithms: Whirlpool and Tiger-192
- Checksums are now threaded
- Exposed new command to tap into hashes called "Hex Viewer: Generate Hash"
- Rework logic to determine which hashes are available

So the new hashes are added, and I added a new command to generate a hash from a string at any time you need. You do not have to be in hex view to do this; as a matter fact, it really has nothing to do with the hex viewer, I am just tapping into the hash framework I put in because I think it might be useful to some.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Wed Nov 23, 2011 7:40 am

Missed some commas in windows and linux keymaps...I guess you can tell I have been testing in Mac recently :oops: .
Apparently, it was reported to me this small mistake, prevented ST2 from starting in Windows. It kind of surprises me that this kind of error could take down the entire editor in windows, but I shouldn't have missed those commas either.

This should be resolved now.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Sat Nov 26, 2011 10:52 pm

Now that I am done goofing off with hashes, I added a useful feature.

I just added auto opening of specified binary files in Hex Viewer. If you directly open a file, select in the side bar, or select it via "Go To Anything", it will open your will open files defined by patterns in the setting file automatically in Hex Viewer.

Direct opening should open without delay, but I have defined a 2 second delay for previews of binary files; this prevents opening a Hex View tab if you are just passing a binary file in "Go To Anything". If the first "Go To Anything" selection is a binary file, if you linger for more than two seconds, a Hex View tab will be opened (you can increase this delay via the settings file). After you start moving around in the "Go To Anything" menu, you know longer have to worry about lingering.

Currently it is disabled by default. I am going to wait and do more testing before I enable it by default, but feel free to try it out.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Sat Nov 26, 2011 11:07 pm

I may have spoken prematurely. I think I have the logic worked out now. I removed the delay. You should be able work as normal without fear of accidentally triggering Hex View. Previews should now function as they always have, and when the file is actually opened, Hex View Auto Open will kick in. Try it out and let me know what you think. Just enable it in the settings file, and define your file patterns.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Thu Feb 02, 2012 12:36 am

Version 1.5
- Allow the hashing of current selection(s). Multiselect regions's content will be combined and evaluated together
- Update hash progress quicker
- Chunk hashes entered in the input panel in case very large amounts of data are pasted in

Decided to add the ability to select text, and hash it. It handles multi-regions too. It just adds the regions together in the order they come in the file and hashes them as one entry.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Wed Feb 08, 2012 4:52 am

Version 1.6
- Report Tiger-192 as big endian as most hashing programs do

Was always a little curious why tiger hash seemed to give me valid results, but differed from every hash program I have compared it to. The endian convention I was using was different from what everyone else used...go figure. The hash was still completely valid, and matched the tiger hash web site results, but every hash tool in the world uses the other convention. Well, now I match them as well to avoid confusion. :)
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby facelessuser on Fri Mar 16, 2012 12:56 am

Version 1.7
- More responsive highlighting
- Turn off gutter icons for highlighting by default (does not seen needed)
- Convert tabs to spaces in settings file

Pulling in the more responsive highlighting from BracketHighlighter.
facelessuser
 
Posts: 1575
Joined: Tue Apr 05, 2011 7:38 pm

Re: Hex Viewer (a hex viewer and editor)

Postby Callidus on Tue Aug 21, 2012 3:31 pm

Would it be possible to have the hex editor open AND be positioned to where the cursor or selection currently is? E.g. Say I put the cursor at the end of a line, then open the Hex Viewer, it should open to that same spot at the end of the line (so that I can view 0d 0a).

Currently it always opens with the cursor at the start of the file.
Callidus
 
Posts: 3
Joined: Tue Aug 21, 2012 3:00 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Exabot [Bot], ionutvmi, Yahoo [Bot] and 11 guests