I'm making an application which edits specific memory addresses of a process chosen by the user. I've to convert a string for example "0x7ffe0030,0x7ffe6000" to a list of strings and for every string in the list I've to paste the plain text of the string as int for example: if the string is "0x7ffe0030", the int must be 0x7ffe0030.
I've trivially tried to do that:
foreach (var address in addressListRaw)
{
int a = Int32.Parse(address);
}
but it obviously doesn't work.
Console.WriteLine("Select the memory addresses to modify.\n" +
"You can write more than one address separating\n" +
"every address using the character ','\n" +
"example: 0x7ffe0030,0x7ffe6000");
string addressesRaw = Console.ReadLine();
List<string> addressListRaw;
addressListRaw = addressesRaw.Split(',').ToList();
foreach (var address in addressListRaw)
{
int a = Int32.Parse(address);
Console.WriteLine(a.ToString());
}