I have this new code but I want it to work like the old one. How can I make it? My problem is that bp pointer or so?
New:
seg000:1722 sub_1722 proc near ; CODE XREF: sub_1759+2Dp
seg000:1722
seg000:1722 arg_0 = dword ptr 4
seg000:1722 arg_4 = dword ptr 8
seg000:1722 arg_8 = dword ptr 0Ch
seg000:1722
seg000:1722 push bp
seg000:1723 mov bp, sp
seg000:1725 mov edi, [bp+arg_0]
seg000:1729 mov eax, 0FFFFFFFFh
seg000:172F jmp short loc_1751
seg000:1731 ; ---------------------------------------------------------------------------
seg000:1731
seg000:1731 loc_1731: ; CODE XREF: sub_1722+33j
seg000:1731 cmp dword ptr es:[edi], 4353494Dh
seg000:173A jnz short loc_174D
seg000:173C cmp dword ptr es:[edi+4], 4749532Eh
seg000:1746 jnz short loc_174D
seg000:1748 mov eax, edi
seg000:174B jmp short loc_1757
seg000:174D ; ---------------------------------------------------------------------------
seg000:174D
seg000:174D loc_174D: ; CODE XREF: sub_1722+18j
seg000:174D ; sub_1722+24j
seg000:174D add edi, [bp+arg_8]
seg000:1751
seg000:1751 loc_1751: ; CODE XREF: sub_1722+Dj
seg000:1751 cmp edi, [bp+arg_4]
seg000:1755 jb short loc_1731
seg000:1757
seg000:1757 loc_1757: ; CODE XREF: sub_1722+29j
seg000:1757 pop bp
seg000:1758 retn
seg000:1758 sub_1722 endp
Old:
seg000:10D7 push es
seg000:10D8 push edi
seg000:10DA call near ptr 0F510h
seg000:10DD xor edi, edi
seg000:10E0 mov es, di
seg000:10E2 mov edi, eax
seg000:10E5 jmp short loc_110A
seg000:10E7 ; ---------------------------------------------------------------------------
seg000:10E7
seg000:10E7 loc_10E7: ; CODE XREF: seg000:1111j
seg000:10E7 cmp dword ptr es:[edi], 4353494Dh
seg000:10F0 jnz short loc_1103
seg000:10F2 cmp dword ptr es:[edi+4], 4749532Eh
seg000:10FC jnz short loc_1103
seg000:10FE mov eax, edi
seg000:1101 jmp short loc_1144
seg000:1103 ; ---------------------------------------------------------------------------
seg000:1103
seg000:1103 loc_1103: ; CODE XREF: seg000:10F0j
seg000:1103 ; seg000:10FCj
seg000:1103 add edi, 8000h
seg000:110A
seg000:110A loc_110A: ; CODE XREF: seg000:10E5j
seg000:110A cmp edi, 0FFFFFC00h
seg000:1111 jb short loc_10E7
seg000:1113 xor edi, edi
seg000:1116 jmp short loc_113B
seg000:1118 ; ---------------------------------------------------------------------------
seg000:1118
seg000:1118 loc_1118: ; CODE XREF: seg000:1142j
seg000:1118 cmp dword ptr es:[edi], 4353494Dh
seg000:1121 jnz short loc_1134
seg000:1123 cmp dword ptr es:[edi+4], 4749532Eh
seg000:112D jnz short loc_1134
seg000:112F mov eax, edi
seg000:1132 jmp short loc_1144
seg000:1134 ; ---------------------------------------------------------------------------
seg000:1134
seg000:1134 loc_1134: ; CODE XREF: seg000:1121j
seg000:1134 ; seg000:112Dj
seg000:1134 add edi, 8000h
seg000:113B
seg000:113B loc_113B: ; CODE XREF: seg000:1116j
seg000:113B cmp edi, 7FFFFh
seg000:1142 jb short loc_1118
seg000:1144
seg000:1144 loc_1144: ; CODE XREF: seg000:1101j
seg000:1144 ; seg000:1132j
seg000:1144 call near ptr 0F629h
seg000:1147 pop edi
seg000:1149 pop es
seg000:114A retn