光棍节程序员闯关秀第9关(总共10关) 解题步骤
来源:互联网 发布:三个数据看男女准确率 编辑:程序博客网 时间:2024/05/16 23:48
题目链接:http://segmentfault.com/game/?k=4999c12ce5be7c3cba227ba9f4f7d797
解题步骤:
1. 应景嘛,把所有的空格替换成 1111
2. 8位二进制转换成一个byte, 解释为 ASCII 字符
3. 得到一个 BASE64 加密的字符串
4. 用 BASE64Decoder 解密
5. 另存为 zip 压缩文件
6. 打开文件,发现里面有一幅图片,图片上的字符串就是 key
代码:
// 从 D 盘的 code.txt 读取数据,输出到 D 盘的 decode.zip
public void game1111_9() throws IOException {
File file = new File("D:\\code.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
StringBuffer sb = new StringBuffer();
String line = null;
while ((line = br.readLine()) != null) {
String[] codes=line.split(" ");
for(String code:codes){
char c=(char) Integer.parseInt(code, 2);
sb.append(c);
}
}
System.out.println(sb);
BASE64Decoder decoder = new BASE64Decoder();
byte[] decodeBuffer = decoder.decodeBuffer(sb.toString());
File decodeFile = new File("D:\\decode.zip");
FileOutputStream fileOutputStream = new FileOutputStream(decodeFile);
fileOutputStream.write(decodeBuffer);
fileOutputStream.close();
br.close();
}
File file = new File("D:\\code.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
StringBuffer sb = new StringBuffer();
String line = null;
while ((line = br.readLine()) != null) {
String[] codes=line.split(" ");
for(String code:codes){
char c=(char) Integer.parseInt(code, 2);
sb.append(c);
}
}
System.out.println(sb);
BASE64Decoder decoder = new BASE64Decoder();
byte[] decodeBuffer = decoder.decodeBuffer(sb.toString());
File decodeFile = new File("D:\\decode.zip");
FileOutputStream fileOutputStream = new FileOutputStream(decodeFile);
fileOutputStream.write(decodeBuffer);
fileOutputStream.close();
br.close();
}
- 光棍节程序员闯关秀第9关(总共10关) 解题步骤
- 光棍节程序员闯关秀第1关(总共10关)
- 光棍节程序员闯关秀第2关(总共10关)
- 光棍节程序员闯关秀第3关(总共10关)
- 光棍节程序员闯关秀第4关(总共10关)
- 光棍节程序员闯关秀第5关(总共10关)
- 光棍节程序员闯关秀第6关(总共10关)
- 光棍节程序员闯关秀第9关基于php的破解
- 屌丝破光棍节程序员闯关秀第十关
- 光棍节程序员闯关秀
- 光棍节程序员闯关秀
- 光棍节程序员闯关
- 光棍节程序员闯关秀之思考
- 光棍节程序员闯关秀 小游戏
- 光棍节程序员闯关秀 writeup
- PythonChallenge闯关游戏——第6-10关
- 光棍程序员闯关秀感想。。
- 爬虫闯关 - 第一关
- linux在当前用户下切换到root用户
- 管理软件包
- 阿里巴巴参谋长曾鸣深刻解析:何谓互联网的本质
- IE8下String的Trim()方法失效的解决方案
- webstorm 7注册码
- 光棍节程序员闯关秀第9关(总共10关) 解题步骤
- 又到了迷茫的阶段,不知道何从选择
- 鼠标拖动无标题栏的对话框
- byte[] classBytes = FileLoader.loadFileAsBytes("c:\\temp\\Tester.class");
- Java基本开发环境搭建
- Qt::ConnectionType 解析
- icinga简明教程2—受控端安装配置
- Struts constant内容
- SHA1和MD5加密算法对文件加密