
4.46 new function

.text:045377B0                      NeedUpdGrid     proc near               ; CODE XREF: ScanFunc+33p
.text:045377B0 A1 08 4A 53 00                       mov     eax, lpObj
.text:045377B5 8B 00                                mov     eax, [eax]
.text:045377B7 8B 80 88 06 00 00                    mov     eax, [eax+688h]
.text:045377BD 90                                   nop
.text:045377BE 90                                   nop
.text:045377BF 90                                   nop
.text:045377C0
.text:045377C0                      NeedUpdGrid2:                           ; CODE XREF: ScanFunc+B5p
.text:045377C0 50                                   push    eax
.text:045377C1 31 C9                                xor     ecx, ecx
.text:045377C3 A1 80 48 53 00                       mov     eax, lpAccessMode
.text:045377C8 8A 00                                mov     al, [eax]
.text:045377CA 3C 02                                cmp     al, 2              ; 0 = seq, 1 = reverse, 2 = random, 3 = buttefly
.text:045377CC 73 1A                                jnb     short loc_45377E8  ; if (al >= 2) goto @Grid_DoUpd
.text:045377CE A1 C0 4B 53 00                       mov     eax, lpLenLBA64
.text:045377D3 8B 40 04                             mov     eax, [eax+4]
.text:045377D6 85 C0                                test    eax, eax
.text:045377D8 75 11                                jnz     short loc_45377EB  ; if (eax) goto @Grid_NotUpd
.text:045377DA A1 C0 4B 53 00                       mov     eax, lpLenLBA64
.text:045377DF 8B 00                                mov     eax, [eax]
.text:045377E1 3D 80 96 98 00                       cmp     eax, 10000000
.text:045377E6 73 03                                jnb     short loc_45377EB  ; if (eax >= 10000000) goto @Grid_NotUpd
.text:045377E8
.text:045377E8                      loc_45377E8:                            ; CODE XREF: NeedUpdGrid+1Cj
.text:045377E8 41                                   inc     ecx
.text:045377E9 58                                   pop     eax
.text:045377EA C3                                   retn
.text:045377EB
.text:045377EB                      loc_45377EB:                            ; CODE XREF: NeedUpdGrid+28j
.text:045377EB                                                              ; NeedUpdGrid+36j
.text:045377EB 58                                   pop     eax
.text:045377EC C3                                   retn
.text:045377EC                      NeedUpdGrid     endp

---------------------------------------------------------------------------------------


4.46 patched

.text:00504538 8D 45 F0                             lea     eax, [ebp+var_10]
.text:0050453B 8A 15 A0 74 53 00                    mov     dl, byte_5374A0
.text:00504541 E8 1A 07 F0 FF                       call    unknown_libname_79 ; BDS 2005-2007 and Delphi6-7 Visual Component Library
.text:00504546 8B 45 F0                             mov     eax, [ebp+var_10]

.text:00504549 90                                   nop
.text:0050454A 90                                   nop
.text:0050454B E8 60 32 03 04                       call    NeedUpdGrid
.text:00504550 90                                   nop
.text:00504551 85 C9                                test    ecx, ecx
.text:00504553 74 22                                jz      short loc_504577
.text:00504555 FF 75 F0                             push    [ebp+var_10]
.text:00504558 8B 0D 98 74 53 00                    mov     ecx, CurRow
.text:0050455E 0F B7 15 94 74 53 00                 movzx   edx, CurCol
.text:00504565 A1 08 4A 53 00                       mov     eax, lpObj
.text:0050456A 8B 00                                mov     eax, [eax]
.text:0050456C 8B 80 88 06 00 00                    mov     eax, [eax+688h]
.text:00504572 E8 B9 55 FD FF                       call    @Grids@TStringGrid@SetCells
.text:00504577
.text:00504577                      loc_504577:                             ; CODE XREF: ScanFunc+3Bj
.text:00504577 66 C7 05 68 74 53 00+                mov     word ptr byte_537468, 0

.text:00504580 0F B7 05 94 74 53 00                 movzx   eax, CurCol
.text:00504587 0F B7 15 C8 44 53 00                 movzx   edx, RowWidth
.text:0050458E 83 EA 01                             sub     edx, 1
.text:00504591 71 05                                jno     short loc_504598
.text:00504593 E8 0C F6 EF FF                       call    System_Error_5
.text:00504598
.text:00504598                      loc_504598:                             ; CODE XREF: ScanFunc+79j
.text:00504598 3B C2                                cmp     eax, edx
.text:0050459A 7D 11                                jge     short loc_5045AD
.text:0050459C 66 83 05 94 74 53 00+                add     CurCol, 1
.text:005045A4 73 05                                jnb     short loc_5045AB
.text:005045A6 E8 F9 F5 EF FF                       call    System_Error_5
.text:005045AB
.text:005045AB                      loc_5045AB:                             ; CODE XREF: ScanFunc+8Cj
.text:005045AB EB 67                                jmp     short loc_504614
.text:005045AD
.text:005045AD                      loc_5045AD:                             ; CODE XREF: ScanFunc+82j
.text:005045AD 66 C7 05 94 74 53 00+                mov     CurCol, 0
.text:005045B6 A1 08 4A 53 00                       mov     eax, lpObj
.text:005045BB 8B 00                                mov     eax, [eax]
.text:005045BD 8B 80 88 06 00 00                    mov     eax, [eax+688h]
.text:005045C3 8B 90 4C 02 00 00                    mov     edx, [eax+24Ch]
.text:005045C9 83 C2 01                             add     edx, 1

.text:005045CC 90                                   nop
.text:005045CD E8 EE 31 03 04                       call    NeedUpdGrid2
.text:005045D2 90                                   nop
.text:005045D3 85 C9                                test    ecx, ecx
.text:005045D5 75 09                                jnz     short loc_5045E0
.text:005045D7 05 4C 02 00 00                       add     eax, 24Ch
.text:005045DC 89 10                                mov     [eax], edx
.text:005045DE EB 05                                jmp     short loc_5045E5
.text:005045E0
.text:005045E0                      loc_5045E0:                             ; CODE XREF: ScanFunc+BDj
.text:005045E0 E8 7F 33 FD FF                       call    @Grids@TCustomGrid@SetRowCount$qqri ; Grids::TCustomGrid::SetRowCount(int)

.text:005045E5
.text:005045E5                      loc_5045E5:                             ; CODE XREF: ScanFunc+C6j
.text:005045E5 83 05 98 74 53 00 01                 add     CurRow, 1
.text:005045EC 73 05                                jnb     short loc_5045F3
.text:005045EE E8 B1 F5 EF FF                       call    System_Error_5
.text:005045F3
.text:005045F3                      loc_5045F3:                             ; CODE XREF: ScanFunc+D4j
.text:005045F3 8B 15 98 74 53 00                    mov     edx, CurRow
.text:005045F9 85 D2                                test    edx, edx


---------------------------------------------------------------------------------------

4.46 orig

.text:00504559                      loc_504559:                             ; CODE XREF: ScanFunc+3Aj
.text:00504559 0F B7 15 94 74 53 00                 movzx   edx, word_537494
.text:00504560 A1 08 4A 53 00                       mov     eax, lpObj
.text:00504565 8B 00                                mov     eax, [eax]
.text:00504567 8B 80 88 06 00 00                    mov     eax, [eax+688h]
.text:0050456D E8 BE 55 FD FF                       call    @Grids@TStringGrid@SetCells
.text:00504572 C6 05 69 74 53 00 00                 mov     byte_537469, 0
.text:00504579 C6 05 68 74 53 00 00                 mov     byte_537468, 0
.text:00504580 0F B7 05 94 74 53 00                 movzx   eax, CurCol
.text:00504587 0F B7 15 C8 44 53 00                 movzx   edx, word_5344C8
.text:0050458E 83 EA 01                             sub     edx, 1
.text:00504591 71 05                                jno     short loc_504598
.text:00504593 E8 0C F6 EF FF                       call    System_Error_5
.text:00504598
.text:00504598                      loc_504598:                             ; CODE XREF: ScanFunc+79j
.text:00504598 3B C2                                cmp     eax, edx
.text:0050459A 7D 11                                jge     short loc_5045AD
.text:0050459C 66 83 05 94 74 53 00 01              add     CurCol, 1
.text:005045A4 73 05                                jnb     short loc_5045AB
.text:005045A6 E8 F9 F5 EF FF                       call    System_Error_5
.text:005045AB
.text:005045AB                      loc_5045AB:                             ; CODE XREF: ScanFunc+8Cj
.text:005045AB EB 67                                jmp     short loc_504614
.text:005045AD                      loc_5045AD:                             ; CODE XREF: ScanFunc+82j
.text:005045AD 66 C7 05 94 74 53 00 00              mov     CurCol, 0
.text:005045B6 A1 08 4A 53 00                       mov     eax, lpObj
.text:005045BB 8B 00                                mov     eax, [eax]
.text:005045BD 8B 80 88 06 00 00                    mov     eax, [eax+688h]
.text:005045C3 8B 90 4C 02 00 00                    mov     edx, [eax+24Ch]
.text:005045C9 83 C2 01                             add     edx, 1
.text:005045CC 71 05                                jno     short loc_5045D3
.text:005045CE E8 D1 F5 EF FF                       call    System_Error_5
.text:005045D3
.text:005045D3                      loc_5045D3:                             ; CODE XREF: ScanFunc+B4j
.text:005045D3 A1 08 4A 53 00                       mov     eax, lpObj
.text:005045D8 8B 00                                mov     eax, [eax]
.text:005045DA 8B 80 88 06 00 00                    mov     eax, [eax+688h]
.text:005045E0 E8 7F 33 FD FF                       call    @Grids@TCustomGrid@SetRowCount
.text:005045E5 83 05 98 74 53 00 01                 add     CurRow, 1
.text:005045EC 73 05                                jnb     short loc_5045F3
.text:005045EE E8 B1 F5 EF FF                       call    System_Error_5
.text:005045F3
.text:005045F3                      loc_5045F3:                             ; CODE XREF: ScanFunc+D4j
.text:005045F3 8B 15 98 74 53 00                    mov     edx, CurRow
.text:005045F9 85 D2                                test    edx, edx





