很简单的一段代码,所有的字节都和0x71异或然后写入到文件。
[Java] 纯文本查看 复制代码 import java.util.Arrays;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class XorMain {
public static void main(String[] args) {
try {
Path path = Paths.get("Assembly-CSharp.dll");
byte[] bytes = Files.readAllBytes(path);
byte[] result = new byte[bytes.length];
for (int i = 0; i < bytes.length; i++) {
result[i] = (byte)((int)bytes[i] ^ 0x71);
}
path = Paths.get("Real.dll");
Files.write(path, result);
}
catch (IOException e) {
e.printStackTrace();
}
}
} |