Use Notepad++ as HEX-Editor
Asked Answered
I

2

55

I'm using Notepad++, version 7.8.5 64bit on Windows 10. I'd like to use it as a Hex Editor.

I open a binfile, but Notepad shows it to me as a text with strange characters. In order to visualize the Hex-numbers, I select a part of the text, go and click on the voice

Plugins/Converter/ASCII-->HEX 

and it shows me the hex-numbers of the selected part. Now I'd like to see the whole file in hex, but it doesn't work. It seems that selecting some parts it works, other parts it doesn't.

I need to convert or visualize the whole file in HEX.

I have also tried:

Plugins/Plugins Admin…

but the HEX-Editor isn't there.

Thanks 4 help

Invective answered 11/3, 2020 at 17:7 Comment(1)
As I mentioned in my answer, the converter is to be used mainly for text files or text parts (ASCII -> HEX).Tensor
T
84

Edit:

Please note - the installation has been adapted for 64 bit in the meantime.

  • Please update to e.g. Notepad++ 8.4.7 (64-bit) from the download section
  • Go to the menu Plugins > Plugins Admin
  • Enter Hex in the search field.
  • Select Hex-Editor and press ìnstall.

It seems to me you tried to install a hex editor and ended up in the wrong tool (Plug-In) Converter (ASCII -> HEX) as mentioned in your question above.

The installation process of the HexEditor is somewhat confusing because it is currently available only in the Plugins Admin for the 32-bit version.

A simple solution is to install a Notepad++ x32 version on a USB stick (e.g. using PortableApps).

But, and thanks to Peter Jones, here is a download link to the x64 version. and explanation to actually perform the manual install:

  • unzip the appropriate downloaded zipfile and open that containing folder (or have the zipfile open in windows explorer)
  • In Notepad++, use Plugins > Open Plugins Folder.
  • In the newly-opened plugins folder, add a subfolder HexEditor.
  • Copy the HexEditor.dll from the zipfile into the HexEditor subfolder… so it should be at ...\notepad++\plugins\HexEditor\HexEditor.dll
  • Close all open windows of Notepad++.
  • Restart Notepad++ again.
  • HexEditor should be available in the Plugins menu, and HexEditor.dll should be listed in the ? > Debug Info plugins list.

Successfully tested by Notepad++ Version 7.8.5 64bit on Windows 10. For further information see the links above. Please note a UAC problem, i.e. run Notepad++ as Administrator.

Tensor answered 17/3, 2020 at 18:0 Comment(5)
@UK Thank You. Until "Copy the Hexeditor.dll..." I have understood. But I'd like to know which "copies of Notepad++" are You talking about. Do You mean to close Notepad++ and to restart it, after copiing the HexEditor.dll at the wright place? The rest seems to me quite clear.Invective
@Invective - yes, close all open windows of Notepad++ was meant.Tensor
Now I just need to go on "Plugins > HEXEditor and flag "View in Hex". For returning to the textmode I just have to deflag it.Invective
@Invective There should be an icon in the function bar. It toggles between Hex and Ascii modesDissidence
Just as a follow-up, the current version of Notepad++ at the time of writing (v8.3.3, 64-bit), worked perfectly well for me just to going to the Plugins Admin window and installing the HEX-Editor plugin through the UI as normal.Imperfection
K
3

Answer from help-info.de is working.

However it is not that great if you are in a context where you need to copy paste the result of the hex output provided by the plugin.


For example let's say the following bytes are displayed by the NPP_HexEdit window:

00 06 12 0b

If you select from left to right, copy then paste (in a new text file), you will get:

20 06 12 0b

For some reason, '0x00' are converted into UTF-8 '20' and since '0x20' are also converted into UTF-8 '20' you can't really use the copy + paste feature here.

If you select from right to left, copy then paste (in a new text file), you will get:

12 01 0e 0d

I will not even try to convert this one, clearly unusable....


Solution (Windows)

  • From Plugins > Plugins Admin select and install NppExec, restart npp.

  • Select Plugins > NppExec > Npp Execute... and enter the following:

     SET local OUTFILE = "$(FULL_CURRENT_PATH).hex.txt"
     cmd /c <XXD_DIRECTORY>\xxd.exe -p $(FULL_CURRENT_PATH) >$(OUTFILE)
     NPP_OPEN $(OUTFILE)
    
  • From the same window save your script, for example bin_to_hex.

  • From Plugins > NppExec > Advanced Options select your script from Associated script: and add it with Add/Modify then press Ok and restart npp.

  • In npp, open your bin file.

  • Select Plugins > NppExec > bin_to_hex and you are done!, should get your bin as HEX in a new tab.

xxd.exe can be recovered from multiple location such as:

  • C:\Program Files (x86)\Vim\vim74
  • (I used this on my side, from Cmder) C:\Cmder\vendor\git-for-windows\usr\bin

Edited Instead of using xxd.exe, you can use the following powershell approach (better format but longer to execute). Replace the script with:

    SET local OUTFILE = "$(FULL_CURRENT_PATH).hex.txt"
    cmd /c powershell -command "format-hex $(FULL_CURRENT_PATH) > $(OUTFILE);exit"
    NPP_OPEN $(OUTFILE)
Kalat answered 4/2, 2021 at 19:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.