WriteProcessMemory 错误
Dim hwnd As Long: Dim Pid As Long: Dim str As Long ' 存储显示文本Dim nSize As Long: Dim pHandle As Long
'---------------------------------
Dim a As Long
a = &H5A3ADE
Dim Number As Byte
Number = &H27
'----------------------------------
hwnd = FindWindow("⒊ 眏跌怠", vbNullString)
GetWindowThreadProcessId hwnd, Pid
pHandle = OpenProcess(&H1F0FFF, False, Pid)
plv = (VirtualAllocEx(pHandle, 0&, 2, MEM_RESERVE Or MEM_COMMIT, PAGE_READWRITE))
Form1.Text3.Text = Hex(plv)
'-------在此以上均成功-----
Form1.Text2.Text = WriteProcessMemory(pHandle, VarPtr(a), Number, 2, 0&)
Call ReadProcessMemory(pHandle, ByVal &H5A3ADE, str, 2, 0&)
‘---ReadProcessMemory 也能得到正确结果----’
CreateRemoteThread pHandle , 0, 0, plv, 0
'关闭进程句柄
CloseHandle hProcess
Form1.Text1.Text = (str)