manlty 发表于 2010-12-4 17:24:05

内存读写的难题,请高手解惑

想做一个au3外挂程序,自动登录下图的一款期货交易软件,其中验证码那部分,我用读内存的办法取得验证码。




CE搜索的结果如下图



请高手解决一下,这种关于内存指针的编程

zch11230 发表于 2010-12-4 19:56:35

这个有点高级等高人答案
或者其实没有办法直接做到的话就用AU3先自动运行你这个软件读取出数值

manlty 发表于 2010-12-4 20:15:55

就是直接读不出这个验证码才想内存里找

处女 发表于 2010-12-5 06:01:58

来这个论坛是白来了, 没人会告诉你的,好人少啊~~~~~我的问题提了N天了,来看都没人看。。。。。。

qq342252004 发表于 2010-12-5 07:57:30

来这个论坛是白来了, 没人会告诉你的,好人少啊~~~~~我的问题提了N天了,来看都没人看。。。。。。
处女 发表于 2010-12-5 06:01 http://www.autoitx.com/images/common/back.gif
来看处女的人是不少的,可惜你不是处女。

netegg 发表于 2010-12-5 09:14:41

打开memory函数库的源文件,看看里面的_memread,或许会有帮助

manlty 发表于 2010-12-5 09:19:50

memory的各udf函数我都尝试过了,对于有明确的地址的内存读写都会,象这种指针:uxtheme.dll+1C3B这样的指针,无法用现有的UDF计算

netegg 发表于 2010-12-5 09:23:21

回复 7# manlty
;===================================================================================================
; Function........:_MemoryGetBaseAddress($ah_Handle, $iHD)
;
; Description.....:Reads the 'Allocation Base' from the open process.
;
; Parameter(s)....:$ah_Handle - An array containing the Dll handle and the handle of the open
;                                           process as returned by _MemoryOpen().
;                         $iHD - Return type:
;                          |0 = Hex (Default)
;                          |1 = Dec
;
; Requirement(s)..:A valid process ID.
;
; Return Value(s).:On Success - Returns the 'allocation Base' address and sets @Error to 0.
;                  On Failure - Returns 0 and sets @Error to:
;                                                |1 = Invalid $ah_Handle.
;                                                |2 = Failed to find correct allocation address.
;                                                |3 = Failed to read from the specified process.
;
; Author(s).......:Nomad. Szhlopp.
; URL.............:http://www.autoitscript.com/forum/index.php?showtopic=78834
; Note(s).........:Go to Www.CheatEngine.org for the latest version of CheatEngine.
;===================================================================================================
Func _MemoryGetBaseAddress($ah_Handle, $iHexDec = 0)
   
    Local $iv_Address = 0x00100000
        Local $v_Buffer = DllStructCreate('dword;dword;dword;dword;dword;dword;dword')
        Local $vData
        Local $vType
       
    If Not IsArray($ah_Handle) Then
      SetError(1)
      Return 0
    EndIf
   

    DllCall($ah_Handle, 'int', 'VirtualQueryEx', 'int', $ah_Handle, 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer))
   
    If Not @Error Then
      
      $vData = Hex(DllStructGetData($v_Buffer, 2))
      $vType = Hex(DllStructGetData($v_Buffer, 3))
      
      While $vType <> "00000080"
            DllCall($ah_Handle, 'int', 'VirtualQueryEx', 'int', $ah_Handle, 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer))
            $vData = Hex(DllStructGetData($v_Buffer, 2))
            $vType = Hex(DllStructGetData($v_Buffer, 3))
            If Hex($iv_Address) = "01000000" Then ExitLoop
            $iv_Address += 65536
            
      WEnd

      If $vType = "00000080" Then
            SetError(0)
            If $iHexDec = 1 Then
                Return Dec($vData)
            Else
                Return $vData
            EndIf
            
      Else
            SetError(2)
            Return 0
      EndIf
      
    Else
      SetError(3)
      Return 0
    EndIf
   
EndFunc那就试试这个

chenronting 发表于 2010-12-5 14:29:50

如果不是平时这么一顶一顶的, 也许我的钱钱就会慢慢没掉~

manlty 发表于 2010-12-5 14:40:27

怎么知道uxtheme.dll这个指针对应的数值呢

netegg 发表于 2010-12-6 03:05:40

回复 10# manlty

$ah_Handle - An array containing the Dll handle and the handle of the openprocess as returned by _MemoryOpen().

处女 发表于 2010-12-6 05:56:32

顶一顶吧,希望早日能够得到答案

manlty 发表于 2010-12-6 16:28:42

回复 11# netegg
不知道是不是我没看懂这个UDF的参数说明,好像对这种没有单独进程的dll是无效的,因为软件运行的时候这个dll只是主程序的一个动态链接库,在需要的时候调一下而已,反正我用_memoryopen( ProcessExists("uxtheme.dll"))没有结果

飘云 发表于 2010-12-6 16:44:15

CE虽然会显示出某某+地址这样,但是其实一般用0x00400000+地址应该就是基址了

jaymin 发表于 2010-12-7 19:43:11

读内容不是好办法~~
页: [1] 2 3
查看完整版本: 内存读写的难题,请高手解惑