EMO Style ForumPro - Hos Geldiniz
How to get process id Uyeols10

Join the forum, it's quick and easy

EMO Style ForumPro - Hos Geldiniz
How to get process id Uyeols10
EMO Style ForumPro - Hos Geldiniz
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 203 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: crayzboy76

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Anahtar-kelime

kutu  pointer  loot  

Kimler hatta?
Toplam 1 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 1 Misafir

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
How to get process id I_icon_minitimeCuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
How to get process id I_icon_minitimeCuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
How to get process id I_icon_minitimeÇarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
How to get process id I_icon_minitimePtsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
How to get process id I_icon_minitimeC.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
How to get process id I_icon_minitimeÇarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
How to get process id I_icon_minitimeÇarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
How to get process id I_icon_minitimeÇarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
How to get process id I_icon_minitimePtsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

How to get process id

Aşağa gitmek

How to get process id Empty How to get process id

Mesaj tarafından Hello EMO Paz Ağus. 14, 2011 6:53 pm

As Duoas said, the functions I provided require the name of the actual window. If you were looking for how to check against "process.exe" then this should help you


Kod:
#include <iostream>
#include <string>
#include <windows.h>
#include <tlhelp32.h>

DWORD FindProcessId(const std::wstring& processName);

int main()
{
   std::wstring processName;

   std::wcout << "Enter the process name: ";
   std::getline(std::wcin, processName);
   
   DWORD processID = FindProcessId(processName);

   if ( processID == 0 )
      std::wcout << "Could not find " << processName.c_str() << std::endl;
   else
      std::wcout << "Process ID is " << processID << std::endl;

   system("PAUSE");
   return 0;
}

DWORD FindProcessId(const std::wstring& processName)
{
   PROCESSENTRY32 processInfo;
   processInfo.dwSize = sizeof(processInfo);

   HANDLE processesSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
   if ( processesSnapshot == INVALID_HANDLE_VALUE )
      return 0;

   Process32First(processesSnapshot, &processInfo);
   if ( !processName.compare(processInfo.szExeFile) )
   {
      CloseHandle(processesSnapshot);
      return processInfo.th32ProcessID;
   }

   while ( Process32Next(processesSnapshot, &processInfo) )
   {
      if ( !processName.compare(processInfo.szExeFile) )
      {
         CloseHandle(processesSnapshot);
         return processInfo.th32ProcessID;
      }
   }
   
   CloseHandle(processSnapshot);
   return 0;
}
Hello EMO
Hello EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 935
Puan : 372493
Rep Puanı : 18
Doğum tarihi : 28/11/89
Kayıt tarihi : 21/07/09
Yaş : 34
Nerden : EMO WorlD
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

https://emostyle.yetkinforum.com

Sayfa başına dön Aşağa gitmek

How to get process id Empty Geri: How to get process id

Mesaj tarafından Hello EMO Paz Ağus. 14, 2011 6:54 pm

Found this while helping someone else, hope it helps you. It's written by someone called Irwin.

Kod:
#include <psapi.h>
#define MAX_PROCESSES 1024

DWORD FindProcess(__in_z LPCTSTR lpcszFileName)
{
  LPDWORD lpdwProcessIds;
  LPTSTR  lpszBaseName;
  HANDLE  hProcess;
  DWORD  i, cdwProcesses, dwProcessId = 0;

  lpdwProcessIds = (LPDWORD)HeapAlloc(GetProcessHeap(), 0, MAX_PROCESSES*sizeof(DWORD));
  if (lpdwProcessIds != NULL)
  {
    if (EnumProcesses(lpdwProcessIds, MAX_PROCESSES*sizeof(DWORD), &cdwProcesses))
    {
      lpszBaseName = (LPTSTR)HeapAlloc(GetProcessHeap(), 0, MAX_PATH*sizeof(TCHAR));
      if (lpszBaseName != NULL)
      {
        cdwProcesses /= sizeof(DWORD);
        for (i = 0; i < cdwProcesses; i++)
        {
          hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, lpdwProcessIds[i]);
          if (hProcess != NULL)
          {
            if (GetModuleBaseName(hProcess, NULL, lpszBaseName, MAX_PATH) > 0)
            {
              if (!lstrcmpi(lpszBaseName, lpcszFileName))
              {
                dwProcessId = lpdwProcessIds[i];
                CloseHandle(hProcess);
                break;
              }
            }
            CloseHandle(hProcess);
          }
        }
        HeapFree(GetProcessHeap(), 0, (LPVOID)lpszBaseName);
      }
    }
    HeapFree(GetProcessHeap(), 0, (LPVOID)lpdwProcessIds);
  }
  return dwProcessId;
}
Hello EMO
Hello EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 935
Puan : 372493
Rep Puanı : 18
Doğum tarihi : 28/11/89
Kayıt tarihi : 21/07/09
Yaş : 34
Nerden : EMO WorlD
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

https://emostyle.yetkinforum.com

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz