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的更多相关文章

  1. 攻防世界 reverse 进阶 10 Reverse Box

    攻防世界中此题信息未给全,题目来源为[TWCTF-2016:Reverse] Reverse Box 网上有很多wp是使用gdb脚本,这里找到一个本地还原关键算法,然后再爆破的 https://www ...

  2. 攻防世界 reverse evil

    这是2017 ddctf的一道逆向题, 挑战:<恶意软件分析> 赛题背景: 员工小A收到了一封邮件,带一个文档附件,小A随手打开了附件.随后IT部门发现小A的电脑发出了异常网络访问请求,进 ...

  3. 攻防世界 reverse tt3441810

    tt3441810 tinyctf-2014 附件给了一堆数据,将十六进制数据部分提取出来, flag应该隐藏在里面,(这算啥子re,) 保留可显示字符,然后去除填充字符(找规律 0.0) 处理脚本: ...

  4. 攻防世界 reverse 进阶 APK-逆向2

    APK-逆向2 Hack-you-2014 (看名以为是安卓逆向呢0.0,搞错了吧) 程序是.net写的,直接祭出神器dnSpy 1 using System; 2 using System.Diag ...

  5. 攻防世界 reverse Windows_Reverse2

    Windows_Reverse2   2019_DDCTF 查壳: 寻找oep-->dump-->iat修复   便可成功脱壳 int __cdecl main(int argc, con ...

  6. 攻防世界 reverse BabyXor

    BabyXor     2019_UNCTF 查壳 脱壳 dump 脱壳后 IDA静态分析 int main_0() { void *v0; // eax int v1; // ST5C_4 char ...

  7. 攻防世界 reverse parallel-comparator-200

    parallel-comparator-200 school-ctf-winter-2015 https://github.com/ctfs/write-ups-2015/tree/master/sc ...

  8. 攻防世界 reverse 进阶 8-The_Maya_Society Hack.lu-2017

    8.The_Maya_Society Hack.lu-2017 在linux下将时间调整为2012-12-21,运行即可得到flag. 下面进行分析 1 signed __int64 __fastca ...

  9. 攻防世界 reverse seven

    seven  hctf2018 这是一个驱动文件 ida载入,查找字符串 根据字符串来到函数:sub_1400012F0 __int64 __fastcall sub_1400012F0(__int6 ...

随机推荐

  1. SVG in Action

    SVG in Action HTML5 semantic HTML5 Semantic Elements / HTML5 Semantic Tags figure object <figure& ...

  2. npm 安装 electron 失败的解决方案

    npm 安装 electron 失败的解决方案 shit GFW npm 安装 electron 失败 解决方案 https://www.npmjs.com/package/nrm $ nrm ls ...

  3. 联合登录 & OAuth 2.0 & OpenID

    联合登录 & OAuth 2.0 & OpenID 第三方联合登录一般可以降低网站的获客成本,所以一般的网站都会做一些联合登录,常用的就是QQ.微信.微博; https://www.z ...

  4. fetch & form-data & upload & image file

    fetch & form-data & upload & image file no need multipart/form-data https://blog.xinshan ...

  5. [转]LINUX下编译c++11的代码

    转载地址: https://blog.csdn.net/lwb102063/article/details/50445201 C++11,(即ISO/IEC 14882:2011),是目前的C++编程 ...

  6. flask启动常见问题1:sqlalchemy.exc.ArgumentError: Mapper mapped class UserCode->data_system_user_email could not assemble any primary key columns for mapped table 'data_system_user_email'

    我的描述:当我编辑好flask以后,ORM映射数据库完成,启动项目时,发生现象: 解决: 看字面的意思是主键导致的错误,于是我查看了data_system_user_email的键参数配置,发现表没有 ...

  7. docker镜像常用操作的基本命令

    1.拉取/下载镜像 docker pull 镜像名称       (可以从网易云镜像中心获取要下载的镜像) 2.查看已经下载的镜像 docker images 3.删除本地镜像 docker rmi ...

  8. 【Notes_1】现代图形学入门——计算机图形学概述

    跟着闫令琪老师的课程学习,总结自己学习到的知识点 课程网址GAMES101 B站课程地址GAMES101 课程资料百度网盘[提取码:0000] 计算机图形学概述 计算机图形学是一门将模型转化到屏幕上图 ...

  9. 缓存cache和缓冲区buffer

    一.cache 1.cache的定义.从宏观上讲,缓存是处理速度不匹配的问题.可以是静态缓存(内存缓存.磁盘缓存).动态缓存(前端的缓存)和数据库缓存.另一个角度,从CPU来看,可以是寄存器和内存之间 ...

  10. 后端程序员之路 31、Protocol Buffer

    google/protobuf: Protocol Buffers - Google's data interchange formathttps://github.com/google/protob ...