Reputation: 79
So i couldn't find anything at google, believe in you guys.
I'm converting address from string
which I read using StreamReader
.
Simply need advice how to convert it to actually be able to use readprocessmemory
, I want to read address from .txt file.
Address looks like this: 0x003D6ED4
.
just simple int addr for rpm but can't somehow make it working so far.
PS: no, int.parse
and convert.toint32
doesnt work.
thanks
Upvotes: 2
Views: 661
Reputation: 24903
It seems, you need HexNumber parsing:
var addr = int.Parse("0x003D6ED4".Substring(2), System.Globalization.NumberStyles.HexNumber);
Substring(2)
- to skip 0x
at the begining
Upvotes: 1
Reputation: 147
You can also do int addr = Convert.ToInt32("0x003D6ED4".Substring(2), 16);
Upvotes: 1