-
Member
Have problem in function MoveTo [Shadowlands WoW 9.0.1.36322]
Dear colleagues,
Thanks so much for the opportunity to study on this forum. I’ve been trying to coordinate movements in the game. But I’ve run into a problem, I cannot figure out why the MoveTo function in my application via memory in Shadowlands WoW 9.0.1.36322 isn’t working. Here’s the code I’ve been using to attempt to get the character to move in game, but nothing happens or the client crashes.
Code:
Offsets.Function.MoveTo = 0x1073150
.......................
IntPtr positionCodecave = MemoryManager.WowMemory.Memory.AllocateMemory(0xC);
if (positionCodecave == IntPtr.Zero)
return;
try
{
MemoryManager.WowMemory.Memory.Write<float>(positionCodecave, position.X);
MemoryManager.WowMemory.Memory.Write<float>(positionCodecave + 4, position.Y);
MemoryManager.WowMemory.Memory.Write<float>(positionCodecave + 8, position.Z);
var asm = new List<byte>();
asm.AddRange(new byte[] { 0x48, 0x83, 0xEC, 0x18 });//sub rsp,0x18
asm.AddRange(new byte[] { 0x48, 0xB9 }); //movabs rcx,0xXXXXXXXXX
asm.AddRange(BitConverter.GetBytes(ObjectManager.ObjectManager.Me.BaseAddress.ToInt64()));
asm.AddRange(new byte[] { 0x48, 0xBA }); //movabs rdx,0xXXXXXXXXX
asm.AddRange(BitConverter.GetBytes(positionCodecave.ToInt64()));
asm.AddRange(new byte[] { 0x48, 0xB8 }); //movabs rax,0xXXXXXXXXX
asm.AddRange(BitConverter.GetBytes(IntPtr.Add(MemoryManager.WowMemory.Memory.BaseAddress, (int)Offsets.Function.MoveTo).ToInt64()));
asm.AddRange(new byte[] { 0xFF, 0xD0 }); //call rax
asm.AddRange(new byte[] { 0x48, 0x83, 0xC4, 0x18 }); //add rsp,0x18
asm.AddRange(new byte[] { 0xC3 }); // ret
MemoryManager.WowMemory.InjectAndExecute(asm.ToArray());
}
finally
{
MemoryManager.WowMemory.Memory.FreeMemory(positionCodecave);
}
I am assuming that the problem is a violation of the access rights to the MoveTo call within the WoW client’s memory.
Thank you in advance for your help!
-
Post Thanks / Like - 2 Thanks
Miksu,
Corthezz (2 members gave Thanks to antonburesh for this useful post)