Page 1 of 1

Ability to copy data as Python bytearray

Posted: 31 Jan 2025 16:12
by radioegor146
Hello.
As a CTFer and reverse engineer myself, I use HxD almost daily.
And as one of the most frequent tasks is to copy data and paste it into some Python script.
I think it will be useful to have this feature.
As an example, copying

Code: Select all

3D 4F AC DF
as Python code will result in

Code: Select all

b"\x3d\x4f\xac\xdf"
Thanks for the editor and all the time and work that you had put into it.

Re: Ability to copy data as Python bytearray

Posted: 31 Mar 2025 18:10
by Maƫl
There is already an option in HxD for returning data as Python code.

Your example would result in:

Code: Select all

rawdata = [
    0x3D, 0x4F, 0xAC, 0xDF
]