【发布时间】:2017-10-17 15:50:39
【问题描述】:
好的,伙计们,我知道 Stack 上已经有类似的问题,但我仍然不明白如何将字符映射到数组表。
这个炸弹阶段接受一个长度为6的字符串。我知道程序使用的6个字符需要加到0x24行。
因此,如果我输入 tttttt 之类的内容,其 ascii 值是 116 或 01110100,如果你得到二进制的最后 4 个,它将等于 4。所以 4 * 6 个字符 = 0x24 或 36 十进制。
我仍然对如何映射它感到困惑。有人可以帮我解决它。或者告诉我如何映射它。
谢谢
Dump of assembler code for function phase_5:
0x0000000000401123 <+0>: push %rbx
0x0000000000401124 <+1>: mov %rdi,%rbx
0x0000000000401127 <+4>: callq 0x401361 <string_length>
0x000000000040112c <+9>: cmp $0x6,%eax
0x000000000040112f <+12>: je 0x401136 <phase_5+19>
0x0000000000401131 <+14>: callq 0x4015e4 <explode_bomb>
0x0000000000401136 <+19>: mov $0x0,%eax
0x000000000040113b <+24>: mov $0x0,%edx
0x0000000000401140 <+29>: movzbl (%rbx,%rax,1),%ecx
0x0000000000401144 <+33>: and $0xf,%ecx
=> 0x0000000000401147 <+36>: add 0x4025e0(,%rcx,4),%edx
0x000000000040114e <+43>: add $0x1,%rax
0x0000000000401152 <+47>: cmp $0x6,%rax
0x0000000000401156 <+51>: jne 0x401140 <phase_5+29>
0x0000000000401158 <+53>: cmp $0x24,%edx
0x000000000040115b <+56>: je 0x401162 <phase_5+63>
0x000000000040115d <+58>: callq 0x4015e4 <explode_bomb>
0x0000000000401162 <+63>: pop %rbx
0x0000000000401163 <+64>: retq
End of assembler dump.
(gdb) x/16 0x4025e0
0x4025e0 <array.3161>: 2 10 6 1
0x4025f0 <array.3161+16>: 12 16 9 3
0x402600 <array.3161+32>: 4 7 14 5
0x402610 <array.3161+48>: 11 8 15 13
【问题讨论】:
-
总和必须是
0x24,因此请从表中选择任意 6 个数字加起来为0x24,然后为每个索引选择任何具有适当低位的 ascii 字符。
标签: debugging assembly x86 gdb reverse-engineering