in process

 #include <windows.h>

#include <stdio.h>

#include <tlhelp32.h>


int main()

{

    PROCESSENTRY32W pe;

    pe.dwSize = sizeof(PROCESSENTRY32W);


    HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);


    if (hSnapshot == INVALID_HANDLE_VALUE)

    {

        printf("Cant get snapshot\n");

        return 1;

    }


    if (!Process32FirstW(hSnapshot, &pe))

    {

        printf("Process32First failed: %lu\n", GetLastError());

        CloseHandle(hSnapshot);

        return 1;

    }


    do

    {

        wprintf(L"%ls\n", pe.szExeFile);

    } while (Process32NextW(hSnapshot, &pe));


    CloseHandle(hSnapshot);

    return 0;

}

Nhận xét

Bài đăng phổ biến từ blog này

CVE-2023–41425 but only RCE part

Tanr man 2024