首页
社区
课程
招聘
[求助]如何读取内存中的数值
发表于: 2004-12-18 21:17 5078

[求助]如何读取内存中的数值

2004-12-18 21:17
5078
我是个菜鸟,请问用VB如何读出内存中的数值?我只会用ReadProcessMemory读取用ASCⅡ表示的数值,但下面的数值如何读取?
例如地址:010A04B0:A8 4F 32 0A 00 00 00 00 00 00 00 00 00 00 00 00
我知道这个地址存的是171069352,请说详细些,谢谢了

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 1
支持
分享
最新回复 (11)
雪    币: 390
活跃值: (707)
能力值: ( LV12,RANK:650 )
在线值:
发帖
回帖
粉丝
2
兄弟,建议你先学汇编:D

171069352=$A324FA8

看出来了吗?
2004-12-18 21:53
0
雪    币: 5
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
谢谢,它俩相等我知道,我就是不知道在vb中如何将a84f320a取出并转换为171069352,用ASC()好像不行,不知应该如何转换?
2004-12-18 22:00
0
雪    币: 5
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
在vb中如何把0a84f32转换为171069352啊,怎么没人帮我啊,为什么?是我没说清楚还是这个问题太简单了不值得回答啊,我在网上搜索了好长时间也没找到,各位大哥帮帮我好吗?在些万分感谢!!!!
2004-12-19 09:12
0
雪    币: 4833
活跃值: (2218)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
5
16进制转换为10进制
2004-12-19 10:38
0
雪    币: 5
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
谢谢各位,我可能没说清楚,我再详细说一下,请大家帮帮我。
我在学习用VB做一个游戏修改器,在内存中找到了存放各种属性数值的位置。如下面地址存放的是生命值168
例如地址:010A04B0:A8 00 00 00 00 00 .......
我写的读取此数的部分代码如下
Dim str6 As String * 1
......
......
ReadProcessMemory hOK, &H10A04B0, str6, 1, 0&
MsgBox (ASC(str6))

结果得到的却是"o",是不是ASC()只能处理ASCⅡ小于127的数。
请问在VB中应该怎么写才能正确的读出该数值,我是新手请大家说详细些,谢谢了!!!
2004-12-19 11:47
0
雪    币: 208
活跃值: (376)
能力值: ( LV12,RANK:330 )
在线值:
发帖
回帖
粉丝
7
参考一下吧

Private Function ReadMemory(hWnd As Long, Address As Long, Bytes As Long, Optional strReplaceWith As String) As String
    'Runs For Not Unicode Strings (VB-Strings)
    On Error Resume Next
    Dim pId As Long        ' Used to hold the Process Id
    Dim pHandle As Long    ' Holds the Process Handle
    Dim bytValue As Long   'Stores the value of a byte in the memory
    Dim i As Long
    Dim Text As String
   
    ' Get the ProcId of the Window
    GetWindowThreadProcessId hWnd, pId

    ' use the pId to get a handle
    pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pId)
   
    If (pHandle = 0) Then
         'MsgBox "Unable to open process!"
         Exit Function
    End If
    If Address = 0 Then Exit Function
   
    For i = 1 To Bytes Step 2
       ' Read Byte to Byte
       ReadProcessMemory pHandle, Address + i - 1, bytValue, 1, 0&
       'value now contains the long value of the byte located in [Address + i - 1] pos.
       'ReadMemory is a string...
      
       ReadMemory = ReadMemory & Chr$(bytValue)
    Next
    'to write numeric values you can ..(Must) use WriteValue API
    If LenB(strReplaceWith) <> 0 Then
        'No Unicode!!
        WriteString pHandle, Address, StrPtr(strReplaceWith), LenB(strReplaceWith), 0&
    End If
    'Close the Handle
    CloseHandle pHandle
End Function
2004-12-19 15:04
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
8
但是我有一个问题请教各位大侠:
根据上面的讨论,我想了解一下:
010A04B0:A8 4F 32 0A 00 00 00 00 00 00 00 00 00 00 00 00
上面的内存地址中为什么只有前32Byte有用呢?后面的00 00 等表示的又是什么意思呢?
非常谢谢!!
2004-12-20 10:14
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
9
那位大侠可以告诉我:
0023:0012EA10    E0  E5  41  00  40  F3  12  00 -7C  EA  12  00  F6  CD  40  00
上面的内存中存的是什么字符串?
非常谢谢!!
2004-12-20 11:00
0
雪    币: 211
活跃值: (40)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
10
A8 4F 32 0A 00 00 00 00 00 00 00 00 00 00 00 00
低位-------------------------------------〉高位

实际就是:
0000000000000000000000000A324FA8

OK?
2004-12-20 11:04
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
11
Thank you very much!
2004-12-20 11:27
0
雪    币: 206
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
12
我也在写修改器,请教上面个位说的我明白,但是不知如何使用VB解决动态内存的问题?是不是需要补丁技术?
2004-12-23 18:36
0
游客
登录 | 注册 方可回帖
返回
//