'写入内存
'返回 =0 没成功，非0，成功
'WinErrorMsg(GetLastError) 查看出错信息
' MEM_Write(进程句柄 ,写入地址  ,内容地址 ,写入字节数  ) as  Long
Function MEM_Write(ByVal Pid as DWord, ByVal Addre as UInteger, ByVal lpBuffer as LPCVOID, ByVal Size as UInteger) as Long
   '储存进程标识符( Process Id )
   Dim phandle as HANDLE ' 储存进程句柄
   Dim I as Long
   phandle = OpenProcess(&H1F0FFF, 0, Pid)
   If phandle Then
      Function = WriteProcessMemory(phandle, Cast(LPVOID, Addre), lpBuffer, Size, 0)
   End If
   '关闭进程句柄-------------------------
   '最后通过传递进程句柄给 CloseHandle() 函数来关闭由 OpenProcess 打开的句柄。
   '关闭进程句柄
   CloseHandle phandle
End Function