Soo, if i understand your problem right, you try to output a value of an adress in a textbox ?
I remember that there is a C# function int32.tostring or something like this. Not sure if thats the answer you´re looking for....
cheers =)
Hey guys,
im starting to freak out about this problem. All i want is to write a simple c# program that lets you enter a memory address in a textbox and then displays it value. But the problem is that the address has to be an Integer, but i just can't convert a string from a textbox like 1DBD448 (or 0x1DBD448) to an Integer using int.Parse or Convert.ToInt32, that just gives me an error.
Any idea on how to do this?
Many thanks in advance!
Sorcer
This is why I hate C#...so damn complicated....
Code:printf("Value @ 0xFFEFFE00 is %i", *(int*)0xFFEFFE00);
No, I just want to create a program where i can enter an address in a textfield and then it gives me the value of that address. It is nearly completed, but all I need is a working method to convert the string to an integer. As i already said, int.Parse and Convert.ToInt32 don't work because the address contains letters...
Skinksteek (11-16-2012)
Made by @Jorndel
[IMG]https://www.danasof*****m/sig/Trololol132237.jpg[/IMG]
Leecher: 0 [√]
Choob: 25 [√]
Newbie: 50 [√]
Member: 100 [√]
Advanced Member: 150 [√]
Dual-Keyboard Member: 250 [√]
Expert Member: 500 [√]
Bobo's Trainer: 750 [X]
MPGH Expert: 1000 [X]
Synthetic Hacker: 1250 [X]
Blackhat Hacker: 1500 [X]
Whitehat Hacker: 2000 [X]
Bobo's Guardian: 2500 [X]
Upcoming MPGHiean: 3000 [X]
MPGH Addict: 3500 [X]
MPGHiean: 4000 [X]
MPGH Knight: 4500 [X]
MPGH Lord: 5000 [X]
MPGH Champion: 5500 [X]
MPGH King: 6000 [X]"Wish me a good luck."
You could try this and see if it works:
Code:string S = "1384" int Value = *(int*)&S;
Nope, gives me two errors. Other ideas?
Im translating them now because im using a non-english interface:
1. It's not possible to declare a cursor for the executed type ("string") or to fetch its address or size.
2. Cursor and Buffer with fixed size can only be used in a unsafe context.
I think the "&S" in your code should be only "S", and if I change that, the first errors disappers, but instead I get:
Converting from "string" to "int*" is not possible.
Any ideas?
Last edited by x2Sorcer; 11-16-2012 at 02:25 PM.
Well I know in c++ you could do thisWorks perfectly)
And the output is:Code:std::string MyString = "1945"; printf("Value of MyString to Integer-> %d \n", atoi(MyString.c_str()); getchar();
Try DllImport with the atoi function.Code:Value of MyString to Integer-> 1945
Also post the part that's giving errors for you. int.Parse() is supposed to work... Have you tried BitConverter.GetBytes()?
Last edited by Kenshin13; 11-16-2012 at 02:32 PM.
Why should GetBytes help here? It just converts booleans to the Bytes, doesn't it?
The part that gives errors is this line: int Value = *(int*)&S;.
And can you explain the atoi-thingy? Never used that before...
Thanks
atoi converts a string to an integer, just like atol converts it to a long value.
And the GetBytes will read the string and convert it to bytes...Booleans only have 1 or 0 so what you said didn't make sense...
You can convert an integer in a string to bytes then the bytes back to an integer if the int.Parse never worked.
Google is so good.
And even more when you know what you are to do
Code:int MyHex = int.Parse("012ABC", System.Globalization.NumberStyles.HexNumber);
Kenshin13 (11-16-2012)
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