找回密码
 加入
搜索
楼主: manlty

[AU3基础] 内存读写的难题,请高手解惑

 火... [复制链接]
发表于 2010-12-9 11:23:25 | 显示全部楼层
这个验证码应该很好识别啊。
发表于 2010-12-10 14:54:54 | 显示全部楼层
回复 8# netegg
高手如云啊,学习!
发表于 2010-12-11 08:54:13 | 显示全部楼层
看到标题,想来学习一下,不过没看到。。。期待高人出场
发表于 2010-12-11 09:32:21 | 显示全部楼层
我晕,这么简单问题没人能回答啊?
uxtheme.dll+1C3B其实就是DLL的入口地址+1C3B
你不是用CE吗?或者用CE监视谁访问这个地址,然后刷新验证码,
监视到的信息里有1个值  类似mov     eax, dword ptr [esi+164]
esi的值就是uxtheme.dll+1C3B
 楼主| 发表于 2010-12-11 16:23:44 | 显示全部楼层
本帖最后由 manlty 于 2010-12-11 16:46 编辑

回复 34# piaorou


这位朋友,本来就是通过比如你说的 [esi+164]才找到上一级指针uxtheme.dll+1C3B 而这也是CE最终能找到的了。  现在就是想知道怎么计算dll的入口地址,因为能确定esi这个值的内存地址是每次运行都会不同的
 楼主| 发表于 2010-12-11 16:54:08 | 显示全部楼层
有没有朋友有现成的OCR代码能读取这个验证码,能给出一段吗?
附件是这个验证码的训练图片,各位能提供全套的识别吗

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-12-20 14:26:43 | 显示全部楼层
有没有朋友有现成的OCR代码能读取这个验证码,能给出一段吗?
附件是这个验证码的训练图片,各位能提供全套 ...
manlty 发表于 2010-12-11 16:54
#include <GDIPlus.au3>

_GDIPlus_Startup ()

$sBmpFile = @ScriptDir & "\031.bmp";要识别的文件
$hBitmap = _GDIPlus_BitmapCreateFromFile($sBmpFile)

$sOcr = ""
For $i=1 To 4
        $hClone = _GDIPlus_BitmapCloneArea($hBitmap, 8+($i-1)*7, 4, 6, 11, $GDIP_PXF24RGB)
        ;_GDIPlus_ImageSaveToFile($hCLone,@ScriptDir&""&$i&".bmp")
        $aBmpData = _myReadBitmapMsg($hClone)
        ;ConsoleWrite($aBmpData[0]&@crlf)
        Switch $aBmpData[0]
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0C86400C86400C86400F5F3F0F5F3F0"
                $sOcr &= "9"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400C86400C86400C86400F5F3F0"
                $sOcr &= "5"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400C86400C86400F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400C86400C86400C86400F5F3F0"
                $sOcr &= "6"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0C86400C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400C86400C86400C86400F5F3F0"
                $sOcr &= "3"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0"
                $sOcr &= "1"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400C86400C86400C86400F5F3F0"
                $sOcr &= "8"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400C86400C86400C86400F5F3F0"
                $sOcr &= "0"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0C86400F5F3F0C86400F5F3F0F5F3F0C86400F5F3F0F5F3F0C86400F5F3F0F5F3F0C86400F5F3F0F5F3F0C86400F5F3F0C86400C86400C86400C86400C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0"
                $sOcr &= "4"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400C86400C86400"
                $sOcr &= "2"
        Case "F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400C86400C86400C86400C86400C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0F5F3F0C86400F5F3F0F5F3F0F5F3F0F5F3F0"
                $sOcr &= "7"
        EndSwitch
Next
ConsoleWrite("识别结果:" & $sOcr & @crlf)

_GDIPlus_ImageDispose ($hClone)
_WinAPI_DeleteObject ($hClone)
_GDIPlus_ImageDispose ($hBitmap)
_WinAPI_DeleteObject ($hBitmap)
_GDIPlus_ShutDown ()

Func _myReadBitmapMsg($hBitmap);
        Local $aBmpData[4]
    $aBmpData[1] = _GDIPlus_ImageGetWidth ($hBitmap)
    $aBmpData[2] = _GDIPlus_ImageGetHeight ($hBitmap)
        Local $BitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $aBmpData[1], $aBmpData[2], $GDIP_ILMREAD, $GDIP_PXF24RGB);$aGdip[0]);
        $aBmpData[3] = Abs(DllStructGetData($BitmapData, "Stride"))
        Local $Scan0 = DllStructGetData($BitmapData, "Scan0");
        Local $pixelData = DllStructCreate("ubyte lData[" & ($aBmpData[3] * $aBmpData[2]) & "]", $Scan0)
        $aBmpData[0] = DllStructGetData($pixelData, "lData")
        _GDIPlus_BitmapUnlockBits($hBitmap, $BitmapData)
        $aBmpData[0] = StringRegExpReplace($aBmpData[0], "(?:0x)?([0-9A-F]{"&$aBmpData[1]*6&"}).{"&$aBmpData[3]*2-$aBmpData[1]*6&"}", "$1")
        Return $aBmpData
EndFunc
 楼主| 发表于 2010-12-21 07:57:15 | 显示全部楼层
谢谢楼上大大
发表于 2010-12-21 11:04:59 | 显示全部楼层
等高人给出答案
发表于 2011-1-4 02:29:22 | 显示全部楼层
回复 8# netegg


    这个函数是找不到DLL的入口地址的, 得需要用和他类似的一个函数,哈哈。
 楼主| 发表于 2011-1-4 09:27:18 | 显示全部楼层
希望楼上不吝赐教
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-23 13:42 , Processed in 0.069529 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表