Created
July 2, 2023 13:49
-
-
Save kauefraga/482434a87a6217bde154d0368f966e1b to your computer and use it in GitHub Desktop.
A program that reads all the process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#include <TlHelp32.h> | |
int main() { | |
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | |
std::cout << snapshot << '\n'; | |
PROCESSENTRY32 process_entry{ }; | |
process_entry.dwSize = sizeof(process_entry); | |
if (Process32First(snapshot, &process_entry)) { | |
do { | |
std::cout << "Module name: " << process_entry.szExeFile << '\n'; | |
std::cout << "Process id: " << process_entry.th32ProcessID << '\n'; | |
std::cout << "Base size: " << process_entry.dwSize << '\n'; | |
} while (Process32Next(snapshot, &process_entry)); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment