Barvier
Barvier
CC#
Created by Barvier on 3/8/2023 in #help
❔ Converting String to an integer with a Hexadecimal Value
Since a lot of these answers where posted back in 2015 the languaged developed and I guess we dont have to use such a complicated method anymore.
C#

// GETTING THE BASE ADDRESS OF A PROCESS
Process process = Process.GetProcessesByName(testprocess)[0];
ProcessModule mainModule = process.MainModule;
string hexBaseAddress = mainModule.BaseAddress.ToString("X");
int baseAddress = int.Parse(hexBaseAddress, System.Globalization.NumberStyles.HexNumber);
Console.WriteLine(hexBaseAddress);
Console.WriteLine(baseAddress);
C#

// GETTING THE BASE ADDRESS OF A PROCESS
Process process = Process.GetProcessesByName(testprocess)[0];
ProcessModule mainModule = process.MainModule;
string hexBaseAddress = mainModule.BaseAddress.ToString("X");
int baseAddress = int.Parse(hexBaseAddress, System.Globalization.NumberStyles.HexNumber);
Console.WriteLine(hexBaseAddress);
Console.WriteLine(baseAddress);
First print, prints out correctly - still without prefix but its not a big issue. I can solve it later. Second print, after conversion to int it prints out still INT32 number.
13 replies
CC#
Created by Barvier on 3/8/2023 in #help
❔ Converting String to an integer with a Hexadecimal Value
Checking it out.
13 replies
CC#
Created by Barvier on 3/8/2023 in #help
❔ Converting String to an integer with a Hexadecimal Value
for an example
C#

public static int BaseAddress = 0x2B58DF0;
C#

public static int BaseAddress = 0x2B58DF0;
13 replies
CC#
Created by Barvier on 3/8/2023 in #help
❔ Converting String to an integer with a Hexadecimal Value
its converting string to hex-string. I need hex-int.
13 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
Perfect, thank you!
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
Now I need to make a bool since I cant convert int into bool using while conditions.
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
❤️
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
Perfect! I have created two threads for each of the functions.
C#

using System;
using System.Diagnostics.Eventing.Reader;
using System.Runtime.InteropServices;
using System.Threading;
using System.Timers;

class NewClass
{
public static int REUSABLE_INTEGER;
public static int XXXXXX = 0x2B58DF0;
public static int YYYYYY = 0x4C;

public static void Main(string[] args)
{
Thread t1 = new Thread(Loop1);
t1.Start();
Thread t2 = new Thread(Loop2);
t2.Start();
}

public static void Loop1()
{
VAMemory vam = new VAMemory("process");
while (true)
{
int LocalAddress = vam.ReadInt32((IntPtr)XXXXXX);
int LocalAddressCheck = vam.ReadInt32((IntPtr)(LocalAddress + YYYYYY));
int REUSABLE_INTEGER = LocalAddressCheck;
}
}

public static void Loop2()
{
while (true)
{
Console.WriteLine(REUSABLE_INTEGER);
}
}
}
C#

using System;
using System.Diagnostics.Eventing.Reader;
using System.Runtime.InteropServices;
using System.Threading;
using System.Timers;

class NewClass
{
public static int REUSABLE_INTEGER;
public static int XXXXXX = 0x2B58DF0;
public static int YYYYYY = 0x4C;

public static void Main(string[] args)
{
Thread t1 = new Thread(Loop1);
t1.Start();
Thread t2 = new Thread(Loop2);
t2.Start();
}

public static void Loop1()
{
VAMemory vam = new VAMemory("process");
while (true)
{
int LocalAddress = vam.ReadInt32((IntPtr)XXXXXX);
int LocalAddressCheck = vam.ReadInt32((IntPtr)(LocalAddress + YYYYYY));
int REUSABLE_INTEGER = LocalAddressCheck;
}
}

public static void Loop2()
{
while (true)
{
Console.WriteLine(REUSABLE_INTEGER);
}
}
}
it prints 0 0 0 0 0 0 0 0 0 0 and its not updating the integer which should be already changed to 1 1 1 1 1 1 as I see it in other program. Unnecessary assignment of a value to 'REUSABLE_INTEGER' at level: int REUSABLE_INTEGER = LocalAddressCheck; so its not writing to the public int
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
I need one of these loops to be running at all time while other will be running a code repeatedly. Is there any way to work this around?
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
LMAO
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
C#

using System;
using System.Diagnostics.Eventing.Reader;
using System.Runtime.InteropServices;
using System.Threading;
using System.Timers;

class NewClass
{
public static int REUSABLE_INTEGER;
public static int XXXXXX = 0x2B58DF0;
public static int YYYYYY = 0x4C;

public static void Main(string[] args)
{
VAMemory vam = new VAMemory("process");
while (true)
{
int LocalAddress = vam.ReadInt32((IntPtr)XXXXXX);
int LocalAddressCheck = vam.ReadInt32((IntPtr)(LocalAddress + YYYYYY));
int REUSABLE_INTEGER = LocalAddressCheck;
Console.WriteLine(REUSABLE_INTEGER);
}

while (true)
{
Console.WriteLine(REUSABLE_INTEGER);

}


}

}
C#

using System;
using System.Diagnostics.Eventing.Reader;
using System.Runtime.InteropServices;
using System.Threading;
using System.Timers;

class NewClass
{
public static int REUSABLE_INTEGER;
public static int XXXXXX = 0x2B58DF0;
public static int YYYYYY = 0x4C;

public static void Main(string[] args)
{
VAMemory vam = new VAMemory("process");
while (true)
{
int LocalAddress = vam.ReadInt32((IntPtr)XXXXXX);
int LocalAddressCheck = vam.ReadInt32((IntPtr)(LocalAddress + YYYYYY));
int REUSABLE_INTEGER = LocalAddressCheck;
Console.WriteLine(REUSABLE_INTEGER);
}

while (true)
{
Console.WriteLine(REUSABLE_INTEGER);

}


}

}
it still says at line 24 (new while loop) unreachable code detected.
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
or maybe the issue is different
C#

using System;
using System.Diagnostics.Eventing.Reader;
using System.Runtime.InteropServices;
using System.Threading;
using System.Timers;

class NewClass
{
public static int REUSABLE_INTEGER;
public static int XXXXXX = 0x2B58DF0;
public static int YYYYYY = 0x4C;

void Main(string[] args)
{
VAMemory vam = new VAMemory("process");
while (true)
{
int LocalAddress = vam.ReadInt32((IntPtr)XXXXXX);
int LocalAddressCheck = vam.ReadInt32((IntPtr)(LocalAddress + YYYYYY));
int REUSABLE_INTEGER = LocalAddressCheck;
Console.WriteLine(REUSABLE_INTEGER);
}

while (true)
{


}


}

}
C#

using System;
using System.Diagnostics.Eventing.Reader;
using System.Runtime.InteropServices;
using System.Threading;
using System.Timers;

class NewClass
{
public static int REUSABLE_INTEGER;
public static int XXXXXX = 0x2B58DF0;
public static int YYYYYY = 0x4C;

void Main(string[] args)
{
VAMemory vam = new VAMemory("process");
while (true)
{
int LocalAddress = vam.ReadInt32((IntPtr)XXXXXX);
int LocalAddressCheck = vam.ReadInt32((IntPtr)(LocalAddress + YYYYYY));
int REUSABLE_INTEGER = LocalAddressCheck;
Console.WriteLine(REUSABLE_INTEGER);
}

while (true)
{


}


}

}
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
I have the results! I can use this inside the while loop, but I can't use it as a condition for another loop and this is what I am trying to do.
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
Alright, let me test it out again.
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
if I make public static int = REUSABLE_INTEGER; ((loop that gives a REUSABLE_INTEGER a new value for an example 1)) ((loop that reads value of REUSABLE INTEGER) it will still read 0 from the public int definied earlier instead of a value that got updated in previous loop
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
As you can see in the code that I posted I try to use another new loop while (REUSABLE_INTEGER = 0) and it says that this integer is not reachable cause its in other method / loop.
42 replies
CC#
Created by Barvier on 3/8/2023 in #help
reusable constantly updating int from memory (VAMEMORY)
To me it sounds like a pretty basic stuff that I cannot solve as a beginner.
42 replies