在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/Java  Linux/ 哪位同學(xué)知道這個(gè)是怎么加密的么

哪位同學(xué)知道這個(gè)是怎么加密的么

背景是這樣的,公司之前買(mǎi)的一個(gè)軟件裝在xp上,現(xiàn)在要遷移到新的服務(wù)器上,遷移遇到問(wèn)題,安裝完后需要輸入注冊(cè)碼,之前做這個(gè)軟件的公司已經(jīng)倒閉,也沒(méi)有文檔,看了代碼,不知道是怎么加密的

//
// 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 加載錯(cuò)誤!");
        }

        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("獲取注冊(cè)碼錯(cuò)誤!");
            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 打開(kāi)內(nèi)容是這樣的
1e8155d85ed62cc87ea60962dd2bc858

HDSID.properties的大概是這樣的

clipboard.png

有哪位知道是怎么加密的么,部署配置前還要安裝vcredit.exe的軟件

回答
編輯回答
話寡

我有一計(jì),先弄一個(gè)同名的類(lèi),編譯成.class文件,再把他那個(gè)jar包以zip形式打開(kāi),把里面的.class文件替換成你自己寫(xiě)的,完工

2017年11月26日 21:36
編輯回答
短嘆

樓上正解,只要把比較的邏輯改成能判斷過(guò)就行了,不需要管原來(lái)的加密邏輯,

clipboard.png

這個(gè)方法返回值改成true

2018年7月14日 03:56