Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string h = "test test";
- byte[] bytes = System.Text.ASCIIEncoding.Default.GetBytes(h);
- IntPtr stringAdr = Util.WinApi.VirtualAllocEx(client.ProcessHandle, IntPtr.Zero, (uint)bytes.Length, WinApi.AllocationType.Commit | WinApi.AllocationType.Reserve, WinApi.MemoryProtection.ExecuteReadWrite);
- client.Memory.WriteBytes(stringAdr.ToInt64(), bytes, (uint)bytes.Length);
- byte[] OpCodes = new byte[]{
- //push 0
- 0x6A,0x00,
- //push blue
- 0x6A,b,
- //push green
- 0x6A, g,
- //push red
- 0x6A, r,
- //push font
- 0x6A, font,
- //push y
- 0x6A,y,
- //push x
- 0x6A,x,
- //pushes 1 to stack
- 0x6A,1,
- //move string to ecx
- 0xB9,0xFF,0xFF,0xFF,0xFF,
- //call printtext
- 0xFF,0x15, 0xff, 0xff, 0xff,0xff,
- //add esp,32
- 0x83,0xc4,0x20,
- // return,
- 0xC3,
- };
- Array.Copy(BitConverter.GetBytes(stringAdr.ToInt32()), 0, OpCodes, 17, 4);
- Array.Copy(BitConverter.GetBytes(Addresses.Client.PrintName), 0, OpCodes, 23, 4);
- IntPtr adr = Util.WinApi.VirtualAllocEx(client.ProcessHandle, IntPtr.Zero, (uint)OpCodes.Length, WinApi.AllocationType.Commit | WinApi.AllocationType.Reserve, WinApi.MemoryProtection.ExecuteReadWrite);
- client.Memory.WriteBytes(adr.ToInt64(), OpCodes, (uint)OpCodes.Length);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement