Ok, i have an executable that i want to be able to edit the hex values of, but i can't find anything that will read the hex from the file...
I was wondering if it might work if i did a regular BinaryRead
and just converted whatever it read from binary to hex, then edited that and converted it back to binary and do a BinaryWrite. Would that work the same as if i had directly edited the hex
I'm pretty new to this, but im just trying to basically end up with
1. Read the hex of the file.
2. Change it according to what the user enters.
3. Write it back to the file.
thanks a lot!

Read binary, convert to hex
CharissaJB123
When I change the format to hex, the 0's come out as just one 0...
I.E.
should be: 00 2F 00 32 28 00 01 7F 02 7F 04 7F
but instead its: 0 2F 0 32 28 0 1 7F 2 7F 4 7F FF
shouldnt be that hard, thanks again for the help
Mac Jamb
JoshKorn
byte b = readMyNextByte();
Console.WriteLine(b.ToString());
then it will end up showing it to you in decimal form, but that's just because decimal is what the library designers decided would be most common. If you would rather get the hexadecimal representation, use b.ToString("x") instead. As far as I know, there isn't a built-in way to display binary, but it's not hard to do it if you understand what binary is.
The reason why such programs as the one you're writing are usually called hex editors is because, as I said, a byte is always exactly two hexadecimal digits (allowing zeros, of course). You could call it a "decimal editor" and the data would look like 112, 4, 56, 0, 0, 241, 1, 56, 88, 129 instead of A3, 7D, 03, 00, 00, 08, 10, C1 (these aren't equal, as you can tell).
Suthy67
Jarek Błaszczyk
Works great and im good to go!
thanks again!
Ignatius V Ignatius