背景是这样的,公司之前买的一个软件装在xp上,现在要迁移到新的服务器上,迁移遇到问题,安装完后需要输入注册码,之前做这个软件的公司已经倒闭,也没有文档,看了代码,不知道是怎么加密的
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.cwebs.common.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Date;
public class MachineCode {
private static String expiredString;
static {
try {
System.load(MachineCode.class.getResource("/").getFile() + "HDSID.properties");
} catch (Exception var13) {
System.out.println("HDSID.dll 加载错误!");
}
File f = new File(MachineCode.class.getResource("/").getFile() + "license.dat");
expiredString = null;
if (f != null && f.exists()) {
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(f));
expiredString = reader.readLine();
reader.close();
} catch (Exception var12) {
;
} finally {
if (reader != null) {
try {
reader.close();
} catch (Exception var11) {
;
}
}
}
}
}
public MachineCode() {
}
public static native String getHDSID();
public static native String getCPUSID();
public static native String getSID();
public static native String getDecryptionStr(String var0);
public static String getMachineCode() {
try {
return getHDSID();
} catch (Exception var1) {
System.out.println("获取注册码错误!");
return null;
}
}
public static boolean chcode(String deStr, String souStr) {
if (deStr != null && !deStr.equals("") && souStr != null && !souStr.equals("")) {
String _destr = getDecryptionStr(deStr);
if (_destr.length() > souStr.length()) {
_destr = _destr.substring(0, souStr.length());
}
return _destr.equals(souStr);
} else {
return false;
}
}
public static Date getExpired() {
String tempString = null;
if (expiredString != null) {
try {
DESPlus des = new DESPlus(getMachineCode());
tempString = des.decrypt(expiredString);
} catch (Exception var2) {
tempString = "1977-04-17";
}
} else {
tempString = "1977-04-17";
}
return C_Date.strTodate(tempString, "yyyy-MM-dd");
}
public static void main(String[] args) {
try {
DESPlus des = new DESPlus("B1B1AC094568C763DB");
System.out.println(des.encrypt("2013-12-30"));
} catch (Exception var2) {
;
}
}
}
license.dat 打开内容是这样的
1e8155d85ed62cc87ea60962dd2bc858
HDSID.properties的大概是这样的
有哪位知道是怎么加密的么,部署配置前还要安装vcredit.exe的软件
我有一计,先弄一个同名的类,编译成.class文件,再把他那个jar包以zip形式打开,把里面的.class文件替换成你自己写的,完工