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?

Recommended Answers

All 4 Replies

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 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.