-
-
[原创]BUUCTF逆向题:特殊的 BASE64
-
发表于: 2022-3-27 18:09 5543
-
1.基本信息探查:
1.EXEinfo:
2.运行一下:
2.IDA分析:
1.主函数分析:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | int __cdecl main( int argc, const char * * argv, const char * * envp) { __int64 v3; / / rax __int64 v4; / / rax std::string result; / / [rsp + 20h ] [rbp - 60h ] BYREF std::string rightFlag; / / [rsp + 30h ] [rbp - 50h ] BYREF std::string str ; / / [rsp + 40h ] [rbp - 40h ] BYREF char v9; / / [rsp + 4Fh ] [rbp - 31h ] BYREF std::string v10; / / [rsp + 50h ] [rbp - 30h ] BYREF _main(); std::string::string(& str ); std::allocator<char>::allocator(&v9); std::string::string(&rightFlag, "mTyqm7wjODkrNLcWl0eqO8K8gc1BPk1GNLgUpI==" , &v9); std::allocator<char>::~allocator(&v9); v3 = std::operator<<<std::char_traits<char>>(refptr__ZSt4cout, "Please input your flag!!!!" ); std::ostream::operator<<(v3, refptr__ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_); std::operator>><char>(refptr__ZSt3cin, & str ); std::string::string(&v10, & str ); base64Encode(&result); / / 调用base64Encode函数 std::string::~string(&v10); if ( std::operator = = <char>(&result, &rightFlag) ) / / 字符串的比较 v4 = std::operator<<<std::char_traits<char>>(refptr__ZSt4cout, "The flag is right!!!!!!!!!" ); else v4 = std::operator<<<std::char_traits<char>>(refptr__ZSt4cout, "This is a wrong flag!!!!!!!!" ); std::ostream::operator<<(v4, refptr__ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_); std::string::~string(&result); std::string::~string(&rightFlag); std::string::~string(& str ); return 0 ; } |
这是c++编写的代码,分析了那么多c代码,突然来个C++代码还有点不习惯
赞赏
他的文章
- 关于迷宫题的一些求解思路 11128
- [原创]攻防世界PWN新手区:int_overflow 7821
- [原创]攻防世界PWN新手区:guess_num 11534
- [原创]攻防世界PWN新手区:level2 11815
- [原创]攻防世界PWN新手区:level0 6107
看原图
赞赏
雪币:
留言: