BlackBone
Windows memory hacking library
 All Classes Functions
blackbone::Process Class Reference

Public Member Functions

BLACKBONE_API NTSTATUS Attach (DWORD pid, DWORD access=DEFAULT_ACCESS_P)
 Attach to existing process More...
 
BLACKBONE_API NTSTATUS Attach (HANDLE hProc)
 Attach to existing process More...
 
BLACKBONE_API NTSTATUS CreateAndAttach (const std::wstring &path, bool suspended=false, bool forceInit=true, const std::wstring &cmdLine=L"", const wchar_t *currentDir=nullptr, STARTUPINFOW *pStartup=nullptr)
 Create new process and attach to it More...
 
BLACKBONE_API NTSTATUS Detach ()
 Detach form current process, if any More...
 
BLACKBONE_API DWORD pid () const
 Get process ID More...
 
BLACKBONE_API bool valid ()
 Checks if process still exists More...
 
BLACKBONE_API NTSTATUS Terminate (uint32_t code=0)
 Terminate process More...
 
BLACKBONE_API ProcessCorecore ()
 
BLACKBONE_API ProcessMemorymemory ()
 
BLACKBONE_API ProcessModulesmodules ()
 
BLACKBONE_API ProcessThreadsthreads ()
 
BLACKBONE_API RemoteHookhooks ()
 
BLACKBONE_API RemoteExecremote ()
 
BLACKBONE_API MMapmmap ()
 
BLACKBONE_API NtLdrnativeLdr ()
 

Static Public Member Functions

static BLACKBONE_API void EnumByName (const std::wstring &name, std::vector< DWORD > &found)
 Search for process by executable name More...
 
static BLACKBONE_API NTSTATUS EnumByNameOrPID (uint32_t pid, const std::wstring &name, std::vector< ProcessInfo > &found, bool includeThreads=false)
 Search for process by executable name or by process ID More...
 

Member Function Documentation

NTSTATUS blackbone::Process::Attach ( DWORD  pid,
DWORD  access = DEFAULT_ACCESS_P 
)

Attach to existing process

Parameters
pidProcess ID
accessAccess mask
Returns
Status code
NTSTATUS blackbone::Process::Attach ( HANDLE  hProc)

Attach to existing process

Parameters
pidProcess handle
Returns
Status code
NTSTATUS blackbone::Process::CreateAndAttach ( const std::wstring &  path,
bool  suspended = false,
bool  forceInit = true,
const std::wstring &  cmdLine = L"",
const wchar_t *  currentDir = nullptr,
STARTUPINFOW *  pStartup = nullptr 
)

Create new process and attach to it

Parameters
pathExecutable path
suspendedLeave process in suspended state. To resume process one should resume its main thread
forceInitIf 'suspended' is true, this flag will enforce process initialization via second thread
cmdLineProcess command line
currentDirStartup directory
pStartupAdditional startup params
Returns
Status code
NTSTATUS blackbone::Process::Detach ( )

Detach form current process, if any

Returns
Status code
void blackbone::Process::EnumByName ( const std::wstring &  name,
std::vector< DWORD > &  found 
)
static

Search for process by executable name

Parameters
nameProcess name. If empty - function will retrieve all existing processes
foundFound processses
NTSTATUS blackbone::Process::EnumByNameOrPID ( uint32_t  pid,
const std::wstring &  name,
std::vector< ProcessInfo > &  found,
bool  includeThreads = false 
)
static

Search for process by executable name or by process ID

Parameters
pidTarget process ID. rocess name. If empty - function will retrieve all existing processes
nameProcess executable name. If empty - function will retrieve all existing processes
foundFound processses
includeThreadsIf set to true, function will retrieve info ablout process threads
Returns
Status code
BLACKBONE_API DWORD blackbone::Process::pid ( ) const
inline

Get process ID

Returns
Process ID
NTSTATUS blackbone::Process::Terminate ( uint32_t  code = 0)

Terminate process

Parameters
codeExit code
Returns
Stratus code
bool blackbone::Process::valid ( )

Checks if process still exists

Returns
true if process is valid and exists
Returns

The documentation for this class was generated from the following files: