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
更多阅读
转载 民政部《关于支持社会力量兴办社会福利机构的意见》 福利视频快转载5
原文地址:民政部《关于支持社会力量兴办社会福利机构的意见》作者:gahysm
转载 网络文案编辑需要具备的技能 文案编辑
原文地址:网络文案编辑需要具备的技能作者:浅醉微醺的博客网络编辑是随着网络的发展而新兴的职业,是网站内容的建设者,一个网站内容的好坏及一个网站的受欢迎程度很大程度上是由网络编辑决定的,在整个网络运营中的作用是很重要的。因此为
在北上广打拼的年轻人 一无所有年轻人的北京打拼路
这是一个至今还在打拼的年轻创业者真实的创业历程。他历尽艰辛,从一无所有甚至要去拾垃圾到成立公司,创立自己的运动装加盟品牌,用了整整八个月时间。相信他的创业过程能给创业者提供最好的借鉴。 2003年6月10号。非典还没完
党组制度的历史沿革 军功章 军功章-历史沿革,军功章-授予制度
军功章是专门奖励在军队作战、训练、执勤、科研等军队建设中,作出突出成绩的立功人员的奖章。军功章_军功章 -历史沿革?我军颁发奖章始于土地革命战争时期。历史上影响较大的全军集中颁发证章主要有3次,分别是:1933年“八一”建军节
故弄玄虚 故弄玄虚 故弄玄虚-发音,故弄玄虚-释义
故弄玄虚,中国成语,意思就是用欺骗手段来欺骗别人;故意用难以捉摸的言辞,使人感到高深莫测。故弄玄虚_故弄玄虚 -发音故弄玄虚gùnòngxuánxū发音技巧:弄,不能读作“lòn