利用 Asprise OCR 解析图形验证码

最新程序处理时需要一个图形验证码工具,依据图形验证码图片解析出图片,在网络上找了一大圈,发现还是Asprise OCR比较方便。

Asprise OCR项目地址:http://asprise.com/product/ocr/index.php?lang=java

 

 

Asprise OCR使用的例子在下载包中都有,下面的例子就是里面的demo:

/*
 * $Id$
 * 
 */
package com.asprise.util.ocr.demo;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

import javax.imageio.ImageIO;

import com.asprise.util.ocr.OCR;
import java.lang.IllegalArgumentException;

public class Demo {

	public static void main(String[] args) throws IOException, URISyntaxException {
		if(("1.4").compareTo(System.getProperty("java.vm.version")) > 0) {
			System.err.println("Warining: \n\nYou need Java version 1.4 or above for ImageIO to run this demo.");
			System.err.println("Your current Java version is: " + System.getProperty("java.vm.version"));
			System.err.println("\nSolutions: \n");
			System.err.println("(1) Download JRE/JDK version 1.4 or above; OR \n");
			System.err.println("(2) Run DemoUI, which can run on your current Java virtual machine.");
			System.err.println("    Double click the 'runDemoUI' to invoke it.\n");
			return;
		}
		String path = "d:\\1.png";		
		File file = new File(path);
		BufferedImage image = ImageIO.read(file);
		String s = new OCR().recognizeEverything(image);
		System.out.println("\n---- RESULTS: ------- \n" + s);
	}
	
}

 

由于试用版总是弹出一个确认付费的窗口,在网上找了一个closeWin.exe程序,在破解内容的时候,只需要打开该程序就可以实现批量破解。所有的资料都已经上传供下载了。有需要的自己拿去。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
坛子里有破解版的Asprise-OCR-Java,其原理就是利用开启CloseWin.exe窗口扫描有没有Asprise弹出过期的窗口,更具信息框的标题栏来判断是否要关闭此信息窗口。2011年7月以后的使用版无论是点击确定还是关闭按钮,都要跳转到Asprise网站。 此次真正破解的是AspriseOCR.dll这个文件。根据跟踪运行主要汇编代码如下: 10006CF4 . 50 push eax ; /pSystemTime 10006CF5 . FF15 C0931110 call dword ptr ds:[; \GetSystemTime 10006D19 . 68 02000080 push 0x80000002 ; |hKey = HKEY_LOCAL_MACHINE 10006D1E . FF15 10901110 call dword ptr ds:[; \RegCreateKeyExA 110006D39 . 68 9CA61110 push AspriseO.1011A69C ; |Title = "All rights reserved. Lab Asprise! (c) 1998-2008" 10006D3E . 68 D0A71110 push AspriseO.1011A7D0 ; |Text = "You are using the trial version of Asprise OCR. Do you want to remove this message box by buying a very affordable license from Lab Asprise? " 10006D53 . 68 98A71110 push AspriseO.1011A798 ; |FileName = "http://asprise.com/product/ocr/index.php?Ref=Eval" 由此可见,分析结果如下: 1.引用顺序 DevIL.dll ILU.dll AspriseOCR.dll AspriseJTwain.dll (DevIL.dll 是算法库) 2.使用 GetSystemTime获得系统的当前时间,和注册表里的键值(二进制格式,估计是第一次使用时间)处理运算,如果时间过期就会弹出信息框提醒需要购买license. 3.注册表中HKEY_LOCAL_MACHINE\SOFTWARE\Asprise OCR\ 有键值,试用版有键值现已将AspriseOCR.dll 破解,经过测试,将电脑时间调整到任何时间,都不会弹出信息框。 HKEY_LOCAL_MACHINE\SOFTWARE\Asprise OCR\ 如果以前运行过此类OCR,请将此注册表的键值先 删除。四个动态库可放到C:\WINDOWS\system32 下,也可以放到jre\bin下,或者是PATH 指定环境变量. 仅供个人学习使用。一份网站Asprise-OCR-Java原始Demo,一个破解文件 四个动态库。具体java Demo,参看原始Demo实例。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值