Function at 0x57021ac0
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe4
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x57021d83
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 8], eax
xor ecx, ecx
xor edx, edx
mov eax, dword [ebp + 0x14]
call fcn.57020704
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
je 0x57021d67
xor edx, edx
push ebp
push 0x57021d60
push dword fs:[edx]
mov dword fs:[edx], esp
push 0
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_GetFileSize
mov ebx, eax
mov eax, ebx
call sub.rtl120.bpl__System__GetMem_qqri
mov dword [ebp - 0xc], eax
xor edx, edx
push ebp
push 0x57021d42
push dword fs:[edx]
mov dword fs:[edx], esp
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_ReadFile
test eax, eax
je 0x57021d2c
cmp ebx, dword [ebp - 0x14]
jne 0x57021d2c
lea eax, [ebp - 0x18]
push eax
movzx eax, word [ebp + 0x10]
push eax
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
call sym.madBasic_.bpl__Madres_GetIconGroupResourceW_qqsuipbusrp17Madres_TIconGroup
test eax, eax
je 0x57021bc8
mov eax, dword [ebp - 0x18]
movzx eax, word [eax + 4]
push eax
lea eax, [ebp - 4]
mov ecx, 1
mov edx, dword [0x57021a58]
call sub.rtl120.bpl__System__DynArraySetLength_qqrv
add esp, 4
mov dword [ebp - 0x1c], 0x7fffffff
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__DynArrayHigh_qqrv
mov esi, eax
test esi, esi
jl 0x57021bcf
inc esi
xor ebx, ebx
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x18]
movzx eax, word [edx + eax*2 + 0x12]
mov edx, dword [ebp - 4]
mov dword [edx + ebx*4], eax
cmp eax, dword [ebp - 0x1c]
jge 0x57021bc2
mov dword [ebp - 0x1c], eax
inc ebx
dec esi
jne 0x57021ba2
jmp 0x57021bcf
mov dword [ebp - 0x1c], 0x32
movzx eax, word [ebp + 0x10]
push eax
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
call sym.madBasic_.bpl__Madres_DeleteIconGroupResourceW_qqsuipbus
mov eax, dword [ebp - 0xc]
movzx eax, word [eax + 4]
imul eax, eax, 0xe
add eax, 6
call sub.rtl120.bpl__System__GetMem_qqri
mov dword [ebp - 0x18], eax
xor eax, eax
push ebp
push 0x57021d25
push dword fs:[eax]
mov dword fs:[eax], esp
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0xc]
mov ecx, 6
call sub.rtl120.bpl__System_Move_qqrpxvpvi
mov eax, dword [ebp - 0xc]
movzx esi, word [eax + 4]
dec esi
test esi, esi
jl 0x57021ce6
inc esi
xor ebx, ebx
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x18]
lea edx, [edx + eax*2 + 6]
mov edi, ebx
add edi, edi
mov eax, dword [ebp - 0xc]
lea eax, [eax + edi*8 + 6]
mov ecx, 0xe
call sub.rtl120.bpl__System_Move_qqrpxvpvi
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__DynArrayLength_qqrv
cmp ebx, eax
jge 0x57021c74
mov eax, dword [ebp - 4]
movzx eax, word [eax + ebx*4]
mov edx, ebx
add edx, edx
add edx, edx
add edx, edx
sub edx, ebx
mov ecx, dword [ebp - 0x18]
mov word [ecx + edx*2 + 0x12], ax
jmp 0x57021c90
push ebp
lea eax, [ebp - 0x1c]
call fcn.57021a78
pop ecx
mov edx, ebx
add edx, edx
add edx, edx
add edx, edx
sub edx, ebx
mov ecx, dword [ebp - 0x18]
mov word [ecx + edx*2 + 0x12], ax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + edi*8 + 0xe]
push eax
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + edi*8 + 0x12]
add eax, dword [ebp - 0xc]
push eax
movzx eax, word [ebp + 0x10]
push eax
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x18]
movzx eax, word [edx + eax*2 + 0x12]
push eax
push 3
mov eax, dword [ebp + 8]
push eax
call sym.madBasic_.bpl__Madres_UpdateResourceW_qqsuipbt2uspvui
test eax, eax
jne 0x57021cde
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x57021d67
inc ebx
dec esi
jne 0x57021c27
mov eax, dword [ebp - 0x18]
movzx eax, word [eax + 4]
imul eax, eax, 0xe
add eax, 6
push eax
mov eax, dword [ebp - 0x18]
push eax
movzx eax, word [ebp + 0x10]
push eax
mov eax, dword [ebp + 0xc]
push eax
push 0xe
mov eax, dword [ebp + 8]
push eax
call sym.madBasic_.bpl__Madres_UpdateResourceW_qqsuipbt2uspvui
mov dword [ebp - 8], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x57021d2c
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__FreeMem_qqrpv
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x57021d49
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__System__FreeMem_qqrpv
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x57021d8a
lea eax, [ebp - 4]
mov edx, dword [0x57021a58]
call sub.rtl120.bpl__System__DynArrayClear_qqrrpvpv
ret