|
@@ -0,0 +1,61 @@
|
|
|
+package QuickVerifyCrap;
|
|
|
+
|
|
|
+import de.nplusc.izc.tools.IOtools.FileTK;
|
|
|
+
|
|
|
+import java.io.File;
|
|
|
+import java.io.RandomAccessFile;
|
|
|
+import java.util.ArrayDeque;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Queue;
|
|
|
+
|
|
|
+public class HeaderGTFO {
|
|
|
+ public static void main(String[] args) throws Exception{
|
|
|
+
|
|
|
+ Queue<File> files = new ArrayDeque<>();
|
|
|
+
|
|
|
+
|
|
|
+ String basepath = "N:\\scratchspace\\KOTOR1\\s2";
|
|
|
+ File[] tempfiles = new File(basepath).listFiles();
|
|
|
+
|
|
|
+ files.addAll(Arrays.asList(tempfiles));
|
|
|
+
|
|
|
+ File f = files.poll();
|
|
|
+
|
|
|
+ while(f!=null)
|
|
|
+ {
|
|
|
+ String fn = f.getName();
|
|
|
+ System.out.println(f.getName());
|
|
|
+ if(fn.equals("fixed"))
|
|
|
+ {
|
|
|
+ f = files.poll();
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ String relpath = FileTK.getRelativePath(f.getPath(),basepath);
|
|
|
+ String fixedpath = basepath+"\\fixed\\"+relpath;
|
|
|
+ if(f.isDirectory())
|
|
|
+ {
|
|
|
+ files.addAll(Arrays.asList(f.listFiles()));
|
|
|
+ f = files.poll();
|
|
|
+ new File(fixedpath).mkdirs();
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ RandomAccessFile in = new RandomAccessFile(f,"r");
|
|
|
+ RandomAccessFile out = new RandomAccessFile(fixedpath,"rw");
|
|
|
+ in.seek(200);
|
|
|
+ byte[] content = new byte[((int)f.length())-470];
|
|
|
+ int readsize = in.read(content);
|
|
|
+ if(readsize!=content.length)
|
|
|
+ {
|
|
|
+ System.out.println("Zarf");
|
|
|
+ }
|
|
|
+ out.write(content);
|
|
|
+ out.close();
|
|
|
+ in.close();
|
|
|
+
|
|
|
+ f = files.poll();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|