Originally Posted by
Hrap
Greetings , finally I figured out the object manager in WOTLKC , Many thanks to Razzue for the help, I learned a lot of useful things from his posts and topics
But I'm stuck with reading the Game Object and Local Player names
For GameObject, I first read int Name1 = 0x148
DWORD_PTR nameptr = RemouteMemory->Read<DWORD_PTR>(entry+0x14
;
I then read the line from Name2 = 0xE0;
charname[128];
name = RemoteMemory->ReadCStr>(nameptr+0xE0 );
but i get the same character set for all objects
Maybe I'm wrong somewhere
how to do it right?
and can you show how you read the name of a local player from the name base, I could not find an example here on the forum how others do it?
Code:
var ptr = Memory.Read<IntPtr>(BaseAddress, new[] { 0x148, 0xE0 }); // [[Object address + 0x148] + 0xE0]
var _Name = IntPtr.Zero != ptr ? Memory.ReadString(ptr) : string.Empty;
My "Read string" call (it's gross i know, don't judge)
Code:
public static string ReadString(IntPtr address, Encoding encoding = null, int size = 255){
fixed (byte* bytes = new byte[size])
{
var status = mem.rvm(_ProcessHandle, address, (IntPtr)bytes, (IntPtr)size, default);
if (!mem.NtSuccess(status)) return string.Empty;
var name = encoding?.EncodingName ?? string.Empty;
if (name.Contains("ASCII"))
return CutString(Encoding.ASCII.GetString(bytes, size));
if (name.Contains("(UTF-8)"))
return CutString(Encoding.UTF8.GetString(bytes, size));
if (name.Contains("(UTF-7)"))
return CutString(Encoding.UTF7.GetString(bytes, size));
return Marshal.PtrToStringAnsi((IntPtr)bytes);
}
}
For local player name i believe i shared the offsets in my posts?
Memory.ReadString(GameAddress + 0x2F72CE8);