首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何使用ctype在python中创建int缓冲区

如何使用ctype在python中创建int缓冲区
EN

Stack Overflow用户
提问于 2019-06-10 04:49:11
回答 1查看 1.6K关注 0票数 1

我正在尝试用python写内存。我需要写一个整数,但是对于WriteProcessMemory函数,我需要一个缓冲区。

writeProcessMemory = kernel.WriteProcessMemory
writeProcessMemory.argtypes = [ctypes.wintypes.HANDLE, 
ctypes.wintypes.LPVOID, ctypes.wintypes.LPCVOID, ctypes.c_size_t, 
                         ctypes.POINTER(ctypes.c_size_t)]
writeProcessMemory.restype = ctypes.wintypes.BOOL


openProcess = kernel.OpenProcess
openProcess.argtypes = [ctypes.wintypes.DWORD, ctypes.wintypes.BOOL, 
ctypes.wintypes.DWORD]
openProcess.restype = ctypes.wintypes.HANDLE

handle = openProcess(PROCESS_ALL_ACCESS, False, pid)
addr = 0x024EA498
data = ctypes.c_int(1000)
buffer = #i need to create a buffer here
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56518278

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档