@KingX735
I'll cp what I got in c# then below I'll link an online converter (don't blame me if the conversion fucks up )
First since iw6mp_ship.exe is a static address you can calculate the address + offset manually then add the new address (but if the base address changes you have to use this)
in my memory class:
c#:
Code:
private IntPtr Handle;
private string attached_proc = string.Empty;
private int proc_id;
public Memory(string a_process)
{
attached_proc = a_process;
Process process = Process.GetProcessesByName(a_process)[0];
Handle = OpenProcess(0x1f0fff, false, (uint) proces*****);
proc_id = proces*****;
}
public uint baseaddress(string proc_module)
{
uint num = 0;
foreach (ProcessModule module in Process.GetProcessesByName(attached_proc)[0].Modules)
{
if (module.ModuleName == proc_module)
{
num = uint.Parse(module.BaseAddress.ToString());
}
}
return num;
}
then the pointer reading function
Code:
[DllImport("kernel32.dll", SetLastError=true)]
private static extern bool CloseHandle(IntPtr hObject);
public static IntPtr MemoryOpen(uint ProcessID)
{
return OpenProcess(0x998fff, false, ProcessID);
}
[DllImport("kernel32.dll")]
private static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
public int ReadOffset(uint pointer)
private static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, UIntPtr nSize, uint lpNumberOfBytesWritten);
public int ReadPointer(uint pointer)
{
byte[] lpBuffer = new byte[0x18];
ReadProcessMemory(this.Handle, (IntPtr) pointer, lpBuffer, (UIntPtr) 4, 0);
return BitConverter.ToInt32(lpBuffer, 0);
}
then you can do (random example)
Code:
uint base_address = mem.baseaddress("iw6mp_ship.exe"); //mem. is obvioulsy referring to the mem class Memory mem = new Memory("iw6mp_ship");
uint address = (uint)mem.ReadPointer(base_address) + 0x43C;
address = (uint)mem.ReadPointer(address) + 0x0;
address = (uint)mem.ReadPointer(address) + 0x234;
address = (uint)mem.ReadPointer(address) + 0x8;
address = (uint)mem.ReadPointer(address) + 0x2F4;
use the online converter here:
Convert C# to VB.NET - A free code conversion tool - developer Fusion