到现在为止,我有这段代码(我知道它很丑,但这不是现在的重点)
我无法弄清楚如何发出以下系统调用并构建正确的结构来访问另一个进程的 PEB。
我想做以下事情:
HANDLE pHandle = OpenProcessNTSTATUS status = NtQueryInformationProcess(pHandle, 0, peb, peb_len, 0)代码:
from ctypes import *
from ctypes.wintypes import *
from _multiprocessing import win32
import argparse
class UNICODE_STRING(Structure):
_fields_ = [
("Length", USHORT),
("MaximumLength", USHORT),
("Buffer", c_wchar_p)
]
class RTL_USER_PROCESS_PARAMETERS(Structure):
_fields_ = [
("Reserved1", BYTE*16),
("Reserved2", BYTE*10),
("ImagePathName", UNICODE_STRING),
("CommandLine", UNICODE_STRING)
]
class PEB(Structure):
_fields_ = [
("Reserved1", BYTE*2),
("BeingDebugged", BYTE),
("Reserved2", BYTE),
("Rserved3", LPVOID),
("Ldr", LPVOID),
("ProcessParameters", POINTER(RTL_USER_PROCESS_PARAMETERS)),
("Reserved4", BYTE*104),
("Reserved5", LPVOID*52), …Run Code Online (Sandbox Code Playgroud)