Advertisement
Guest User

Untitled

a guest
Sep 18th, 2013
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.74 KB | None | 0 0
  1.             string h = "test test";
  2.             byte[] bytes = System.Text.ASCIIEncoding.Default.GetBytes(h);
  3.             IntPtr stringAdr = Util.WinApi.VirtualAllocEx(client.ProcessHandle, IntPtr.Zero, (uint)bytes.Length, WinApi.AllocationType.Commit | WinApi.AllocationType.Reserve, WinApi.MemoryProtection.ExecuteReadWrite);
  4.             client.Memory.WriteBytes(stringAdr.ToInt64(), bytes, (uint)bytes.Length);
  5.  
  6.             byte[] OpCodes = new byte[]{
  7.                     //push 0
  8.                     0x6A,0x00,
  9.                     //push blue
  10.                     0x6A,b,
  11.                     //push green
  12.                     0x6A, g,
  13.                     //push red
  14.                     0x6A, r,
  15.                     //push font
  16.                     0x6A, font,
  17.                     //push y
  18.                     0x6A,y,
  19.                     //push x
  20.                     0x6A,x,
  21.                     //pushes 1 to stack
  22.                     0x6A,1,
  23.                     //move string to ecx
  24.                     0xB9,0xFF,0xFF,0xFF,0xFF,
  25.                     //call printtext
  26.                     0xFF,0x15, 0xff, 0xff, 0xff,0xff,
  27.                     //add esp,32
  28.                     0x83,0xc4,0x20,
  29.                     // return,
  30.                     0xC3,
  31.  
  32.                 };
  33.             Array.Copy(BitConverter.GetBytes(stringAdr.ToInt32()), 0, OpCodes, 17, 4);
  34.             Array.Copy(BitConverter.GetBytes(Addresses.Client.PrintName), 0, OpCodes, 23, 4);
  35.  
  36.             IntPtr adr = Util.WinApi.VirtualAllocEx(client.ProcessHandle, IntPtr.Zero, (uint)OpCodes.Length, WinApi.AllocationType.Commit | WinApi.AllocationType.Reserve, WinApi.MemoryProtection.ExecuteReadWrite);
  37.             client.Memory.WriteBytes(adr.ToInt64(), OpCodes, (uint)OpCodes.Length);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement