THIS SHOULD BE EASY! But i’ve been unable to find the answer to this question.
Using python, I want to read a binary file into memory, modify the first four bytes of the file, and then write the file back.
There has to be a simple way to edit four measly bytes! right?
Why read the entire file to change four bytes at the beginning? Shouldn’t this work?
Even if you need to read these bytes from the file to calculate the new values, you could still do: