标签:saas with char pre address div 简单的 use ==
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; }
可得到迷宫题的几个关键:
最终的迷宫数据:
操作: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 };
标签:saas with char pre address div 简单的 use ==
原文地址:https://www.cnblogs.com/DirWang/p/12275918.html