攻防世界 reverse easy_Maze
easy_Maze
从题目可得知是简单的迷宫问题
int __cdecl main(int argc, const char **argv, const char **envp)
{
__int64 v3; // rax
int v5[49]; // [rsp+0h] [rbp-270h]
int temp_data[7][7]; // [rsp+D0h] [rbp-1A0h]
_DWORD org_maze_data[7][7]; // [rsp+1A0h] [rbp-D0h] org_maze_data[0][0] = 1;
org_maze_data[0][1] = 1;
org_maze_data[0][2] = -1;
org_maze_data[0][3] = 1;
org_maze_data[0][4] = -1;
org_maze_data[0][5] = 1;
org_maze_data[0][6] = -1;
org_maze_data[1][0] = 0;
org_maze_data[1][1] = 0;
org_maze_data[1][2] = 0;
org_maze_data[1][3] = 0;
org_maze_data[1][4] = 1;
org_maze_data[1][5] = -1;
org_maze_data[1][6] = 0;
org_maze_data[2][0] = 0;
org_maze_data[2][1] = 1;
org_maze_data[2][2] = 0;
org_maze_data[2][3] = 0;
org_maze_data[2][4] = 1;
org_maze_data[2][5] = 0;
org_maze_data[2][6] = -1;
org_maze_data[3][0] = -1;
org_maze_data[3][1] = 0;
org_maze_data[3][2] = 1;
org_maze_data[3][3] = 0;
org_maze_data[3][4] = 1;
org_maze_data[3][5] = -1;
org_maze_data[3][6] = 0;
org_maze_data[4][0] = -1;
org_maze_data[4][1] = 0;
org_maze_data[4][2] = 0;
org_maze_data[4][3] = 0;
org_maze_data[4][4] = 0;
org_maze_data[4][5] = 0;
org_maze_data[4][6] = 1;
org_maze_data[5][0] = -1;
org_maze_data[5][1] = -1;
org_maze_data[5][2] = 1;
org_maze_data[5][3] = -1;
org_maze_data[5][4] = 0;
org_maze_data[5][5] = -1;
org_maze_data[5][6] = 2;
org_maze_data[6][0] = 1;
org_maze_data[6][1] = -1;
org_maze_data[6][2] = 0;
org_maze_data[6][3] = 0;
org_maze_data[6][4] = -1;
org_maze_data[6][5] = 1;
org_maze_data[6][6] = 0;
memset(temp_data, 0, 192uLL);
temp_data[6][6] = 0;
memset(v5, 0, 192uLL);
v5[48] = 0;
Step_0(org_maze_data, 7, temp_data); // 变换迷宫数据
Step_1(temp_data, 7, (int (*)[7])v5); // 变换迷宫数据
v3 = std::operator<<<std::char_traits<char>>(&_bss_start, "Please help me out!");
std::ostream::operator<<(v3, &std::endl<char,std::char_traits<char>>);
Step_2((int (*)[7])v5, 7); // 输入,验证
system("pause");
return 0;
}
迷宫经过了两次变换,我们需要动态调试dump出最终迷宫数据。
dump

关注Step_2函数
__int64 __fastcall Step_2(int (*maze_final_data)[7])
{
int index; // eax
__int64 v2; // rax
__int64 v3; // rax
__int64 result; // rax
__int64 v5; // rax
char flag[35]; // [rsp+10h] [rbp-30h]
char myinput; // [rsp+33h] [rbp-Dh]
int i; // [rsp+34h] [rbp-Ch]
int y; // [rsp+38h] [rbp-8h]
int x; // [rsp+3Ch] [rbp-4h] x = 0;
y = 0;
i = 0;
while ( i <= 29 && (*maze_final_data)[7 * x + y] == 1 )// 三十步 7*7迷宫; 走1
{
std::operator>><char,std::char_traits<char>>(&std::cin, &myinput);
index = i++;
flag[index] = myinput;
if ( myinput == 'd' )
{ // d向右
++y;
}
else if ( myinput > 'd' )
{
if ( myinput == 's' )
{
++x; // s向下
}
else
{
if ( myinput != 'w' )
goto LABEL_14;
--x; // w向上
}
}
else if ( myinput == 'a' )
{ // a向左
--y;
}
else
{
LABEL_14:
v2 = std::operator<<<std::char_traits<char>>(&_bss_start, "include illegal words.");
std::ostream::operator<<(v2, &std::endl<char,std::char_traits<char>>);
}
}
if ( x != 6 || y != 6 ) // 终点 第49个
{
v5 = std::operator<<<std::char_traits<char>>(&_bss_start, "Oh no!,Please try again~~");
std::ostream::operator<<(v5, &std::endl<char,std::char_traits<char>>);
result = 0LL;
}
else
{
v3 = std::operator<<<std::char_traits<char>>(&_bss_start, "Congratulations!");
std::ostream::operator<<(v3, &std::endl<char,std::char_traits<char>>);
output(flag, i);
result = 1LL;
}
return result;
}
可得到迷宫题的几个关键:
- 迷宫数据
- 起点 [0][0]
- 终点[6][6]
- 迷宫操作:wsad-->上下左右
最终的迷宫数据:

操作:ssddwdwdddssaasasaaassddddwdds
UNCTF{ssddwdwdddssaasasaaassddddwdds}
//------------------------------------------------------------//----------- Created with 010 Editor -----------//------ www.sweetscape.com/010editor/ ------//// File : D:\Users\Desktop\¹¥·ÀÊÀ½ç\final_maze// Address : 0 (0x0)// Size : 400 (0x190)//------------------------------------------------------------unsigned char hexData[400] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
攻防世界 reverse easy_Maze的更多相关文章
- 攻防世界 reverse 进阶 10 Reverse Box
攻防世界中此题信息未给全,题目来源为[TWCTF-2016:Reverse] Reverse Box 网上有很多wp是使用gdb脚本,这里找到一个本地还原关键算法,然后再爆破的 https://www ...
- 攻防世界 reverse evil
这是2017 ddctf的一道逆向题, 挑战:<恶意软件分析> 赛题背景: 员工小A收到了一封邮件,带一个文档附件,小A随手打开了附件.随后IT部门发现小A的电脑发出了异常网络访问请求,进 ...
- 攻防世界 reverse tt3441810
tt3441810 tinyctf-2014 附件给了一堆数据,将十六进制数据部分提取出来, flag应该隐藏在里面,(这算啥子re,) 保留可显示字符,然后去除填充字符(找规律 0.0) 处理脚本: ...
- 攻防世界 reverse 进阶 APK-逆向2
APK-逆向2 Hack-you-2014 (看名以为是安卓逆向呢0.0,搞错了吧) 程序是.net写的,直接祭出神器dnSpy 1 using System; 2 using System.Diag ...
- 攻防世界 reverse Windows_Reverse2
Windows_Reverse2 2019_DDCTF 查壳: 寻找oep-->dump-->iat修复 便可成功脱壳 int __cdecl main(int argc, con ...
- 攻防世界 reverse BabyXor
BabyXor 2019_UNCTF 查壳 脱壳 dump 脱壳后 IDA静态分析 int main_0() { void *v0; // eax int v1; // ST5C_4 char ...
- 攻防世界 reverse parallel-comparator-200
parallel-comparator-200 school-ctf-winter-2015 https://github.com/ctfs/write-ups-2015/tree/master/sc ...
- 攻防世界 reverse 进阶 8-The_Maya_Society Hack.lu-2017
8.The_Maya_Society Hack.lu-2017 在linux下将时间调整为2012-12-21,运行即可得到flag. 下面进行分析 1 signed __int64 __fastca ...
- 攻防世界 reverse seven
seven hctf2018 这是一个驱动文件 ida载入,查找字符串 根据字符串来到函数:sub_1400012F0 __int64 __fastcall sub_1400012F0(__int6 ...
随机推荐
- python 爬取腾讯视频的全部评论
一.网址分析 查阅了网上的大部分资料,大概都是通过抓包获取.但是抓包有点麻烦,尝试了F12,也可以获取到评论.以电视剧<在一起>为例子.评论最底端有个查看更多评论猜测过去应该是 Ajax ...
- Gradle & Java
Gradle & Java Gradle Build Tool I Modern Open Source Build Automation https://gradle.org/ https: ...
- mobile chart & f2
mobile chart & f2 https://www.yuque.com/antv/f2/getting-started https://antv.alipay.com/zh-cn/f2 ...
- ubuntu ARM换国内源和国内源安装ROS
ubuntu arm换国内源: https://www.cnblogs.com/yongy1030/p/10315569.html 国内源安装ROS: https://blog.csdn.net/ch ...
- Scrapy 项目:QuotesBot
QuotesBot This is a Scrapy project to scrape quotes from famous people from http://quotes.toscrape.c ...
- scala函数至简原则是什么?
1.return可以省略,Scala会使用函数体的最后一行代码作为返回值 2.如果函数体只有一行代码,可以省略花括号 3.返回值类型如果能够推断出来,那么可以省略(:和返回值类型一起省略) 4.如果有 ...
- uni-app小白入门自学笔记(二)
码文不易啊,转载请带上本文链接呀,感谢感谢 https://www.cnblogs.com/echoyya/p/14429616.html 目录 码文不易啊,转载请带上本文链接呀,感谢感谢 https ...
- redis slowlog 慢查询日志
设置 config set slowlog-log-slower-than 10000(微秒) //查看redis时间超过上面设置的阀值的key slowlog len 有几个key slowlog ...
- Docker Elasticsearch 集群配置
一:选用ES原因 公司项目有些mysql的表数据已经超过5百万了,各种业务的查询入库压力已经凸显出来,初步打算将一个月前的数据迁移到ES中,mysql的老数据就物理删除掉. 首先是ES使用起来比较方便 ...
- 导出----用Excel导出数据库表
根据条件导出表格: 前端 <el-form-item label=""> <el-button type="warning" icon=&qu ...