反汇编的一段程序片断 挺复杂的 研究中
程序代码:
009E7645 55 push ebp ; FlexHEX.009E7471 009E7646 8BEC mov ebp,esp 009E7648 60 pushad 009E7649 55 push ebp 009E764A 8B75 08 mov esi,dword ptr ss:[ebp+0x8] 009E764D 8B7D 0C mov edi,dword ptr ss:[ebp+0xC] 009E7650 FC cld 009E7651 B2 80 mov dl,0x80 009E7653 8A06 mov al,byte ptr ds:[esi] 009E7655 46 inc esi 009E7656 8807 mov byte ptr ds:[edi],al 009E7658 47 inc edi 009E7659 02D2 add dl,dl 009E765B 75 05 jnz XFlexHEX.009E7662 ; 当前add dl dl指令在ZF=0的时候esi+1 ZF=1时 esi+2 add dl dl 执行两次 009E765D 8A16 mov dl,byte ptr ds:[esi] 009E765F 46 inc esi 009E7660 12D2 adc dl,dl 009E7662 ^ 73 EF jnb XFlexHEX.009E7653 ; CF==0时 要么连续复制 要么隔一个字符复制 009E7664 02D2 add dl,dl ; cf==1时 009E7666 75 05 jnz XFlexHEX.009E766D ; 不为0的话就跳转 ZF=0 009E7668 8A16 mov dl,byte ptr ds:[esi] 009E766A 46 inc esi 009E766B 12D2 adc dl,dl 009E766D 73 4A jnb XFlexHEX.009E76B9 ; cf==1 chu 009E766F 33C0 xor eax,eax 009E7671 02D2 add dl,dl 009E7673 75 05 jnz XFlexHEX.009E767A 009E7675 8A16 mov dl,byte ptr ds:[esi] 009E7677 46 inc esi 009E7678 12D2 adc dl,dl 009E767A 0F83 D6000000 jnb FlexHEX.009E7756 ; cf==1 出循环 009E7680 02D2 add dl,dl 009E7682 75 05 jnz XFlexHEX.009E7689 009E7684 8A16 mov dl,byte ptr ds:[esi] 009E7686 46 inc esi 009E7687 12D2 adc dl,dl 009E7689 13C0 adc eax,eax 009E768B 02D2 add dl,dl 009E768D 75 05 jnz XFlexHEX.009E7694 009E768F 8A16 mov dl,byte ptr ds:[esi] 009E7691 46 inc esi 009E7692 12D2 adc dl,dl 009E7694 13C0 adc eax,eax 009E7696 02D2 add dl,dl 009E7698 75 05 jnz XFlexHEX.009E769F 009E769A 8A16 mov dl,byte ptr ds:[esi] 009E769C 46 inc esi 009E769D 12D2 adc dl,dl 009E769F 13C0 adc eax,eax 009E76A1 02D2 add dl,dl 009E76A3 75 05 jnz XFlexHEX.009E76AA 009E76A5 8A16 mov dl,byte ptr ds:[esi] 009E76A7 46 inc esi 009E76A8 12D2 adc dl,dl 009E76AA 13C0 adc eax,eax 009E76AC 74 06 je XFlexHEX.009E76B4 009E76AE 57 push edi 009E76AF 2BF8 sub edi,eax 009E76B1 8A07 mov al,byte ptr ds:[edi] 009E76B3 5F pop edi 009E76B4 8807 mov byte ptr ds:[edi],al 009E76B6 47 inc edi 009E76B7 ^ EB A0 jmp XFlexHEX.009E7659 ; 1 009E76B9 B8 01000000 mov eax,0x1 009E76BE 02D2 add dl,dl 009E76C0 75 05 jnz XFlexHEX.009E76C7 009E76C2 8A16 mov dl,byte ptr ds:[esi] 009E76C4 46 inc esi 009E76C5 12D2 adc dl,dl 009E76C7 13C0 adc eax,eax 009E76C9 02D2 add dl,dl 009E76CB 75 05 jnz XFlexHEX.009E76D2 009E76CD 8A16 mov dl,byte ptr ds:[esi] 009E76CF 46 inc esi 009E76D0 12D2 adc dl,dl 009E76D2 ^ 72 EA jb XFlexHEX.009E76BE 009E76D4 83E8 02 sub eax,0x2 009E76D7 75 28 jnz XFlexHEX.009E7701 009E76D9 B9 01000000 mov ecx,0x1 009E76DE 02D2 add dl,dl 009E76E0 75 05 jnz XFlexHEX.009E76E7 009E76E2 8A16 mov dl,byte ptr ds:[esi] 009E76E4 46 inc esi 009E76E5 12D2 adc dl,dl 009E76E7 13C9 adc ecx,ecx 009E76E9 02D2 add dl,dl 009E76EB 75 05 jnz XFlexHEX.009E76F2 009E76ED 8A16 mov dl,byte ptr ds:[esi] 009E76EF 46 inc esi 009E76F0 12D2 adc dl,dl 009E76F2 ^ 72 EA jb XFlexHEX.009E76DE 009E76F4 56 push esi 009E76F5 8BF7 mov esi,edi 009E76F7 2BF5 sub esi,ebp 009E76F9 F3:A4 rep movs byte ptr es:[edi],byte ptr ds:[> 009E76FB 5E pop esi 009E76FC ^ E9 58FFFFFF jmp FlexHEX.009E7659 ; 2 009E7701 48 dec eax 009E7702 C1E0 08 shl eax,0x8 009E7705 8A06 mov al,byte ptr ds:[esi] 009E7707 46 inc esi 009E7708 8BE8 mov ebp,eax 009E770A B9 01000000 mov ecx,0x1 009E770F 02D2 add dl,dl 009E7711 75 05 jnz XFlexHEX.009E7718 009E7713 8A16 mov dl,byte ptr ds:[esi] 009E7715 46 inc esi 009E7716 12D2 adc dl,dl 009E7718 13C9 adc ecx,ecx 009E771A 02D2 add dl,dl 009E771C 75 05 jnz XFlexHEX.009E7723 009E771E 8A16 mov dl,byte ptr ds:[esi] 009E7720 46 inc esi 009E7721 12D2 adc dl,dl 009E7723 ^ 72 EA jb XFlexHEX.009E770F 009E7725 3D 007D0000 cmp eax,0x7D00 009E772A 73 1A jnb XFlexHEX.009E7746 009E772C 3D 00050000 cmp eax,0x500 009E7731 72 0E jb XFlexHEX.009E7741 009E7733 41 inc ecx 009E7734 56 push esi 009E7735 8BF7 mov esi,edi 009E7737 2BF0 sub esi,eax 009E7739 F3:A4 rep movs byte ptr es:[edi],byte ptr ds:[> 009E773B 5E pop esi 009E773C ^ E9 18FFFFFF jmp FlexHEX.009E7659 ; 3 009E7741 83F8 7F cmp eax,0x7F 009E7744 77 03 ja XFlexHEX.009E7749 009E7746 83C1 02 add ecx,0x2 009E7749 56 push esi 009E774A 8BF7 mov esi,edi 009E774C 2BF0 sub esi,eax 009E774E F3:A4 rep movs byte ptr es:[edi],byte ptr ds:[> 009E7750 5E pop esi 009E7751 ^ E9 03FFFFFF jmp FlexHEX.009E7659 ; 4 009E7756 8A06 mov al,byte ptr ds:[esi] 009E7758 46 inc esi 009E7759 33C9 xor ecx,ecx 009E775B C0E8 01 shr al,0x1 009E775E 74 12 je XFlexHEX.009E7772 009E7760 83D1 02 adc ecx,0x2 009E7763 8BE8 mov ebp,eax 009E7765 56 push esi 009E7766 8BF7 mov esi,edi 009E7768 2BF0 sub esi,eax 009E776A F3:A4 rep movs byte ptr es:[edi],byte ptr ds:[> 009E776C 5E pop esi 009E776D ^ E9 E7FEFFFF jmp FlexHEX.009E7659 ; 5 009E7772 5D pop ebp 009E7773 2B7D 0C sub edi,dword ptr ss:[ebp+0xC] 009E7776 897D FC mov dword ptr ss:[ebp-0x4],edi 009E7779 61 popad 009E777A 5D pop ebp 009E777B C2 0800 retn 0x8