|
Posted on 2006-03-31 23:26 云自无心水自闲 阅读(5664) 评论(23) 编辑 收藏 所属分类: 数据库
最近做一个项目的时候,需要将数据库从原先的SqlServer迁移到Oracle中。 需要迁移的不仅是数据还需要将表结构、存储过程、视图、触发器.... 所有东西都迁过去。 于是在网上搜索了一下,很快找到了www.swissql.com中提供了这样的工具。 但是能下载的是30天有效。只能转换2000行Sql文本的试用版。 自己动手、丰衣足食。开始破解: 1. 安装SwisSql 2. 把SwisSql的Lib目录下的SwisSql.jar, TSQL2PLSP.jar, TSQL2PLSPGUI.jar文件都反编译了. 我在NetBeans中新建了一个项目(因为看到, AbsoluteLayout.jar中有com.netbeans.的内容, 所以去下载安装了NetBeans, 不过根据其后的进程来看, 选用哪种JavaIDE并不重要) 3. 查看运行程序是 java -Dsun.java2d.noddraw=true -Djava.util.logging.config.file=%TSQL2PLSPHome%\conf\internal_conf\logging.properties -cp %CLASSPATH% com.vembu.project.gui.PL2JSQLForm 4. 看了一会PL2JSQLForm, 发现明显是经过混淆的, 比较复杂, 于是放弃了从头了解的念头, 专注于注册号生成的破解. 5. 运行SwisSql 6. 点击注册. 出来一个注册号输入框. 7. 选择对话框中提示字符串"Trial User"在项目中全字符, 大小写匹配搜索, 很快在中com.vembu.project.gui.a.java中找到. 而且整个项目中只有一个. 8. 在a.java中搜索一下"OK"字符串, 发现OK按钮的事件处理函数是_mthnew(actionevent); 在IDE中跳转到_mthnew的定义 9. 发现此函数的核心是 if(!c._mthif(s1)) { D.setText("Invalid key !!! Please ensure that the key is applied in the same machine as the one in which the RegInfo file was generated."); u.setSize(230, 125); u.setLocation(400, 300); u.show(); return; } 再次想跳转到_mthif的定义, 结果IDE无法正确跳转. 10. 没关系, 使用搜索大法. 在IDE中搜索 boolean _mthif(String , 搜索结果不多, 第一眼就看到了com.vembu.license.c.java, 再到a.java包头上一看果然有import com.vembu.license.c; 11. OK, 进入com.vembu.license.c.java, 找到_mthif(String)函数 12. b b1 = new b(); String[] as = b1._mthif(); 13. 仔细看一下b, 构造函数很长, 其实实际内容不多, 主要是取 MAC地址, 本机机器名, 本机IP地址. 其中_mthif()就返回MAC地址数组(因为可能有多个网卡, 所有是数组). b1._mthnew()返回机器名. 14. 将输入的注册号作为参数用_mthtry算出一个整数. 15. 将MAC地址, 机器名和 "Registered User for Multi File Select" 拼成一个字符串 16. 将第15步的字符串和14步算出的整数作为参数 用_mthdo算出一个新的字符串, 如果此字符串与注册号相同, 则此注册号是正确的. 17. _mthtry函数和_mthdo函数都是颇复杂的函数. 18. 想一个办法, 首先找一个8位的整数(作为14步生成的结果), 由于MAC地址和机器名是定的. 所以可以调用第16步_mthdo函数. 算出一个注册号, 再用这个注册号作为参数调用_mthtry, 去算那个整数, 如果这个整数与初始整数相等, 则此注册号有效. 19. 结果很快出来一堆的注册号, 在SwisSql中一用. OK了. 注册成功. 下面贴出我生成注册号的源代码.  /**//*
* LicenseValidate.java
*
* Created on 2006年3月30日, 下午1:39
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

package com.asiatom.dbmigrate;

 /** *//**
*
* @author ngCheng
*/
 public class LicenseValidate {
 private static final char b[] = {
'H', 'Z', 'T', 'R', 'B', 'L', 'Q', 'X'
};
 private static final char _fldbyte[] = {'U', 'S', 'C', 'M', 'P', 'V', 'W', 'K', 'N'};
 public static final char _flddo[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L'
};

 /** *//** Creates a new instance of LicenseValidate */
 public LicenseValidate() {
}
public static String LicenseOK(String s)
 {
String as[];
int i;
s = s.replaceAll(" ", "");
String MacAddr = "00-0A-EB-9B-80-1B";
String ClientName = "arthur";
i = 0;

String s1 = MacAddr + ClientName + "Registered User for Multi File Select";
int j = _mthtry(s.toUpperCase());
String s2 = _mthdo(s1, j).toUpperCase();
// System.out.println("s2: [" + s2 + "]");
if(s2.equals(s.toUpperCase()))
return "OK";
//System.out.println("not");
return s2;
}
public static int _mthtry(String s)
 {
String s2 = "";
String s3 = "HZTRBLQX";
String s4 = "USCMPVWKN";
String s1 = s.substring(1, 3) + s.substring(6, 8) + s.substring(9, 10) + s.substring(11, 13) + s.substring(14, 15);
for(int j = 0; j < s1.length(); j++)
 {
if(s3.indexOf(s1.charAt(j) + "") != -1)
 {
s2 = s2 + '9';
continue;
}
for(int k = 0; k < _fldbyte.length; k++)
if(s1.charAt(j) == _fldbyte[k])
s2 = s2 + k;

}

int i = 0x5f5e0ff - Integer.parseInt(s2);
return i;
}

private static String _mthdo(String s, int i)
 {
int j = 0;
s = s.toUpperCase();
String s1 = new String();
String s2 = new String();
String s3 = new String();
for(int k = 0; k < s.length(); k++)
if(!Character.isWhitespace(s.charAt(k)))
j ^= s.charAt(k);

j ^= j << 6;
int l = i * 3 + 3214;
int _fldnew = _mthif(l);
s1 = (j ^ _fldnew) + "";
s1 = _mthbyte(s1).toUpperCase();
s2 = a(i).toUpperCase();
s3 = s1.substring(0, 1) + s2.substring(0, 2) + s1.substring(1, 4) + s2.substring(2, 4);
s3 = s3 + s1.substring(4, 5) + s2.substring(4, 5) + s1.substring(5, 6) + s2.substring(5, 6) + s2.substring(6, 7) + s1.substring(6, 7) + s2.substring(7, 8) + s1.substring(7, 8);
String s4 = s3;
return s4;
}

public static int _mthif(int i)
 {
int j = 0xb524b;
boolean flag = false;
 int ai[] = {
19, 29, 23, 59, 53, 23, 31, 37, 41, 47,
3, 2, 5, 7, 11, 13
};
String s = "";
j = i;
for(int k = 0; k < 16; k++)
 {
String s1 = j + "";
if(s1.length() == 6)
break;
if(s1.length() < 6)
 {
j *= ai[k];
continue;
}
if(s1.length() > 7)
 {
j /= 100;
continue;
}
if(s1.length() > 6)
j /= 10;
}

return j;
}

public static String _mthbyte(String s)
 {
return a(s.getBytes());
}

public static String a(byte abyte0[])
 {
char ac[] = new char[((abyte0.length - 1) / 3 + 1) * 4];
int k1 = 0;
int l1;
for(l1 = 0; l1 + 3 <= abyte0.length;)
 {
int i = (abyte0[l1++] & 0xff) << 16;
i |= (abyte0[l1++] & 0xff) << 8;
i |= (abyte0[l1++] & 0xff) << 0;
int l = (i & 0xfc0000) >> 18;
ac[k1++] = _flddo[l];
l = (i & 0x3f000) >> 12;
ac[k1++] = _flddo[l];
l = (i & 0xfc0) >> 6;
ac[k1++] = _flddo[l];
l = i & 0x3f;
ac[k1++] = _flddo[l];
}

if(abyte0.length - l1 == 2)
 {
int j = (abyte0[l1] & 0xff) << 16;
j |= (abyte0[l1 + 1] & 0xff) << 8;
int i1 = (j & 0xfc0000) >> 18;
ac[k1++] = _flddo[i1];
i1 = (j & 0x3f000) >> 12;
ac[k1++] = _flddo[i1];
i1 = (j & 0xfc0) >> 6;
ac[k1++] = _flddo[i1];
ac[k1++] = '=';
} else
if(abyte0.length - l1 == 1)
 {
int k = (abyte0[l1] & 0xff) << 16;
int j1 = (k & 0xfc0000) >> 18;
ac[k1++] = _flddo[j1];
j1 = (k & 0x3f000) >> 12;
ac[k1++] = _flddo[j1];
ac[k1++] = '*';
ac[k1++] = '*';
}
return new String(ac);
}


public static String a(int i)
 {
String s1 = "";
int j = 0x5f5e0ff - i;
String s;
for(s = j + ""; s.length() < 8; s = "0" + s);
for(int k2 = 0; k2 < s.length(); k2++)
switch(k2)
 {
default:
break;

case 0: // '\0'
if(s.charAt(k2) == '9')
 {
s1 = s1 + b[k2];
} else
 {
int k = Integer.parseInt(s.charAt(k2) + "");
s1 = s1 + _fldbyte[k];
}
break;

case 1: // '\001'
if(s.charAt(k2) == '9')
 {
s1 = s1 + b[k2];
} else
 {
int l = Integer.parseInt(s.charAt(k2) + "");
s1 = s1 + _fldbyte[l];
}
break;

case 2: // '\002'
if(s.charAt(k2) == '9')
 {
s1 = s1 + b[k2];
} else
 {
int i1 = Integer.parseInt(s.charAt(k2) + "");
s1 = s1 + _fldbyte[i1];
}
break;

case 3: // '\003'
if(s.charAt(k2) == '9')
 {
s1 = s1 + b[k2];
} else
 {
int j1 = Integer.parseInt(s.charAt(k2) + "");
s1 = s1 + _fldbyte[j1];
}
break;

case 4: // '\004'
if(s.charAt(k2) == '9')
 {
s1 = s1 + b[k2];
} else
 {
int k1 = Integer.parseInt(s.charAt(k2) + "");
s1 = s1 + _fldbyte[k1];
}
break;

case 5: // '\005'
if(s.charAt(k2) == '9')
 {
s1 = s1 + b[k2];
} else
 {
int l1 = Integer.parseInt(s.charAt(k2) + "");
s1 = s1 + _fldbyte[l1];
}
break;

case 6: // '\006'
if(s.charAt(k2) == '9')
 {
s1 = s1 + b[k2];
} else
 {
int i2 = Integer.parseInt(s.charAt(k2) + "");
s1 = s1 + _fldbyte[i2];
}
break;

case 7: // '\007'
if(s.charAt(k2) == '9')
 {
s1 = s1 + b[k2];
} else
 {
int j2 = Integer.parseInt(s.charAt(k2) + "");
s1 = s1 + _fldbyte[j2];
}
break;
}

return s1;
}
 private static String incString(String s) {
String res = "";
s = s.toUpperCase();
boolean flag = false;
int i;
 for (i = s.length() - 1; i >= 0; i -- ) {
char ch = s.charAt(i);
 if ( ch == 'Z') {
flag = true;
res = "A" + res ;
 } else {
res = (char)(ch + 1) + res;
break;
}
}
res = s.subSequence(0, i) + res;
return res;
}

 public static void main(String args[]) {
//38238466
//Licen

String sMacAddr = "xx-xx-xx-xx-xx-xx";
String sMachineName = "machinename";
String s1 = sMacAddr + sMachineName + "Registered User for Multi File Select";
 for ( int i = 38200000; i < 38238466; i ++ ) {
String s2 = _mthdo(s1, i);
int mid = _mthtry(s2);
 if ( mid == i ) {
System.out.println("got: " + s2);
}
}
}
}

评论
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-04-01 23:10 by
可以直接修改class文件,让c._mthif函数返回true就可以了
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-04-03 09:15 by
不是这么简单的, 因为反编译出来的程序中出现了无数的错误.
根本无法编译通过.
所以采用了静态分析法.
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-04-05 15:54 by
搞不出来,方便的话给个注册码出来试试
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-04-06 16:42 by
注册码是和安装SwisSql机器的机器名和Mac地址有关的.
我无法给出一个通用的注册码.
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-07-11 11:01 by
String sMacAddr = "00-0F-EA-06-67-34";
String sMachineName = "pc174";
String s1 = sMacAddr + sMachineName + "estc";
生成很多的类似“MWSTIYKWNSZVMIWY”的码
我在 username 中输入 estc,
在下面的 key 中 依次输入 MWST-IYKW-NSZV-MIWY,提示无效的code!怎么回事?多谢指教!
msn:estc.wu@hotmail.com
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-10-24 10:27 by
通过提供的java ,产生了一堆key。
但是通过尝试,较难获得验证通过!
请版主指教,谢谢!!!
我的MSN :quexd@hotmail.com
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-10-24 15:15 by
你的SwisSql的版本是3.0吗?
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-10-26 09:35 by
我用的是3.0
请在MSN加我,ok?
我上班白天都在线。
谢谢!!!
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-12-14 00:35 by
LZ的方法可以用。
b[],_fldbyte[]和int l = i * 3 + 3214;中的3和3214以及各方法要相应替换。
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-12-16 20:44 by
@rui
能说得清楚点吗? 我没有看明白你的意思.
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-12-22 11:03 by
楼主大哥
不知道您给的这段代码不知道是在那里运行
方便的话,直接打包做成一个执行文件,运行就产生注册码
好像这样的东西叫做注册机
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-12-23 02:47 by
@在下
先将所有的代码都复制到一个文件中,LicenseValidate.java,注意路径。
然后 javac LicenseValidate.java,生成 LicenseValidate.class
然后 java LicenseValidate就可以运行了。
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-12-23 02:51 by
@estc
String s1 = sMacAddr + sMachineName + "Registered User for Multi File Select";
这个语句不能改成
String s1 = sMacAddr + sMachineName + "estc";
那个字符串是不能动的,否则生成的验证码就不正确了。
不知道Qxd是不是也是同样的问题。
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2006-12-27 18:42 by
你好请问一下这段话是什么意思
LZ的方法可以用。
b[],_fldbyte[]和int l = i * 3 + 3214;中的3和3214以及各方法要相应替换。
谢谢了
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2007-01-27 16:34 by
谢谢版主的文章!
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2007-10-14 15:55 by
可以用了
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记[未登录] 回复 更多评论
2007-11-20 11:03 by
很好,完全没问题,我用的3.2 SWISSQL的都能破解
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2008-03-11 11:02 by
楼主能给发破解版的吗
lbsfans(at)gmail.com
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2009-06-14 15:14 by
楼主我没搞定,按你说的:
先将所有的代码都复制到一个文件中,LicenseValidate.java,注意路径。
然后 javac LicenseValidate.java,生成 LicenseValidate.class
然后 java LicenseValidate就可以运行了。
运行时有错误,这几个文件要放在哪执行呀?我不懂JAVA。。。
明白人帮解释一下吧,谢谢我急用呀!
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2010-05-26 14:04 by
那请问注册时 username 输入什么呢?
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记 回复 更多评论
2013-05-08 15:41 by
可以把SwisSql Oracle to Sql Server3.0 软件给我发一份吗? 谢谢!
QQ:450519363 mail: 450519363@qq.com
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记[未登录] 回复 更多评论
2016-04-18 12:16 by
可以使用
# re: SwisSql Oracle to Sql Server3.0(一个从Oracle迁移到SqlServer数据库工具)的破解手记[未登录] 回复 更多评论
2016-04-18 12:17 by
把MAC地址和机器名换成自己的,运行程序就可以了 String sMacAddr = "xx-xx-xx-xx-xx-xx"; String sMachineName = "machinename";
|