Converting a String containing a Memory Address to Integer
Posts 16–20 of 20 · Page 2 of 2
Originally Posted by x2Sorcer
Oh thank you so much. Was trying to solve that problem the whole day and even googled for over an hour but couldn't find something helpful
---------- Post added at 12:44 AM ---------- Previous post was at 12:25 AM ----------
Edit: This works perfect for reading values from MW3, but I don't get it how to do it with bytes. I'm using your memory class at the moment so i can care about the other things, so you might could help me
For Integer the code is, of course: Convert.ToString(ReadInteger(address));
Now I want to read a bytelist using Convert.ToString(ReadBytes(addresse, bytelength)); - but that just gives me "System.Byte[]", doesnt matter which bytelength i enter - any idea why or how to fix it?
Thanks
Erm, the class got a read string and the length to read but...
For the Hex value as String, use: (????).ToString("X"); (The X means we are using hex value / byte make it a lower case x for small letters)
PS:
BitConverter is more used to work with bytes
But can you explain why it returns System.Byte[] ?
Originally Posted by Kenshin13
But can you explain why it returns System.Byte[] ?
That is because the Convert.ToString only converts an none-array value.
So that's why it returns that the "converted value" is a: System.Byte[] (Since that is the "definition" of an array of bytes )
---------- Post added at 03:09 AM ---------- Previous post was at 03:08 AM ----------
While the ASCII is an encoding for bytes. (Wrong but, the main point here...)
(255 chars)
So that is why it can handle the byte[] input value and convert it to a string.
C# makes me wanna kill myself sometimes....Thank God the ESP's done so I don't have to touch it for a while...
So what else can you use for a string byte conversion? Just that?
Originally Posted by Kenshin13
C# makes me wanna kill myself sometimes....Thank God the ESP's done so I don't have to touch it for a while...
So what else can you use for a string byte conversion? Just that?
Many "ways" I suppose, but I haven't looked after those.
(I don't have the need :P)