Advertisement
Guest User

Untitled

a guest
Jul 15th, 2010
1,020
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.12 KB | None | 0 0
  1.         public void GetName()
  2.         {
  3.             BlackMagic blackMagic = new BlackMagic(); //Create new function to open wow process
  4.             blackMagic.OpenProcessAndThread(SProcess.GetProcessFromWindowTitle("World of Warcraft")); //This Opens "World of Warcraft" window
  5.             uint objBaseAddress = blackMagic.ReadUInt(blackMagic.ReadUInt(blackMagic.ReadUInt(0xCD87A8) + 0x34) + 0x24); //this is the player base
  6.             uint GetName = 54;
  7.             string sResult;
  8.  
  9.             UInt32 GetNameVMT_Codecave = blackMagic.AllocateMemory(0x32);
  10.  
  11.             try
  12.             {
  13.  
  14.                 uint VMT = blackMagic.ReadUInt((blackMagic.ReadUInt(objBaseAddress) + (GetName * 4)));
  15.  
  16.                 blackMagic.Asm.Clear();
  17.                 blackMagic.Asm.AddLine("mov ecx, " + objBaseAddress);
  18.                 blackMagic.Asm.AddLine("mov eax, " + VMT);
  19.                 blackMagic.Asm.AddLine("call eax");
  20.                 blackMagic.Asm.AddLine("retn");
  21.  
  22.                 sResult = blackMagic.ReadASCIIString(blackMagic.Asm.InjectAndExecute(GetNameVMT_Codecave), 10);
  23.                 button1.Text = sResult;
  24.             }
  25.             catch { }
  26.  
  27.             blackMagic.FreeMemory(GetNameVMT_Codecave);
  28.  
  29.         }
  30.  
  31.         public void ctm(Single x, Single y, Single z, UInt64 guid, Int32 action, Single precision)
  32.         {
  33.             // Process Connect:
  34.             BlackMagic blackMagic = new BlackMagic();
  35.             blackMagic.OpenProcessAndThread(SProcess.GetProcessFromProcessName("Wow.exe"));
  36.             uint objBaseAddress = blackMagic.ReadUInt(blackMagic.ReadUInt(blackMagic.ReadUInt(0xCD87A8) + 0x34) + 0x24); //this is the player base
  37.  
  38.             // Offset:
  39.             uint CGPlayer_C__ClickToMove = 0x727400;
  40.  
  41.             // Allocate Memory:
  42.             UInt32 GetNameVMT_Codecave = blackMagic.AllocateMemory(0x3332);
  43.             UInt32 Pos_Codecave = blackMagic.AllocateMemory(0x4 * 3);
  44.             UInt32 GUID_Codecave = blackMagic.AllocateMemory(0x8);
  45.             UInt32 Angle_Codecave = blackMagic.AllocateMemory(0x4);
  46.  
  47.             // Write value:
  48.             blackMagic.WriteUInt64(GUID_Codecave, guid);
  49.             blackMagic.WriteFloat(Angle_Codecave, precision);
  50.  
  51.             blackMagic.WriteFloat(Pos_Codecave, x);
  52.             blackMagic.WriteFloat(Pos_Codecave + 0x4, y);
  53.             blackMagic.WriteFloat(Pos_Codecave + 0x8, z);
  54.  
  55.             try
  56.             {
  57.                 // BOOL __thiscall CGPlayer_C__ClickToMove(WoWActivePlayer *this, CLICKTOMOVETYPE clickType, WGUID *interactGuid, WOWPOS *clickPos, float precision)
  58.                 blackMagic.Asm.Clear();
  59.  
  60.  
  61.  
  62.                 blackMagic.Asm.AddLine("mov edx, [" + Angle_Codecave + "]");
  63.                 blackMagic.Asm.AddLine("push edx");
  64.  
  65.                 blackMagic.Asm.AddLine("push " + Pos_Codecave);
  66.                 blackMagic.Asm.AddLine("push " + GUID_Codecave);
  67.                 blackMagic.Asm.AddLine("push " + action);
  68.  
  69.                 blackMagic.Asm.AddLine("mov ecx, " + objBaseAddress);
  70.                 blackMagic.Asm.AddLine("call " + CGPlayer_C__ClickToMove);
  71.                 blackMagic.Asm.AddLine("retn");
  72.  
  73.                 blackMagic.Asm.InjectAndExecute(GetNameVMT_Codecave);
  74.             }
  75.             catch { }
  76.  
  77.             blackMagic.FreeMemory(GetNameVMT_Codecave);
  78.             blackMagic.FreeMemory(Pos_Codecave);
  79.             blackMagic.FreeMemory(GUID_Codecave);
  80.             blackMagic.FreeMemory(Angle_Codecave);
  81.         }
  82.  
  83.         public void LuaToString(string command)
  84.         {
  85.             // Process Connect:
  86.             BlackMagic blackMagic = new BlackMagic();
  87.             blackMagic.OpenProcessAndThread(SProcess.GetProcessFromProcessName("Wow.exe"));
  88.             uint objBaseAddress = blackMagic.ReadUInt(blackMagic.ReadUInt(blackMagic.ReadUInt(0xCD87A8) + 0x34) + 0x24); //this is the player base
  89.  
  90.             // Offset:
  91.             uint FrameScript__Execute = 0x819210;
  92.  
  93.             // Allocate memory
  94.             UInt32 DoString_Codecave = blackMagic.AllocateMemory(0x3332);
  95.             uint DoStringArg_Codecave = blackMagic.AllocateMemory(Encoding.UTF8.GetBytes(command).Length + 1);
  96.  
  97.             // Write value:
  98.             blackMagic.WriteBytes(DoStringArg_Codecave, Encoding.UTF8.GetBytes(command));
  99.  
  100.             try
  101.             {
  102.                 // Write the asm stuff for Lua_DoString
  103.                 blackMagic.Asm.Clear();
  104.                 blackMagic.Asm.AddLine("mov eax, " + DoStringArg_Codecave);
  105.                 blackMagic.Asm.AddLine("push 0");
  106.                 blackMagic.Asm.AddLine("push eax");
  107.                 blackMagic.Asm.AddLine("push eax");
  108.                 blackMagic.Asm.AddLine("mov eax, " + FrameScript__Execute); // Lua_DoString
  109.                 blackMagic.Asm.AddLine("call eax");
  110.                 blackMagic.Asm.AddLine("add esp, 0xC");
  111.                 blackMagic.Asm.AddLine("retn");
  112.  
  113.                 // Inject
  114.                 blackMagic.Asm.InjectAndExecute(DoString_Codecave);
  115.             }
  116.             catch { }
  117.  
  118.             // Free memory allocated
  119.             blackMagic.FreeMemory(DoString_Codecave);
  120.             blackMagic.FreeMemory(DoStringArg_Codecave);
  121.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement