Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Ctypes\uuuu readgsqword_Python_Windows_Winapi_Ctypes - Fatal编程技术网

Python Ctypes\uuuu readgsqword

Python Ctypes\uuuu readgsqword,python,windows,winapi,ctypes,Python,Windows,Winapi,Ctypes,在python中尝试返回PEB的值时,您会遇到类似的问题,在python中调用_readgsqword是不可能的 def GetPEB(): return ctypes.windll.kernel32.__readgsqword('0x0C',ctypes.sizeof('PVOID')) 正如文档中所解释的,这些函数是内在函数,不是内核32 dll导出的 您可以通过编译一个公开这些函数的DLL来调用它们,然后从Python代码中调用它 但是,使用不同的方法可能会更好。例如:如果想要获

在python中尝试返回PEB的值时,您会遇到类似的问题,在python中调用_readgsqword是不可能的

def GetPEB():
    return ctypes.windll.kernel32.__readgsqword('0x0C',ctypes.sizeof('PVOID'))

正如文档中所解释的,这些函数是内在函数,不是内核32 dll导出的

您可以通过编译一个公开这些函数的DLL来调用它们,然后从Python代码中调用它


但是,使用不同的方法可能会更好。例如:

如果想要获取当前进程的
PEB
地址,可以使用
RtlGetCurrentPeb()
AttributeError: function '__readgsqword' not found