flat assembler
Message board for the users of flat assembler.

Index > Windows > Option rom searching for a string?

Author
Thread Post new topic Reply to topic
phpdevpad



Joined: 12 Jan 2013
Posts: 37
phpdevpad 25 Jan 2013, 18:33
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:
Code:
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:
Code:
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
    
Post 25 Jan 2013, 18:33
View user's profile Send private message Visit poster's website Reply with quote
phpdevpad



Joined: 12 Jan 2013
Posts: 37
phpdevpad 28 Jan 2013, 00:10
I tried lea bp, myaddress to no avail. In myaddress was a data structure 4 bytes start address, 4 bytes end address, and 4 bytes offset but that didn't work. This could should load the misc.bin from the option rom.

Update: I have also tried absolute addressing and I have copy and paste and move the original code around. That doesn't work either. The problem is the misc.sig isn't found and the error message is right there. I have also unpacked the -lzh5- data and compressed it again but my guts says me the repacked data doesn't work. It gives me a totally different error message.
Post 28 Jan 2013, 00:10
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.