得到class文件我直接拖进idea了
// // Source code recreated from a .class file by IntelliJ IDEA // (powered by FernFlower decompiler) // import java.util.ArrayList; import java.util.Scanner; public class Reverse { public Reverse() { } public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println("Please input the flag :"); String str = s.next(); System.out.println("Your input is :"); System.out.println(str); char[] stringArr = str.toCharArray(); Encrypt(stringArr); } public static void Encrypt(char[] arr) { ArrayListResultlist = new ArrayList(); for(int i = 0; i < arr.length; ++i) { int result = arr[i] + 64 ^ 32; Resultlist.add(result); } int[] KEY = new int[]{180, 136, 137, 147, 191, 137, 147, 191, 148, 136, 133, 191, 134, 140, 129, 135, 191, 65}; ArrayList KEYList = new ArrayList(); for(int j = 0; j < KEY.length; ++j) { KEYList.add(KEY[j]); } System.out.println("Result:"); if (Resultlist.equals(KEYList)) { System.out.println("Congratulations!"); } else { System.err.println("Error!"); } } }
写逆向脚本
target = [180, 136, 137, 147, 191, 137, 147, 191, 148, 136, 133, 191, 134, 140, 129, 135, 191, 65] str = '' for i in range(len(target)): inter = target[i] - 64 ^ 32 str += chr(inter) print(str)
第一次的时候不知道它们的运算优先级写成这样了
inter = target[i] - (64 ^ 32)
得到的结果自然也是错误的
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)