FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
DriverInjectDll/misc.cpp at master · strivexjun/DriverInjectDll · GitHub
strivexjun
/
DriverInjectDll
Public
Notifications
You must be signed in to change notification settings
Fork
200
Star
535
Code
Issues
3
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
DriverInjectDll
/
misc.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (27 loc) · 967 Bytes
Breadcrumbs
DriverInjectDll
/
misc.cpp
Copy path
File metadata and controls
29 lines (27 loc) · 967 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
include
"
misc.h
"
#
include
"
undocumented.h
"
ULONG
Misc::GetProcessIDFromProcessHandle
(
HANDLE
ProcessHandle)
{
PROCESS_BASIC_INFORMATION
PBI
;
if
(
NT_SUCCESS
(
Undocumented::ZwQueryInformationProcess
(ProcessHandle, ProcessBasicInformation, &
PBI
,
sizeof
(
PBI
),
NULL
)))
return
(
ULONG
)
PBI
.
UniqueProcessId
;
else
return
0
;
}
ULONG
Misc::GetProcessIDFromThreadHandle
(
HANDLE
ThreadHandle)
{
typedef
struct
_THREAD_BASIC_INFORMATION
{
NTSTATUS
ExitStatus;
PVOID
TebBaseAddress;
CLIENT_ID
ClientId;
KAFFINITY
AffinityMask;
KPRIORITY
Priority;
KPRIORITY
BasePriority;
}
THREAD_BASIC_INFORMATION
, *
PTHREAD_BASIC_INFORMATION
;
THREAD_BASIC_INFORMATION
TBI
;
if
(
NT_SUCCESS
(
Undocumented::ZwQueryInformationThread
(ThreadHandle, ThreadBasicInformation, &
TBI
,
sizeof
(
TBI
),
NULL
)))
return
PtrToUlong
(
TBI
.
ClientId
.
UniqueProcess
);
else
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL