如何调试这个反汇编代码?我必须用C++语言重写这个函数。但起初我必须明白它是如何工作的。调试反汇编代码
有什么办法可以调试它吗?
0804865a <generate_key>:
804865a: 55 push %ebp
804865b: 89 e5 mov %esp,%ebp
804865d: 57 push %edi
804865e: 56 push %esi
804865f: 53 push %ebx
8048660: 83 ec 18 sub $0x18,%esp
8048663: 8b 7d 0c mov 0xc(%ebp),%edi
8048666: ff 75 08 pushl 0x8(%ebp)
8048669: e8 b2 fe ff ff call 8048520 <[email protected]>
804866e: 83 c4 10 add $0x10,%esp
8048671: 85 c0 test %eax,%eax
8048673: 89 c3 mov %eax,%ebx
8048675: 75 0f jne 8048686 <generate_key+0x2c>
8048677: e8 d4 fe ff ff call 8048550 <[email protected]>
804867c: b9 40 42 0f 00 mov $0xf4240,%ecx
8048681: 99 cltd
8048682: f7 f9 idiv %ecx
8048684: 89 d3 mov %edx,%ebx
8048686: 31 c9 xor %ecx,%ecx
8048688: be 1b 00 00 00 mov $0x1b,%esi
804868d: eb 13 jmp 80486a2 <generate_key+0x48>
804868f: 8d 04 c9 lea (%ecx,%ecx,8),%eax
8048692: 31 d2 xor %edx,%edx
8048694: 01 d8 add %ebx,%eax
8048696: f7 f6 div %esi
8048698: 8a 82 18 9e 04 08 mov 0x8049e18(%edx),%al
804869e: 88 04 0f mov %al,(%edi,%ecx,1)
80486a1: 41 inc %ecx
80486a2: 3b 4d 10 cmp 0x10(%ebp),%ecx
80486a5: 73 05 jae 80486ac <generate_key+0x52>
简单,重新组装它。 – Jester
有没有Windows程序? –
最好的方法是a)学习汇编语言,然后b)将其逆向工程化回C或C++代码。很显然,这里的问题太广泛了。 –