攻防世界 reverse babymips
babymips XCTF 4th-QCTF-2018
mips,ida中想要反编译的化需要安装插件,这题并不复杂直接看mips汇编也没什么难度,这里我用了ghidra,直接可以查看反编译。
1 void FUN_004009a8(void)
2
3 {
4 int iVar1;
5 int i;
6 byte input [36];
7
8 setbuf(stdout,(char *)0x0);
9 setbuf(stdin,(char *)0x0);
10 printf("Give me your flag:");
11 scanf("%32s",input);
12 i = 0;
13 while (i < 0x20) {
14 input[i] = input[i] ^ 0x20U - (char)i; //这里将输入进行异或(0x20-i)
15 i = i + 1;
16 }
17 iVar1 = strncmp((char *)input,_fdata,5); //前5字节输入转换后为 "Q|j{g"
18 if (iVar1 == 0) {
19 f_5-end_004007f0((char *)input); //转换后的结果进行下一步处理
20 }
21 else {
22 puts("Wrong");
23 }
24 return;
25 }
[5:]部分处理:
1 void f_5-end_004007f0(char *op_str)
2
3 {
4 size_t lens;
5 int iVar1;
6 uint i;
7
8 i = 5;
9 while (lens = strlen(op_str), i < lens) {
10 if ((i & 1) == 0) { //偶数时
11 op_str[i] = (byte)((uint)((int)op_str[i] << 0x1a) >> 0x18) | op_str[i] >> 6;//高2位右移6位成为低2位,低6位左移2位成为高6位 相当于一字节循环左移2位
12 }
13 else {//奇数时
14 op_str[i] = op_str[i] >> 2 | (byte)((uint)((int)op_str[i] << 0x1e) >> 0x18);//高6位右移2位成为低6位,低2位左移6位成为高2位 相当于循环右移2位
15 }
16 i = i + 1;
17 }
18 iVar1 = strncmp(op_str + 5,PTR_ARRAY_00410d04,0x1b);
19 if (iVar1 == 0) {
20 puts("Right!");
21 }
22 else {
23 puts("Wrong!");
24 }
25 return;
26 }
wp:
1 part1=b'Q|j{g'
2 part2='52 fd 16 a4 89 bd 92 80 13 41 54 a0 8d 45 18 81 de fc 95 f0 16 79 1a 15 5b 75 1f'
3 part2=list(bytes.fromhex(part2))
4 for i in range(5,len(part2)+5):
5 t = part2[i-5]
6 if i&1==0: #偶数时&1 为0
7 part2[i-5]=(t&0x3)<<6|(t&0xfc)>>2 #低2位左移6位,高6位右移2位 相当于循环右移2位
8 else:
9 part2[i-5]=(t&0x3f)<<2|(t&0xc0)>>6 #低6位左移2位,高2位右移6位 相当于循环左移2位
10
11 temp=list(part1)+part2
12 flag=''
13 for i in range(len(temp)):
14 flag+=chr(temp[i]^0x20 -i)
15 print(flag)
qctf{ReA11y_4_B@89_mlp5_4_XmAn_}
攻防世界 reverse babymips的更多相关文章
- 攻防世界 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 easy_Maze
easy_Maze 从题目可得知是简单的迷宫问题 int __cdecl main(int argc, const char **argv, const char **envp) { __int64 ...
随机推荐
- 白日梦的ES笔记三:万字长文 Elasticsearch基础概念统一扫盲
目录 一.导读 二.彩蛋福利:账号借用 三.ES的Index.Shard及扩容机制 四.ES支持的核心数据类型 4.1.数字类型 4.2.日期类型 4.3.boolean类型 4.4.二进制类型 4. ...
- Sentry 高级使用教程
Sentry 高级使用教程 Sentry versions https://github.com/getsentry/sentry-docs https://github.com/getsentry/ ...
- js with All In One
js with All In One 不推荐,要废弃 function f(x, o) { with (o) { console.log(x); } } function f(foo, values) ...
- node --experimental-modules & node.js ES Modules
node --experimental-modules & node.js ES Modules how to run esm modules in node.js cli $ node -v ...
- VIM 官方教程
VIM 官方教程 zh-hans vim official documents https://www.vim.org/docs.php https://vimhelp.org/ translatio ...
- how to convert a number to a number array in javascript without convert number to a string
how to convert a number to a number array in javascript without convert number to a string 如何在不将数字转换 ...
- Web Components & HTML template & HTML slot
Web Components & HTML template & HTML slot https://github.com/xgqfrms/es-next/issues/2 live ...
- dark theme website
dark theme website css var dark theme prefers-color-scheme https://developer.mozilla.org/en-US/docs/ ...
- React-Native Tutorials
React-Native Tutorials https://egghead.io/courses/react-native-fundamentals part free https://egghea ...
- 伦尼斯酒庄(Chateau Renice)再次赞助亚洲50大餐厅赛事
连续几年来,伦尼斯酒庄(Chateau Renice)一直是亚洲50大最佳餐厅评选赛(Asia's 50 Best Restaurant Awards)的赞助商.2020年伦尼斯酒庄酒庄(Chatea ...