?? hack.java
字號:
/** @(#)Hack.java version 1.0 Jeffrey M Wheaton*//* * Copyright (C) 2003 Jeffrey M Wheaton * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA, 02111-1307 USA */import java.util.*;import java.io.*;/**This is the hack for the program. Sorry it is so easy. See theSTEPS file for the steps needed to decrypt files encrypted with thisprogram. This file cannot be compiled until the CryptLoader classhas been hacked (either by decompilation or direct editing of the class file).I am currently working on a way of preventing this type of program fromworking, but until then be very aware that this is all a person has todo to break the code. So in my opinion this method of encryptionis unsafe =(.@author Jeffrey M Wheaton@version version 1.0*/public class Hack extends CryptLoader{ /**Variable used for debugging.*/ private static boolean debug = false; /**This constructor simply hacks the given file with the given key and saves the decrypted version in a file called "thefile". This method should be edited to account for the module used for encryption. This version assumes the use of the default blowfish module provided with the application. */ public Hack(String className, String key)throws Exception{ /*This is just to get the loader's map variable initialized so that the class files can be decrypted easier.*/ super(new File("SimpleEncryption.jar"), key, "BFishMod" ); //edit the jar file and the module name byte[] encryptedVersion = (byte[])map.get(className); //replace this object with the correct module used for encryption BFishMod decrypt = new BFishMod(); byte[] keya = convertKey(key); decrypt.setKey(keya); File file = new File("decrypted"); BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(file)); os.write(encryptedVersion, 0, encryptedVersion.length); os.flush();os.close(); byte[] decryptedVersion = decrypt.decrypt(file); file.delete(); os = new BufferedOutputStream(new FileOutputStream(new File("thefile"))); os.write(decryptedVersion, 0, decryptedVersion.length); os.flush();os.close(); } public static void main(String[] args)throws Exception{ if(debug){ System.out.println("Testing Hack"); } if(args.length != 2){ System.out.println("Usage: java Hack fileToDecrypt key"); System.exit(0); } Hack j = new Hack(args[0], args[1]); if(debug){ System.out.println("Test complete"); } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -