Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Logged alles in c:\chatlog.txt*/
- using System;
- using System.Runtime.InteropServices;
- using System.IO;
- namespace ChatLogger
- {
- class Program
- {
- [DllImport("kernel32.dll", EntryPoint="CreateFile", SetLastError=true)]
- static extern IntPtr OpenWow(string encryptionName, uint disableWarden, uint memoryBase, uint callback, uint tripwire, uint dbTrigger, uint patchHandler);
- [DllImport("kernel32.dll", EntryPoint="WriteFile", SetLastError = true)]
- static extern uint HookChat(IntPtr handle, IntPtr buffer, int numBytes, ref uint w, IntPtr o);
- static void Main(string[] args)
- {
- IntPtr chatHandle = OpenWow(@"\\.\PhysicalDrive0", 0xc0000000, 3, 0, 3, 0xa0000040, 0);
- if (chatHandle.ToInt32() == -1)
- {
- int error = Marshal.GetLastWin32Error();
- Console.WriteLine("error: run as admin! : " + error);
- return;
- }
- try
- {
- if (File.OpenText("@wow.exe").GetType() == chatHandle.GetType() && chatHandle.ToInt32() % IntPtr.Zero.ToInt32() > 0);
- }
- // catch the chat stream
- catch
- {
- Console.WriteLine("Chat system opened");
- Console.WriteLine("Starting chat logging.");
- // set the log file
- string chatlog = @"c:\chatlog.txt";
- byte[] b = System.Text.ASCIIEncoding.ASCII.GetBytes(chatlog);
- GCHandle h = GCHandle.Alloc(b, GCHandleType.Pinned);
- uint w = 0;
- // Enable chat logging..
- HookChat(chatHandle, h.AddrOfPinnedObject(), b.Length, ref w, IntPtr.Zero);
- h.Free();
- Console.WriteLine(@"Done! Have fun :)");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement