标签:file Java String FLV br File new println EV1
EV1解密文件见附件。
请自行添加到环境变量中(win下面的ev1_decode.exe),如果你是linux或macos用户请自行编写java代码。
解密命令:ev1_decode 这里写文件路径
<code>import sun.nio.cs.ext.GBK; import java.io.*; import java.nio.<a href="https://www.gaodaima.com/tag/chars" title="查看更多关于chars的文章" target="_blank">chars</a>et.Charset; public class EV1Converter { static String path = "D:\\Download\\ARKDownLoad\\CCDownLoad"; static String baseCommand="ev1_decode %s"; public static void main(String[] args) { //要遍历的路径 File file = new File(path); //获取其file对象 try { func(file); } catch (IOException e) { throw new RuntimeException(e); } } public static void func(File file) throws IOException { File[] fs = file.listFiles(); for (File f : fs) { if (f.isDirectory()) //若是目录,则递归打印该目录下的文件 { System.out.println("当前位于" + f.getAbsolutePath()); // converter(f.getAbsolutePath()); } if (f.isFile()) //若是文件,直接打印 System.out.println("当前发现" + f); if(f.getName().matches(".+ev1")){ System.out.println("发现一个EV1文件,执行命令..."); System.out.println(f.getPath()); converter(f.getPath()); } } } public static void converter(String path) throws IOException { String newCommand=String.format(baseCommand,path); execCommand(newCommand); } public static void execCommand(String command) { BufferedReader br = null; try { File file = new File("daemonTmp"); File tmpFile = new File("daemonTmp\\temp.tmp");//新建一个用来存储结果的缓存文件 if (!file.exists()) { file.mkdirs(); } if (!tmpFile.exists()) { tmpFile.createNewFile(); } ProcessBuilder pb = new ProcessBuilder().command("cmd.exe", "/c", command).inheritIO(); pb.redirectErrorStream(true);//这里是把控制台中的红字变成了黑字,用通常的方法其实获取不到,控制台的结果是pb.start()方法内部输出的。 pb.redirectOutput(tmpFile);//把执行结果输出。 pb.start().waitFor();//等待语句执行完成,否则可能会读不到结果。 InputStream in = new FileInputStream(tmpFile); br = new BufferedReader(new InputStreamReader(in, Charset.forName("GBK"))); String line = null; //好像可以用printWriter向cmd输出新玩意 while ((line = br.readLine()) != null) { System.out.println(line); } br.close(); br = null; tmpFile.delete();//卸磨杀驴。 System.out.println("执行完成"); } catch (Exception e) { e.printStackTrace(); } finally { if (br != null) { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } } }
下载EV1解码工具
标签:file,Java,String,FLV,br,File,new,println,EV1
来源: https://www.cnblogs.com/6543×1/p/16389692.html