I want to convert a file into a byte array so that I can make some edits to it. My program is going to produce a 82 character string, how can I tell my program to open up a file and paste it at, let's say, offset 100?
I have tried the following code:
byte [] data = System.IO.File.ReadAllBytes(filename)
And then:
data[10] = (byte)09;
Now, I'm assuming that this is telling the program to write the byte 09 at offset 10 in the opened file, correct? However, after I do that, there is no 09 @ offset 10 when I look at it in a hex editor. I'm sorry if that's not what it was supposed to do.
I'm trying to open a .pac file. This format may seem unfamiliar to most of you as it is a game file. So, what method could I use that could open any type of file? This is not a text file, I usually edit this using a hex editor.
This is a WinForms application.
I've done a lot of searching, but, because I'm new to coding, I do get confused quite a bit.