AS3: Decompiling via graph - good against obfuscators

This commit is contained in:
Jindra Pet��k
2013-02-08 22:31:47 +01:00
parent 5a422fd18f
commit 4a387a8df0
57 changed files with 1978 additions and 674 deletions
@@ -16,6 +16,10 @@
*/
package com.jpexs.asdec.helpers;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
/**
@@ -166,6 +170,14 @@ public class Helper {
sb.append(ss);
return sb.toString();
}
public static String padZeros(long number,int length){
String ret=""+number;
while(ret.length()<length){
ret="0"+ret;
}
return ret;
}
public static String bytesToHexString(byte bytes[], int start) {
StringBuilder sb = new StringBuilder();
@@ -235,4 +247,21 @@ public class Helper {
}
return ret;
}
public static Object deepCopy(Object o) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(o);
oos.flush();
oos.close();
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
Object copy = ois.readObject();
ois.close();
return copy;
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
}
}