ntopenprocess WriteProcessMemory
EN:
This function writes memory in a specified process. The entire area to be written to must beaccessible, or the operation fails.
BOOL WriteProcessMemory(
HANDLE hProcess,
LPVOID lpBaseAddress,
LPVOID lpBuffer,
DWORD nSize,
LPDWORD lpNumberOfBytesWritten
);
Parameters
hProcess
[in] Handle returned from the OpenProcess function that provided full access to the process.
lpBaseAddress
[in] Pointer to thebase addressin the specified process.
Before data transfer occurs, the system verifies that all data in the base address and memory of the specified size is accessible for write access. If so, the functionproceeds; otherwise, the function fails.
lpBuffer
[in] Pointer to the buffer that supplies data to be written into the address space of the specified process.
nSize
[in] Specifies the requested number of bytes to write into the specified process.
lpNumberOfBytesWritten
[out] Pointer to the number of bytes transferred into the specified process.
This parameter is optional.
If lpNumberOfBytesWritten is NULL, the parameter is ignored.
Return Values
Nonzero indicates success.
Zero indicates failure.
To get extended error information, call GetLastError.
The function fails if the requested write operation crosses into an area of the process that isinaccessible.
Remarks
WriteProcessMemory copies data from the specified buffer in the current process to the address range of the specified process. The process whose address space is being written to is typically, but not necessarily, being debugged.
The entire area to be written to must be accessible. If it is not, the function fails.
Requirements
OS Versions: Windows CE 2.0 and later.
Header: Winbase.h.
Link Library: Nk.lib.
See Also
OpenProcess |ReadProcessMemory
---------------------------------------------------------------------------------------------
ch:
WriteProcessMemory
VB函数原型:
Declare Function WriteProcessMemory Lib kernel32 (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
作用:写内存
说明:
hProcess , 进程的句柄
lpBaseAddress, 进程地址
lpBuffer, 数据存放地址
nSize, 数据的长度
lpNumberOfBytesWritten,实际数据的长度
nSize以字节为单位,一个字节Byte等于8位
基本数据类型的长度
ShortInt 8位 = 1Byte
SmallInt 16位 = 2Byte
Integer 16位 = 2Byte
LongInt 32位 = 4Byte
Word 16位 = 2Byte
LongWord 32位 = 4Byte
Boolean 8位 = 1Byte
WordBool 16位 = 2Byte
LongBool 32位 = 4Byte
比如要写入Integer类型的数据,那么Integer长度2Byte
所以nSize = 2
更多阅读
恋上黑天使剧情介绍 第33集分集剧情 麻雀分集剧情介绍33
2010不懂女人剧情介绍 第40集分集剧情 江湖小子40集分集剧情
聚焦证券行业巨变 抓住行业巨变的机会
红星美凯龙集团董事长车建新“炮轰”美乐乐家居网并非单纯的个人恩怨,而是基于更为复杂的产业纠纷:电商的盛行使得传统家居卖场纯粹成了“试衣间”,完全为他人做嫁衣。 “我们是传统家居卖场的‘杀手’,同样一款实木家具,我
创业者的赚钱系统 14大秘籍助你创业赚钱
绝招一:创业项目以“新”取胜 强手过招,靠什么取胜?靠创意。在快速变迁的时代中,突破过去的框架,掌握新的环境,面对新的课题,迎接新的挑战,才能赢得新的财富。绝招二:“无中生有”开拓销售渠道销售渠道是小企业创业的命门,对创业企业来说,
第3节:求职之径行“职”遂·开篇语(1)
系列专题:《求职秘笈:求职者的圣经·求职篇》 求职之径行“职”遂·开篇语 “径行‘职’遂”——它不是成语,是“径行直遂”这个成语生造而来的,只改了一个字,但它们的释义是相同的,既然我们谈得是职场中事,那就让它更为贴切些。径