Function at 0x5982b810
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 5
push 0
push 0
dec ecx
jne 0x5982b819
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x5982b83a
xor edx, edx
mov dword [eax], edx
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x5982b845
xor edx, edx
mov dword [eax], edx
xor eax, eax
push ebp
push 0x5982ba9d
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x20]
push 0
push 0x1f4
lea edx, [ebp - 0x10]
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x328]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
cmp byte [ebp + 8], 0
je 0x5982b8a1
push 0
push 0x1f4
lea edx, [ebp - 0x14]
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x330]
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
cmp byte [ebp + 0xc], 0
je 0x5982b8e6
push 0
push 0x1f4
lea edx, [ebp - 0x18]
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x338]
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
push 0
push 0x64
lea edx, [ebp - 0x1c]
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x340]
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
jmp 0x5982b906
push 0
push 0x1388
lea edx, [ebp - 0x20]
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x338]
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__System__DynArrayLength_qqrv
push eax
mov eax, dword [ebp + 0x18]
mov ecx, 1
mov edx, dword [sym.imp.madBasic_.bpl___xp_22Madtypes_TDANativeUInt]
call sub.rtl120.bpl__System__DynArraySetLength_qqrv
add esp, 4
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__System__DynArrayLength_qqrv
push eax
mov eax, dword [ebp + 0x14]
mov ecx, 1
mov edx, dword [sym.imp.madBasic_.bpl___xp_20Madtypes_TDACardinal]
call sub.rtl120.bpl__System__DynArraySetLength_qqrv
add esp, 4
mov eax, dword [ebp + 0x10]
xor edx, edx
mov dword [eax], edx
mov eax, dword [ebp - 0xc]
call sub.rtl120.bpl__System__DynArrayHigh_qqrv
mov esi, eax
test esi, esi
jl 0x5982ba31
inc esi
xor ebx, ebx
call sub.kernel32.dll_GetVersion
test eax, 0x80000000
jne 0x5982b996
push 0
push 0
push 3
push 0
push 3
push 0x80000000
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + ebx*4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.kernel32.dll_CreateFileW
mov edx, dword [ebp + 0x18]
mov edx, dword [edx]
mov dword [edx + ebx*4], eax
jmp 0x5982b9ce
push 0
push 0
push 3
push 0
push 3
push 0x80000000
lea eax, [ebp - 0x24]
mov edx, dword [ebp - 0xc]
mov edx, dword [edx + ebx*4]
mov ecx, 0
call sub.rtl120.bpl__System__LStrFromUStr_qqrr27System__AnsiStringT_us_i0__x20System_UnicodeStringus
mov eax, dword [ebp - 0x24]
call sub.rtl120.bpl__System__LStrToPChar_qqrx27System__AnsiStringT_us_i0__
push eax
call sub.kernel32.dll_CreateFileA
mov edx, dword [ebp + 0x18]
mov edx, dword [edx]
mov dword [edx + ebx*4], eax
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov edi, dword [eax + ebx*4]
cmp edi, 0xffffffff
je 0x5982ba1d
mov eax, dword [ebp + 0x10]
inc dword [eax]
push 0
mov eax, dword [ebp + 0x18]
push edi
call sub.kernel32.dll_GetFileSize
mov edx, dword [ebp + 0x14]
mov edx, dword [edx]
mov dword [edx + ebx*4], eax
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
mov eax, dword [eax + ebx*4]
shr eax, 4
xor edx, edx
push edx
push eax
lea edx, [ebp - 0x28]
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x350]
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
jmp 0x5982ba29
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov dword [eax + ebx*4], 0xffffffff
inc ebx
dec esi
jne 0x5982b960
mov eax, dword [ebp + 0x10]
cmp dword [eax], 0
jg 0x5982ba43
cmp dword [ebp - 0xc], 0
je 0x5982ba43
xor ebx, ebx
jmp 0x5982ba45
mov bl, 1
push 0
push 0x3e8
lea edx, [ebp - 0x2c]
mov eax, dword [ebp - 8]
mov ecx, dword [eax]
call dword [ecx + 0x358]
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x24]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5982baa4
lea eax, [ebp - 0x2c]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 0x24]
call sub.rtl120.bpl__System__LStrClr_qqrpv
lea eax, [ebp - 0x20]
mov edx, 5
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret