REVERSE-DAILY(5)-rev2
比较有意思的一道题目 提示是一个迷宫
链接: http://pan.baidu.com/s/1pLhINBt 密码:91bs
先运行程序,要求是输入字符串,错误会输出“Sorry you are wrong!”
先用ida载入,按程序运行流程首先会注意到_main_0函数,函数也与程序结构相符,但如果以此分析下去是错误的,
注意到ida中有如下结构:
v6 = ;
v5 = ;
v7 = / ;
printf("Please input your key:\n");
v7=0/0明显是错误的,会跳到SE处理程序,这一点可以在od中得到验证
如图下断点的话,程序在0x0040140d输出字符串“Please input......”,输入字符串后也不能停住,实际上是0/0出错后调到SE处理程序,根据上图可以看到0x004013ed处压入SE处理程序安装地址,最终程序跳到sub_401020函数运行。
分析sub_401020函数:
可以得到如下信息:
1.输入字符串长度为22
2.输入字符串每个字符为h,j,k,l中的一个
3.主结构是个大循环,依次逐位检查每一个输入字符
4.v4= "********* * ** * ** ** * ** ** * #* ** **** ** *********"
&v4=bp-c8
&v6=bp-88
&v5=bp-bf
初始时v3=&v5
5.主结构有四条分支,输入字符为h: v3--
j: v3+=8
k: v3-=8
l: v3++
6.对于v3 < &v4 || v3 > &v6判断条件,v4和v6分别是v4的上下界,这只是检查v3是否出界
7.对于 *v3 == 42是判断如果*v3为*则报错,
8.当字符为#时成功
所以思路即为由最初的v3通过运算到达#,这实际上就类似于走一个迷宫
迷宫如上图,第一个*即为v4起始点,最后一个空白格为v6检查点,第三行第一个空格为v3起始地址,
这样就容易得到了字符串:jjjjjlllllkkkkkhhhjjjl
REVERSE-DAILY(5)-rev2的更多相关文章
- HNU 13411 Reverse a Road II(最大流+BFS)经典
Reverse a Road II Time Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KB Total submit ...
- LeetCode 7. Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Have you ...
- 【uwp】浅谈China Daily 中划词翻译的实现
学习uwp开发也有一段时间了,最近上架了一个小应用(China Daily),现在准备将开发中所学到的一些东西拿出来跟大家分享交流一下. 先给出应用的下载链接:China Daily , 感兴趣的童鞋 ...
- js sort() reverse()
数组中存在的两个方法:sort()和reverse() 直接用sort(),如下: ,,,,,,,,,,,]; console.log(array.sort());ps:[0, 1, 2, 2, 29 ...
- [LeetCode] Reverse Vowels of a String 翻转字符串中的元音字母
Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Giv ...
- [LeetCode] Reverse String 翻转字符串
Write a function that takes a string as input and returns the string reversed. Example: Given s = &q ...
- [LeetCode] Reverse Linked List 倒置链表
Reverse a singly linked list. click to show more hints. Hint: A linked list can be reversed either i ...
- [LeetCode] Reverse Bits 翻转位
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in ...
- [LeetCode] Reverse Words in a String II 翻转字符串中的单词之二
Given an input string, reverse the string word by word. A word is defined as a sequence of non-space ...
- [LeetCode] Reverse Words in a String 翻转字符串中的单词
Given an input string, reverse the string word by word. For example, Given s = "the sky is blue ...
随机推荐
- Python’s SQLAlchemy vs Other ORMs[转发 2]Storm
Storm Storm is a Python ORM that maps objects between one or more databases and Python. It allows de ...
- discuz后台登陆 口令卡添加
1.通过根目录文件admin.php 找到 $admincp->init(); 2.指向 dz/source/class/discuz/discuz_admincp.php 这个方法funct ...
- pandas保存excel
没有matlab那样的保存中间变量可以用jupyter创建文件然后在pycharm中打开但是字体很奇怪- -所以还是用excel的中间文件方式#测试涨停# ret = asc.getPctChange ...
- 使用C++11的一点总结
C++11已不是新鲜技术,但对于我来说,工作中用得还不够多(前东家长时间使用gcc3.4.5,虽然去年升了4.8.2,但旧模块维护还是3.4.5居多:新东家用的是4.4.6,不能完整支持C ...
- react参考项目001
https://github.com/chen2009277025/webpack-ant-design-demo https://github.com/cobish/cobish.github.io ...
- 通过JDBK操作数据库
一.配置程序--让我们程序能找到数据库的驱动jar包1.把.jar文件复制到项目中去,整合的时候方便.2.在eclipse项目右击"构建路径"--"配置构建路径" ...
- H5之contenteditable
场景: <div id='content' contenteditable='true' > hello </div> <button id='caret'>设置光 ...
- javascript选择排序
function selectionSort(arr){ var index,value; for(var i = 0;i < arr.length;i ++){ index = i; //先记 ...
- <java基础学习>01环境变量配置
安装完JDK开始配置系统环境变量,在path变量里面添加java的bin目录 方法二: 配置完成后 在命令下输入javac查看是否配置成功 第一个java程序 hello world! class H ...
- UITableViewCell里面separator的设置
最近cell显示的时候左边一直有15个像素的偏移,查了下面的方法 //1. 不管用 [self.tableView setSeparatorInset:UIEdgeInsetsZero]; // 2. ...