E
E
Elvis2020-08-16 19:56:10
Python
Elvis, 2020-08-16 19:56:10

How to change the hex data of a file?

Hey!
There is a file, in the hex editor I can change the bytes I need at a certain address. How to do it in python?
For example, my input address is "235EDF", you need to change the value from "2E" to "43".
I want to write a patch for the program. I know what to change to, but I can't figure out how. let me read something on this topic.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-08-16
@bacon

Open the file in binary mode and write your bytes there, hex is just their representation in hexadecimal form.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question