解密 Java 中的 .SWF 文件
Decrypt .SWF File in Java
我最近几个小时一直在努力解密 swf 文件,I am following this Code 但是当我尝试 运行 这段代码时,我得到了这个异常:
Exception in thread "main" java.lang.IllegalArgumentException
这是代码:
public static void main(String[] args) {
FileTest decrypter = new FileTest();
try {
File inputFile = new File("game.swf");
InputStream inputStream = new FileInputStream(inputFile);
ByteBuffer buffer = ByteBuffer.allocate((int) inputFile.length());
inputStream.read(buffer.array());
decrypter.handle(buffer, new File("output.swf")); //**gives Exception**
} catch (IOException e) {
e.printStackTrace();
}
}
目标是读取 game.swf
加密文件并在 output.swf
中解密。
谢谢
好吧,您并没有添加那个 class 的所有函数和静态方法。尝试像文件代码一样添加所有这些方法及其当前代码。我删除了所有代码,因为有很多输入,但这个东西可以工作 你当然需要在你的 main class 中使用所有这五个方法和代码。
public static void decompress(byte[] data, File outputFile)
public void unpack(ByteBuffer buffer, File outputFile)
private void handle(ByteBuffer buffer, File outputFile)
private ByteBuffer removeNonce(ByteBuffer buffer)
private ByteBuffer decrypt(ByteBuffer buffer)
我最近几个小时一直在努力解密 swf 文件,I am following this Code 但是当我尝试 运行 这段代码时,我得到了这个异常:
Exception in thread "main" java.lang.IllegalArgumentException
这是代码:
public static void main(String[] args) {
FileTest decrypter = new FileTest();
try {
File inputFile = new File("game.swf");
InputStream inputStream = new FileInputStream(inputFile);
ByteBuffer buffer = ByteBuffer.allocate((int) inputFile.length());
inputStream.read(buffer.array());
decrypter.handle(buffer, new File("output.swf")); //**gives Exception**
} catch (IOException e) {
e.printStackTrace();
}
}
目标是读取 game.swf
加密文件并在 output.swf
中解密。
谢谢
好吧,您并没有添加那个 class 的所有函数和静态方法。尝试像文件代码一样添加所有这些方法及其当前代码。我删除了所有代码,因为有很多输入,但这个东西可以工作 你当然需要在你的 main class 中使用所有这五个方法和代码。
public static void decompress(byte[] data, File outputFile)
public void unpack(ByteBuffer buffer, File outputFile)
private void handle(ByteBuffer buffer, File outputFile)
private ByteBuffer removeNonce(ByteBuffer buffer)
private ByteBuffer decrypt(ByteBuffer buffer)