As the thread states, I'm curious as to how I could come across this. I can open the file with an OpenFileDialog, or edit it while it's in process, but not open it, edit a memory address, then resave it. Mainly because I have no idea what it'd be called to do such a thing.

So that's my question, how can I open a file, edit an offset, and resave it?

6 Years
Discussion Span
Last Post by Silent-Regret
byte[] myData = File.ReadAllBytes("Some.exe");
myData[2342] = 0x00;
File.WriteAllBytes("Some.exe", myData);

Cool, thank you. That gives me a bit of insight on where to start!

Could you explain to me what [2342] means? (I actually started C# 4-5 days ago, but I've previously coded PHP, so I'm guessing it's an array of some sort?)

If it helps any, there are two addresses. 5AF74 for Hex, and 0045af71 for Olly/Memory


[2342] means "in the list of bytes, I want you to change the 2342 one (if we start counting from zero"). 2342 is just a number I made up :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.