Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ArgumentParser argp  = new ArgumentParser();
            ProcessManager ph    = new ProcessManager();
            ProcessInfo    pInfo = new ProcessInfo();


            Process process = new Process();

            HashHandler sha256 = new HashHandler();
            FileManager fm     = new FileManager();

            ProcessAction pa = new ProcessAction();

            Process[] chrome = Process.GetProcessesByName("notepad");

            if (chrome.Length < 1)
            {
                Console.WriteLine("No se ha encontrado el proceso notepad ejecutandose");
            }



            else
            {
                pInfo.printProcessInformation(chrome[0], true, true, true, true, true, true, true, true, true, true, true, true, true);
            }



            Console.ReadKey();



            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public void printProcessInformation(
            Process process,
            bool showID                     = true,
            bool showName                   = true,
            bool showPriority               = false,
            bool showPatch                  = false,
            bool showInstances              = false,
            bool showWindowsTitle           = false,
            bool showStartingMemoryLocation = false,
            bool showMD5                    = false,
            bool showSHA1                   = false,
            bool showSHA256                 = false,
            bool showSHA512                 = false,
            bool showFileVersion            = false,
            bool showRAMUsage               = true
            )

        {
            HashHandler hs = new HashHandler();

            if (showID)
            {
                Console.WriteLine($"Process ID: {getProcessID(process)}");
            }

            if (showName)
            {
                Console.WriteLine($"Process Name: {getProcessName(process)}");
            }

            if (showPriority)
            {
                Console.WriteLine($"Priority: {getProcessPriority(process)} ({getPriorityById(getProcessPriority(process))})");
            }

            if (showPatch)
            {
                Console.WriteLine($"File Patch: {getProcessPatch(process)}");
            }

            if (showInstances)
            {
                Console.WriteLine($"Process Instances: {getProcessFamilyByName(process.ProcessName).Length}");
            }

            if (showWindowsTitle)
            {
                Console.WriteLine($"Main title name: {getProcessWindowsTitle(process)}");
            }

            if (showStartingMemoryLocation)
            {
                Console.WriteLine($"Starting memory location: 0x{getStartingMemoryLocation(process)}");
            }
            if (showMD5)
            {
                Console.WriteLine($"File MD5: {hs.FileToMD5(getProcessPatch(process))}");
            }
            if (showSHA1)
            {
                Console.WriteLine($"File SHA1: {hs.FileToSHA1(getProcessPatch(process))}");
            }
            if (showSHA256)
            {
                Console.WriteLine($"File SHA256: {hs.FileToSHA256(getProcessPatch(process))}");
            }
            if (showSHA512)
            {
                Console.WriteLine($"File SHA512: {hs.FileToSHA512(getProcessPatch(process))}");
            }

            if (showRAMUsage)
            {
                Console.WriteLine($"Main Memory (RAM USAGE): {getProcessMemoryUsage(process, 'B')} bytes");
            }

            if (showFileVersion)
            {
                Console.WriteLine($"{getProcessFileVersion(process)}");
            }
        }