Alright, I'm making a new hack that will have a bunch of movement modding stuff in it... I need a way to do looping in ASM, but I don't want to consume a lot of CPU power. I was thinking about hijacking WoW's Sleep method(at 0x97A140) but I highly doubt this will work. I'm not even sure if that's the actual method or just an array of the procedures' addresses in the external dll... Will this work? If it won't, I won't bother trying to do it. Also, the new movementState1 is offset 0x44, and the 2nd one is at 0x48. Just a little fun fact. Here's my code(I'd rather not hear complaints of ugliness =/)
Code:
onoff = bm.AllocateMemory(0x256);
bm.WriteByte(onoff, 0x0);
codecave = bm.AllocateMemory(0x1024);
bm.Asm.Clear();
bm.Asm.AddLine("Start:");
bm.Asm.AddLine("mov eax, {0}", onoff);
bm.Asm.AddLine("cmp eax, 0");
bm.Asm.AddLine("je Sleep");
bm.Asm.AddLine("cmp eax, 2");
bm.Asm.AddLine("je Quit");
bm.Asm.AddLine("mov eax, {0}", player.address);
bm.Asm.AddLine("mov eax, [eax + 0xD8]");
bm.Asm.AddLine("mov [eax + 0x40], 0x80000000");
bm.Asm.AddLine("Sleep:");
bm.Asm.AddLine("push 0x5");
bm.Asm.AddLine("call 0x97A140");
bm.Asm.AddLine("add esp, 0x4");
bm.Asm.AddLine("jmp Start");
bm.Asm.AddLine("Quit:");
bm.Asm.AddLine("xor eax, eax");
bm.Asm.AddLine("retn");
bm.Asm.InjectAndExecute(codecave);