| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 711 人关注过本帖
标题:VB相同的命令,修改不同的地址,一个成功一个失败,为什么?
只看楼主 加入收藏
y526892224
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2008-8-11
结帖率:100%
收藏
 问题点数:0 回复次数:0 
VB相同的命令,修改不同的地址,一个成功一个失败,为什么?
模块中:
Option Explicit

Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long

Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long

Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Public Declare Function ReadProcessMemory Lib "kernel32.dll" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByRef lpBuffer As Any, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long

Public Const PROCESS_ALL_ACCESS = &H1F0FFF

我得到一个游戏的地址,005C9AED我要将他的二进制数值修改成58 47 75 6E,我在VB中用如下命令
hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
If hProcess Then
Dim byts(0 To 3)    As Byte
          byts(0) = &H58:        byts(1) = &H47
          byts(2) = &H75:      byts(3) = &H6E
          WriteProcessMemory hProcess, ByVal &H5C9AED, ByVal VarPtr(byts(0)), 4, ByVal 0
CloseHandle hProcess
End If
试图将他修改,本以为不会有什么问题,但是进入游戏后却另我大失所望,----------跟修改前一样,完全没有
效果. 然后我用CE跳转到这个地址005C9AED,发现跟修改前一样,值一点变化也没有.然后我在CE里面
直接修改这个地址的值为58 47 75 6E,进入游戏,却发现成功了.请问为什么用VB修改失败了,用同样的命令
WriteProcessMemory hProcess, ByVal &H4BA724, ByVal VarPtr(byts(0)), 4, ByVal 0
修改地址:004BA724,却成功,而且用CE修改两个地址都成功.我的VB代码哪里出问题了吗?
搜索更多相关主题的帖子: 命令 地址 失败 
2008-09-24 12:08
快速回复:VB相同的命令,修改不同的地址,一个成功一个失败,为什么?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023002 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved