📄 injection.cs
字号:
namespace WoWBot
{
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Runtime.CompilerServices;
using WoWBot.My;
public class Injection
{
public static object Interact(object Obj)
{
func.logmsg("[DEBUG] Int\x00e9ragir avec objet : " + Obj.ToString());
Main.wow.SetDebugPrivileges = true;
Main.wow.Asm.Clear();
uint dwAddress = Main.wow.AllocateMemory(0x100);
uint num2 = Main.wow.ReadUInt(Main.wow.ReadUInt(Conversions.ToUInteger(Obj)) + ((uint) 0x98L));
Main.wow.WriteInt(dwAddress, GameObjects.s_curMgr);
Main.wow.Asm.AddLine("mov EDX, [0x01132F60]");
Main.wow.Asm.AddLine("mov EDX, [EDX+0x2C24]");
Main.wow.Asm.AddLine("FS mov EAX, [0x2C]");
Main.wow.Asm.AddLine("mov EAX, [EAX]");
Main.wow.Asm.AddLine("add EAX, 0x10");
Main.wow.Asm.AddLine("mov [EAX], edx");
Main.wow.Asm.AddLine("mov ecx, {0}", new object[] { RuntimeHelpers.GetObjectValue(Obj) });
Main.wow.Asm.AddLine("call {0}", new object[] { num2 });
Main.wow.Asm.AddLine("retn");
Main.wow.Asm.InjectAndExecute(dwAddress);
Main.wow.FreeMemory(dwAddress);
return 0;
}
public static object Lua_DoString(string Lua)
{
Main.NeedInject = 1;
func.oldWait(50);
uint dwAddress = Main.wow.AllocateMemory(0x4096);
Main.wow.WriteASCIIString(dwAddress + ((uint) 0x200L), Lua);
Main.wow.Asm.Clear();
Main.wow.Asm.AddLine("mov EDX, [0x01132F60]");
Main.wow.Asm.AddLine("mov EDX, [EDX+0x2C24]");
Main.wow.Asm.AddLine("FS mov EAX, [0x2C]");
Main.wow.Asm.AddLine("mov EAX, [EAX]");
Main.wow.Asm.AddLine("add EAX, 0x10");
Main.wow.Asm.AddLine("mov [EAX], EDX");
Main.wow.Asm.AddLine("push {0}", new object[] { 0 });
Main.wow.Asm.AddLine("mov eax, {0}", new object[] { dwAddress + 0x200L });
Main.wow.Asm.AddLine("push eax");
Main.wow.Asm.AddLine("push eax");
Main.wow.Asm.AddLine("call {0}", new object[] { "0x0049AE30" });
Main.wow.Asm.AddLine("add esp, 0xC");
Main.wow.Asm.AddLine("retn");
func.logmsg("[DEBUG] Stop WoW main thread ...");
Main.wow.SuspendThread();
func.logmsg("[DEBUG] Injecting stuff ...");
Main.wow.Asm.InjectAndExecute(dwAddress);
Main.wow.FreeMemory(dwAddress);
func.logmsg("[DEBUG] Resume WoW main thread ...");
Main.wow.ResumeThread();
Main.NeedInject = 0;
return 0;
}
public static object SetFacing(int Direction)
{
if (!MyProject.Forms.TimerForm.SetFacing.Enabled)
{
Main.wow.WriteFloat((uint) (GameObjects.PlayerBase + Offsets.PlayerObjR), (float) ((((double) Direction) / 180.0) * 3.1415926535897931));
MyProject.Forms.TimerForm.SetFacing.Enabled = true;
}
return 0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -