Barvier
❔ Converting String to an integer with a Hexadecimal Value
Hello Folks,
I got a process with a prefered imagebase equal to 002E0000.
I would like to store that value assigned to an integer since its a hexadecimal value which can be stored as it.
What is more I would like the value to be have a prefix "0x" so in full format the integer should look like this
I have a following code that gets the value from process and saves it as an integer however here is my issues:
- it does not store it in hexadecimal value
- I need it stored as an hexadecimal integer value with pre-fix "0x"
It prints it out as a INT32 value.
I need to print out hexadecimal value with a prefix "0x"
I tried converting it to string and adding "0x" but after that I cant convert it back to hexadecimal integer that represent exactly what string was showing.
13 replies
reusable constantly updating int from memory (VAMEMORY)
Hello folks!
I am learning C# for few months and I am completely stuck..
I have done a lot of researches about the issue that I am facing but none of them helped so here I am.
What I am trying to do in general?
I am trying to make all the time updated (constantly updating) int by reading from process memory (using VMEMORY).
I would like to use updated int in other part of my code (in different methods, basically in the entire code)
Example:
public static int xxxxxxxxx = 0x2B58DF0; // base_address
public static int zzzzzzzzzz = 0xA8; // pointer
while(true)
{
VAMemory vam = new VAMemory("processname");
int 12345= vam.ReadInt32((IntPtr)xxxxxxxxx);
int 67890 = 12345 + zzzzzzzzzz ; // dont ask me why I read memory using so many integers - it just otherwise will not point to the correct address
REUSABLE_INTEGER = vam.ReadInt32((IntPtr)(67890));
}
Now it will keep updating at all time - how do I reuse the updated value (REUSABLE_INTEGER) in other parts of the code? Other methods etc.42 replies