Binary file hex viewer
About Hex Viewer is a plugin for Sublime Text 2 that allows the toggling of a file into a hex viewing mode. Hex Viewer also supports hex editing. Download is available in Package Control or you can download directly and drop into your Sublime Text 2 packages directory plugin folder must be named HexViewer. Hex inspector to view current selected bytes as different unit types endianness is configurable. Display total selected number of bytes and addresses of first group of consecutive bytes in status bar.
Source Code and More Documentation github. 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.
Whirlpool and Tiger - Checksums are now threaded - Exposed new binary file hex viewer to tap into hashes called "Hex Viewer: Generate Hash" - Rework logic to determine which hashes are available. If you would like to have upper or lower nibble stand out, you can add this to your theme file and configure the nibbles' color to binary file hex viewer each other. I am purposely not scoping this by default because certain themes might not have good contrast colors for binary file hex viewer I scope them as.
This way, you can add it if you want it and have complete control to make sure they stand out how you like them.
FYI, there is a small issue with checksumming from Hex Viewer. I already have a fix that I will commit tonight. This is easily binary file hex viewer by postponing the conversion of the file data content to hex until right before checksum is ran. I am in optimization mode now. If you have noticed the speed of checksumming to be abysmal on very large files, don't worry, I have noticed as well. I was able to improve the checksum speed by orders of magnitude on large files and probably exporting as well.
I am cutting down anywhere we are applying code to extremely large buffers. This will allow python not to bog down trying to manage such large buffers. So in the next little bit, I will try to optimize all big processes or at least attempt to further optimize. Loading is pretty good right now, I will see if I can push it a bit more. Checksumming and exporting should be much better. I will do some tests on restoring a tab speeds on large files, and also see if I can throttle highlighting on large selections.
Whether it happens before next commit or not, I will also be threading heavy hitting processes, and hopefully provide a cancel option in case you were silly enough to try and edit a MB binary file. I just need to get some more real world testing in.
I am only threading the reading of the binary file currently, so the binary file hex viewer still hangs on large files when loading the formatted hex data into the view buffer I am using the replace API command which is the process that takes the longest.
I will probably thread this portion as well when I am sure I am accounting properly for binary file hex viewer things that could happen when this is handed off to the thread. I may even break up the loading of the data into the view buffer by binary file hex viewer the data and using the insert API command instead. This might add a little overhead to the loading, binary file hex viewer it would allow for a load to be canceled during the buffer load process as well, and also allow for some visual indication of how far along the buffer writing is.
I have throttled the highlighting of selected bytes, mainly because highlighting them requires me to parse each selection and then binary file hex viewer it in the ASCII table time consuming. You will notice that the byte count and displayed addresses in the status bar are tied to the bytes processed and highlighted, binary file hex viewer the range of selected bytes and byte count will only represent currently selected bytes. In the next commit, I will probably just display the first address and not display the byte count until I come up with a quicker way to count the bytes independent of byte highliting if the byte highlight threshold has been reached.
I am currently not threading writing the binary file and check-summing the binary file these are very quick compared to loading the binary file, but the time they take to finish is linearly proportional to the size of the file. I may thread these in the future when I finish addressing the loading of the file threading. A couple of notes: I tried to thread the loading of the content to the buffer, but that is not reasonably possible.
Edits to the view buffer must be on the main thread. So basically, the parsing of the bin file is threaded allowing you to cancel during that time, but as soon as the content is being written to the buffer, you binary file hex viewer have to wait. I also have decided binary file hex viewer threading any other processes. The bin file loading is by binary file hex viewer the weightiest process, and I have done about all I can there. Checksumming and bin file exporting is much much faster than loading.
If you can wait for the file to load, checksumming and export will be no problem. A couple of frivolous things made it in: I also added another setting to turn off highlight throttling; it is now off by default.
Though, while it will pause to highlight the bytes, the locking up is actually caused by multi-select. I turned off my plugin and tried to do a large multi-select in a normal code file, and the whole editor froze up and never gave me back control, so it is not the plugin. So if you are doing large multi-select blocks, you can enable throttling if you choose, but by default I have it disabled I don't really do large multi-select blocks often, I mainly do large single selection blocks which are no problem at all; moderate multi-select blocks are also fine.
Somewhere along the lines I broke checksums responding to the settings file for the binary file hex viewer this is now fixed. Also, I added some obvious checksumming algorithms that were not there before: That should be all of the major things I wanted to get done. Let me know if any bugs turn up or you have any feature ideas. I already had the ones from hashlib, and zlib, but I pulled in binary file hex viewer ones that are included with openssl.
These may differ binary file hex viewer some systems, so I currently check if they are available and only include them if they are. If I find some other ones that are available that I am not including, I will add those. Binary file hex viewer was so close to getting whirlpool algorithm in here. The algorithm is public domain, and I had it working, but I could not get it binary file hex viewer yet when the data is chunked; the hash comes out wrong.
Due to this, I have not included it. If I can deconstruct the algorithm enough to figure out how the get chunked data to evaluate the same, I will include it later. Since the current supported hashes could vary on certain systems, when the checksum command or shortcut is invoked, I will now show a quickpanel populated with the valid hashes that can be used for selection. 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 binary file hex viewer going to port it myself, but someone already ported Tiger 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 binary file hex viewer commit both whirlpool and tiger hash for checksumming, and I think I am done playing with hashes for now. I may add in some kind of command that will binary file hex viewer 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 binary file hex viewer of these hashes, might as well give access to them. 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.
Missed some commas in binary file hex viewer and linux keymaps I guess you can tell I have been testing in Mac recently. 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. 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 binary file hex viewer binary files; this prevents opening a Hex View tab if you are just passing a binary file in "Go Binary file hex viewer Anything". If the first "Go To Binary file hex viewer 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. 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 binary file hex viewer in. Try it out and let me know what you think.
Just enable it in the settings file, and define your file patterns. Decided to add binary file hex viewer ability to select text, and hash it.