Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void GetName()
- {
- BlackMagic blackMagic = new BlackMagic(); //Create new function to open wow process
- blackMagic.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle("World of Warcraft")); //This Opens "World of Warcraft" window
- uint objBaseAddress = blackMagic.ReadUInt(blackMagic.ReadUInt(blackMagic.ReadUInt(0xCD87A8) + 0x34) + 0x24); //this is the player base
- uint GetName = 54;
- string sResult;
- UInt32 GetNameVMT_Codecave = blackMagic.AllocateMemory(0x32);
- try
- {
- uint VMT = blackMagic.ReadUInt((blackMagic.ReadUInt(objBaseAddress) + (GetName * 4)));
- blackMagic.Asm.Clear();
- blackMagic.Asm.AddLine("mov ecx, " + objBaseAddress);
- blackMagic.Asm.AddLine("mov eax, " + VMT);
- blackMagic.Asm.AddLine("call eax");
- blackMagic.Asm.AddLine("retn");
- sResult = blackMagic.ReadASCIIString(blackMagic.Asm.InjectAndExecute(GetNameVMT_Codecave), 10);
- button1.Text = sResult;
- }
- catch { }
- blackMagic.FreeMemory(GetNameVMT_Codecave);
- }
- public void ctm(Single x, Single y, Single z, UInt64 guid, Int32 action, Single precision)
- {
- // Process Connect:
- BlackMagic blackMagic = new BlackMagic();
- blackMagic.OpenProcessAndThread(SProcess.GetProcessFromProcessName("Wow.exe"));
- uint objBaseAddress = blackMagic.ReadUInt(blackMagic.ReadUInt(blackMagic.ReadUInt(0xCD87A8) + 0x34) + 0x24); //this is the player base
- // Offset:
- uint CGPlayer_C__ClickToMove = 0x727400;
- // Allocate Memory:
- UInt32 GetNameVMT_Codecave = blackMagic.AllocateMemory(0x3332);
- UInt32 Pos_Codecave = blackMagic.AllocateMemory(0x4 * 3);
- UInt32 GUID_Codecave = blackMagic.AllocateMemory(0x8);
- UInt32 Angle_Codecave = blackMagic.AllocateMemory(0x4);
- // Write value:
- blackMagic.WriteUInt64(GUID_Codecave, guid);
- blackMagic.WriteFloat(Angle_Codecave, precision);
- blackMagic.WriteFloat(Pos_Codecave, x);
- blackMagic.WriteFloat(Pos_Codecave + 0x4, y);
- blackMagic.WriteFloat(Pos_Codecave + 0x8, z);
- try
- {
- // BOOL __thiscall CGPlayer_C__ClickToMove(WoWActivePlayer *this, CLICKTOMOVETYPE clickType, WGUID *interactGuid, WOWPOS *clickPos, float precision)
- blackMagic.Asm.Clear();
- blackMagic.Asm.AddLine("mov edx, [" + Angle_Codecave + "]");
- blackMagic.Asm.AddLine("push edx");
- blackMagic.Asm.AddLine("push " + Pos_Codecave);
- blackMagic.Asm.AddLine("push " + GUID_Codecave);
- blackMagic.Asm.AddLine("push " + action);
- blackMagic.Asm.AddLine("mov ecx, " + objBaseAddress);
- blackMagic.Asm.AddLine("call " + CGPlayer_C__ClickToMove);
- blackMagic.Asm.AddLine("retn");
- blackMagic.Asm.InjectAndExecute(GetNameVMT_Codecave);
- }
- catch { }
- blackMagic.FreeMemory(GetNameVMT_Codecave);
- blackMagic.FreeMemory(Pos_Codecave);
- blackMagic.FreeMemory(GUID_Codecave);
- blackMagic.FreeMemory(Angle_Codecave);
- }
- public void LuaToString(string command)
- {
- // Process Connect:
- BlackMagic blackMagic = new BlackMagic();
- blackMagic.OpenProcessAndThread(SProcess.GetProcessFromProcessName("Wow.exe"));
- uint objBaseAddress = blackMagic.ReadUInt(blackMagic.ReadUInt(blackMagic.ReadUInt(0xCD87A8) + 0x34) + 0x24); //this is the player base
- // Offset:
- uint FrameScript__Execute = 0x819210;
- // Allocate memory
- UInt32 DoString_Codecave = blackMagic.AllocateMemory(0x3332);
- uint DoStringArg_Codecave = blackMagic.AllocateMemory(Encoding.UTF8.GetBytes(command).Length + 1);
- // Write value:
- blackMagic.WriteBytes(DoStringArg_Codecave, Encoding.UTF8.GetBytes(command));
- try
- {
- // Write the asm stuff for Lua_DoString
- blackMagic.Asm.Clear();
- blackMagic.Asm.AddLine("mov eax, " + DoStringArg_Codecave);
- blackMagic.Asm.AddLine("push 0");
- blackMagic.Asm.AddLine("push eax");
- blackMagic.Asm.AddLine("push eax");
- blackMagic.Asm.AddLine("mov eax, " + FrameScript__Execute); // Lua_DoString
- blackMagic.Asm.AddLine("call eax");
- blackMagic.Asm.AddLine("add esp, 0xC");
- blackMagic.Asm.AddLine("retn");
- // Inject
- blackMagic.Asm.InjectAndExecute(DoString_Codecave);
- }
- catch { }
- // Free memory allocated
- blackMagic.FreeMemory(DoString_Codecave);
- blackMagic.FreeMemory(DoStringArg_Codecave);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement