Once again I started making a hack for a game, last time was what, two years ago? And now I can't remember anything which pisses me off so f***ing much coz I've done this before . But yeah, I'm having problems with getting the right address...
("gta-sa.exe"+007FC7D8 -> 0C38DF88)
007FC7D8 is a static offset to get the base address which I can get player's health etc from, so I just need the "gta-sa.exe" module's base address right?
Main()
Code:
static void Main(string[] args)
{
string game = "gta-sa";
int oHealth = 540;
Memory memory = new Memory(game);
Console.WriteLine(memory.getBaseAddress());
Console.WriteLine((BaseAddress() + 0x7FC7D8).ToString("X"));
IntPtr Base = GetModuleBaseAddress(game, "gta-sa.exe");
Console.WriteLine(Base.ToString("X"));
Console.WriteLine(Base.ToString("X") + " + " + 0x007FC7D8.ToString("X") + " = " + (Base + 0x7FC7D8).ToString("X"));
}
One of the functions to get base address:
Code:
static IntPtr BaseAddress()
{
string game = "gta-sa";
Process[] pList = Process.GetProcesses();
foreach (Process process in pList)
{
if (process.ProcessName == game)
{
Console.WriteLine(process.ProcessName.ToString() + " : " + proces*****.ToString());
//IntPtr hProcess = process.Handle;
Console.WriteLine("Base Address from BaseAddress() : " + process.MainModule.BaseAddress.ToString("X2"));
IntPtr Base = process.MainModule.BaseAddress;
Console.WriteLine("Module name : " + process.MainModule.ModuleName);
return Base;
}
}
return IntPtr.Zero;
}
And the output is:
The three base addresses are all from different sources, one is my own function, one is from one website I copied it from to compare and the last one is from the memory library.
I checked the module's address from CE and:
I'm guessing something is wrong with my converting? But what