Compare commits

..

No commits in common. "keylogger" and "master" have entirely different histories.

2 changed files with 18 additions and 77 deletions

View File

@ -7,21 +7,18 @@ namespace FemboyWatchdog
{
static class GlobalHooks
{
public delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam);
public delegate IntPtr LowLevelMouseProc(int nCode, IntPtr wParam, IntPtr lParam);
public static IntPtr SetHook(int idHook, HookProc proc)
public static IntPtr SetHook(LowLevelMouseProc proc)
{
using (Process curProcess = Process.GetCurrentProcess())
using (ProcessModule curModule = curProcess.MainModule)
{
return SetWindowsHookEx(idHook, proc,
return SetWindowsHookEx(WH_MOUSE_LL, proc,
GetModuleHandle(curModule.ModuleName), 0);
}
}
public const int WH_KEYBOARD = 2;
public const int WH_KEYBOARD_LL = 13;
public const int WH_MOUSE = 7;
public const int WH_MOUSE_LL = 14;
public enum MouseMessages
@ -34,11 +31,6 @@ namespace FemboyWatchdog
WM_RBUTTONUP = 0x0205
}
public enum KeyboardMessages
{
WM_CHAR = 0x0102
}
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
@ -58,7 +50,7 @@ namespace FemboyWatchdog
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SetWindowsHookEx(int idHook,
HookProc lpfn, IntPtr hMod, uint dwThreadId);
LowLevelMouseProc lpfn, IntPtr hMod, uint dwThreadId);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]

View File

@ -9,7 +9,6 @@ using System.Net;
using System.Runtime.InteropServices;
using System.Speech.Synthesis;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using AForge.Video;
using AForge.Video.DirectShow;
@ -19,7 +18,7 @@ namespace FemboyWatchdog
public partial class Monitor : Form
{
private DateTime clockIn = DateTime.Now;
private LocationProvider tracker;
private SpamProvider spammer;
@ -27,39 +26,27 @@ namespace FemboyWatchdog
private VideoCaptureDevice videoDevice;
private VideoCapabilities[] videoCapabilities;
private System.Windows.Forms.Timer labelBlinkTimer;
private System.Windows.Forms.Timer ttsTimer;
private System.Windows.Forms.Timer mousemvmtTimer;
private Timer labelBlinkTimer;
private Timer ttsTimer;
private Timer mousemvmtTimer;
private int mousemvmtCount = 0;
/* mouse movements come in as a stream, so we'll say a mouse movement is "over" by waiting
a certain time with no movement */
private System.Windows.Forms.Timer lastmousemvmtTimer;
private Timer lastmousemvmtTimer;
private SpeechSynthesizer ss;
private SolidBrush brush = new SolidBrush(Color.Red);
private Font font = new Font(FontFamily.GenericSansSerif, 24);
private GlobalHooks.HookProc _mouseProc;
private static IntPtr _mouseHookID = IntPtr.Zero;
private GlobalHooks.HookProc _kbProc;
private static IntPtr _kbHookID = IntPtr.Zero;
private string keyloggerBuffer;
private static string[] keyloggerKeywords = {
"fembooru", "femboyfinancial", "femboywatchdog", "accounts payable",
"femboycliquere", "femboybanking", "femboygeometry"
};
private GlobalHooks.LowLevelMouseProc _proc;
private static IntPtr _hookID = IntPtr.Zero;
public Monitor()
{
_mouseProc = OnMouseMessage;
GlobalHooks.SetHook(GlobalHooks.WH_MOUSE_LL, _mouseProc);
_kbProc = OnKeyboardMessage;
GlobalHooks.SetHook(GlobalHooks.WH_KEYBOARD_LL, _kbProc);
_proc = OnMouseMessage;
GlobalHooks.SetHook(_proc);
InitializeComponent();
ss = new SpeechSynthesizer();
@ -67,14 +54,14 @@ namespace FemboyWatchdog
tracker = new LocationProvider();
spammer = new SpamProvider();
ttsTimer = new System.Windows.Forms.Timer();
ttsTimer = new Timer();
ttsTimer.Interval = 15000;
labelBlinkTimer = new System.Windows.Forms.Timer();
labelBlinkTimer = new Timer();
labelBlinkTimer.Interval = 1000;
mousemvmtTimer = new System.Windows.Forms.Timer();
mousemvmtTimer = new Timer();
mousemvmtTimer.Interval = 60000;
mousemvmtTimer.Start();
lastmousemvmtTimer = new System.Windows.Forms.Timer();
lastmousemvmtTimer = new Timer();
lastmousemvmtTimer.Interval = 500;
// hook events
@ -88,44 +75,6 @@ namespace FemboyWatchdog
ttsTimer.Start();
}
private IntPtr OnKeyboardMessage(Int32 code, IntPtr wParam, IntPtr lParam)
{
Int32 msgType = wParam.ToInt32();
Int32 charCode = wParam.ToInt32();
Int32 repeatCount = lParam.ToInt32() & 0xFFFF;
string key = "";
if (code >= 0 && msgType == GlobalHooks.WM_CHAR)
{
charCode = Marshal.ReadInt32(lParam);
}
buf += keys.ToString();
foreach (string keyword in keywords)
{
if (buf.ToLower().Contains(keyword))
{
ShowBonusBalloon(keyword);
buf = "";
break;
}
}
}
private void ShowBonusBalloon(string keyword)
{
NotifyIcon ni = new NotifyIcon();
ni.Visible = true;
ni.Icon = SystemIcons.Application;
ni.BalloonTipTitle = "Bonus earned!";
ni.BalloonTipText = string.Format(
"Thank you for discussing {0}! +0.05 USD has been deposited into your account.",
keyword
);
ni.ShowBalloonTip(10000);
Thread.Sleep(15000);
ni.Dispose();
}
private void lastmousemvmtTimer_Tick(object sender, EventArgs e)
{
++mousemvmtCount;
@ -168,7 +117,7 @@ namespace FemboyWatchdog
if (!lastmousemvmtTimer.Enabled)
lastmousemvmtTimer.Start();
}
return GlobalHooks.CallNextHookEx(_mouseHookID, nCode, wParam, lParam);
return GlobalHooks.CallNextHookEx(_hookID, nCode, wParam, lParam);
}
private void OpenCamera()