/
Exploit.java
33 lines (32 loc) 路 1.29 KB
/
Exploit.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.FileReader;
public class Exploit {
public static void main(String[] args) {
try {
final FileReader fr = new FileReader("hell.txt");
final BufferedReader br = new BufferedReader(fr);
int bpm = Integer.parseInt(br.readLine());
ArrayList<Integer> cache = new ArrayList<Integer>();
while (br.ready()) {
final String s = br.readLine();
if (s.charAt(0) != '*') {
final int a = Integer.parseInt(s);
cache.add(a);
}
}
br.close();
final byte[] this_flag = new byte[] { 89, 74, 75, 43, 126, 69, 120, 109, 68, 109, 109, 97, 73, 110, 45, 113,
102, 64, 121, 47, 111, 119, 111, 71, 114, 125, 68, 105, 127, 124, 94, 103, 46, 107, 97, 104 };
for (int i = 0; i < cache.size(); ++i) {
final byte[] tmp_flag = this_flag;
final int n = i % this_flag.length;
tmp_flag[n] ^= (byte) (int) cache.get(i);
}
final String fff = new String(this_flag);
System.out.println(fff);
} catch (Exception e) {
System.out.println(e);
}
}
}