Jump to content
Sign in to follow this  
WTFDudes

Trojan.Agent/Gen-Faldesc

Recommended Posts

Seriously? This made me laugh pretty hard. That's a shitty detection you have.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace WhatTheFuck
{
   public partial class Form1 : Form
   {
    Timer myTimer = null;
    string CurrentApplication = String.Empty;	    public Form1()
    {
	    InitializeComponent();
    }
    void myTimer_Tick(object sender, EventArgs e)
    {
	    try
	    {
		    string AppNow = GetAppName(GetForegroundWindow().ToInt32());
		    if (AppNow != CurrentApplication)
		    {
			    CurrentApplication = AppNow;
			    textBox1.Text += CurrentApplication + Environment.NewLine;
		    }
	    }
	    catch(Exception)
	    {
	    }
    }	    private void Form1_Load(object sender, EventArgs e)
    {
	    try
	    {
		    myTimer = new Timer();
		    myTimer.Interval = 100;
		    myTimer.Tick += new EventHandler(myTimer_Tick);
		    IntPtr hwnd = GetForegroundWindow();
		    CurrentApplication = GetAppName(hwnd.ToInt32());
		    textBox1.Text = CurrentApplication + Environment.NewLine;
	    }
	    catch (Exception)
	    {
	    }
    }
    public string GetAppName(Int32 hwnd)
    {
	    Int32 pid = GetWindowProcessID(hwnd);
	    Process p = Process.GetProcessById(pid);
	    return p.ProcessName;
    }	   [DllImport("user32.dll")]
    public static extern IntPtr GetForegroundWindow();
   [DllImport("user32.dll")]
    private static extern UInt32 GetWindowThreadProcessId(
	  Int32 hWnd,
	  out Int32 lpdwProcessId
    );	    public static Int32 GetWindowProcessID(Int32 hwnd)
    {
	    Int32 pid = 1;
	    GetWindowThreadProcessId(hwnd, out pid);
	    return pid;
    }
    private void button1_Click(object sender, EventArgs e)
    {
	    myTimer.Start();
    }	    private void button2_Click(object sender, EventArgs e)
    {
	    myTimer.Stop();
    }
    private void button3_Click(object sender, EventArgs e)
    {
	    textBox1.Text = "";
    }
   }
}

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×