HyperDbg Debugger
Loading...
Searching...
No Matches
PlatformProcess.h File Reference

Cross platform APIs for process and thread queries. More...

Go to the source code of this file.

Functions

HANDLE PlatformProcessGetCurrentThreadId (VOID)
 Get the current thread ID.
HANDLE PlatformProcessGetCurrentProcessId (VOID)
 Get the current process ID.
PVOID PlatformProcessGetCurrentProcess (VOID)
 Get the current process (PEPROCESS).
PVOID PlatformProcessGetCurrentThread (VOID)
 Get the current thread (PETHREAD).
PVOID PlatformProcessGetCurrentThreadTeb (VOID)
 Get the TEB (Thread Environment Block) of the current thread.

Detailed Description

Cross platform APIs for process and thread queries.

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.19
Date
2026-05-09

Function Documentation

◆ PlatformProcessGetCurrentProcess()

PVOID PlatformProcessGetCurrentProcess ( VOID )

Get the current process (PEPROCESS).

Returns
PVOID Pointer to the EPROCESS structure for the current process
71{
72#if defined(_WIN32) || defined(_WIN64)
73
74 return (PVOID)PsGetCurrentProcess();
75
76#elif defined(__linux__)
77
78# error "Not yet implemented"
79
80#else
81
82# error "Unsupported platform"
83
84#endif
85}
void * PVOID
Definition BasicTypes.h:56

◆ PlatformProcessGetCurrentProcessId()

HANDLE PlatformProcessGetCurrentProcessId ( VOID )

Get the current process ID.

Returns
HANDLE
48{
49#if defined(_WIN32) || defined(_WIN64)
50
51 return PsGetCurrentProcessId();
52
53#elif defined(__linux__)
54
55# error "Not yet implemented"
56
57#else
58
59# error "Unsupported platform"
60
61#endif
62}

◆ PlatformProcessGetCurrentThread()

PVOID PlatformProcessGetCurrentThread ( VOID )

Get the current thread (PETHREAD).

Returns
PVOID Pointer to the ETHREAD structure for the current thread
94{
95#if defined(_WIN32) || defined(_WIN64)
96
97 return (PVOID)PsGetCurrentThread();
98
99#elif defined(__linux__)
100
101# error "Not yet implemented"
102
103#else
104
105# error "Unsupported platform"
106
107#endif
108}

◆ PlatformProcessGetCurrentThreadId()

HANDLE PlatformProcessGetCurrentThreadId ( VOID )

Get the current thread ID.

Returns
HANDLE
25{
26#if defined(_WIN32) || defined(_WIN64)
27
28 return PsGetCurrentThreadId();
29
30#elif defined(__linux__)
31
32# error "Not yet implemented"
33
34#else
35
36# error "Unsupported platform"
37
38#endif
39}

◆ PlatformProcessGetCurrentThreadTeb()

PVOID PlatformProcessGetCurrentThreadTeb ( VOID )

Get the TEB (Thread Environment Block) of the current thread.

Returns
PVOID Pointer to the TEB of the current thread
117{
118#if defined(_WIN32) || defined(_WIN64)
119
120 return PsGetCurrentThreadTeb();
121
122#elif defined(__linux__)
123
124# error "Not yet implemented"
125
126#else
127
128# error "Unsupported platform"
129
130#endif
131}