Hey guy´s, :wave:
I have a problem too read a float adress in C# in the game Runes of Magic.
Normaly I read memory in linke this:
Code:
[DllImport("kernel32.dll")]
static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, Boolean bInheritHandle, UInt32 dwProcessId);
[DllImport("kernel32.dll")]
static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress,
byte[] lpBuffer, UIntPtr nSize, ref uint lpNumberOfBytesWritten);
private void timer1_Tick(object sender, EventArgs e)
{
Process[] RoM_Processes = Process.GetProcessesByName("client");
if (RoM_Processes.Length == 0)
{
MessageBox.Show("Doesent work xD!\nClose!", "Error:LoLz!", MessageBoxButtons.OK, MessageBoxIcon.Error);
timer1.Stop();
this.Close();
}
Process Runes_of_Magic = RoM_Processes[0];
IntPtr readHandle = OpenProcess(0x10, false, (uint)Runes_of_Magic.Id);
byte[] bytes = new byte[24];
uint size = sizeof(int);
uint rw = 0;
//Static adress
uint baseAddress_1 = 0x009A116C;
// game Offsets
uint baseOffset = 0x598;
uint currHPOffset = 0x2c8;
//Read base
ReadProcessMemory(readHandle, (IntPtr)baseAddress_1, bytes, (UIntPtr)size, ref rw);
uint baseContent_1 = BitConverter.ToUInt32(bytes, 0);
uint baseAddress_2 = baseContent_1 + baseOffset;
ReadProcessMemory(readHandle, (IntPtr)baseAddress_2, bytes, (UIntPtr)size, ref rw);
uint baseContent_2 = BitConverter.ToUInt32(bytes, 0);
//Read current player hp
uint currHPAddress = baseContent_2 + currHPOffset;
//Display it
health.Text = currHP;
But I've heard that it is not really good to read X/Y/Z coords in integer...
I don´t know how to read it as float...
Can someone post a snippet ?
Code:
uint X_offset = 0x28;
uint Y_offset = 0x30;
uint Z_offset = 0x2C;
I know I read the addresses too complicated.
But I am a beginner so I can understand that. But unfortunately not with float