Function at 0x5982de7c
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffdcc
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x234], ebx
mov dword [ebp - 0x224], ebx
mov dword [ebp - 0x228], ebx
mov dword [ebp - 0x22c], ebx
mov dword [ebp - 0x230], ebx
mov dword [ebp - 0x21c], ebx
mov dword [ebp - 0x220], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov edi, eax
mov ebx, dword [ebp + 0xc]
xor eax, eax
push ebp
push 0x5982e0e3
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
push 0
push 0
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_SetFilePointer
movzx eax, byte [edi + 0x8f]
mov byte [ebp - 0xd], al
cmp byte [ebp - 0xd], 0
je 0x5982e09f
cmp byte [sym.madExcept_.bpl__Madexcept_ForceUtf8], 0
jne 0x5982df07
mov eax, ebx
call sym.madExcept_.bpl__Madexcept_IsTrueUnicodeString_qqrx20System_UnicodeString
test al, al
je 0x5982df44
push 0x5982e104
lea edx, [ebp - 0x220]
mov eax, ebx
call sub.madBasic_.bpl__Madstrings_EncodeUtf8_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x220]
lea edx, [ebp - 0x21c]
call sub.madBasic_.bpl__Madcrypt_Encode_qqrx27System__AnsiStringT_us_i0__
push dword [ebp - 0x21c]
push 0x5982e11c
lea eax, [ebp - 4]
mov edx, 3
call sub.rtl120.bpl__System__LStrCatN_qqrv
jmp 0x5982df53
lea eax, [ebp - 4]
mov edx, ebx
mov ecx, 0
call sub.rtl120.bpl__System__LStrFromUStr_qqrr27System__AnsiStringT_us_i0__x20System_UnicodeStringus
push 0x5982e12c
lea eax, [ebp - 0x228]
mov edx, dword [0x59857a8c]
mov ecx, 0
call sub.rtl120.bpl__System__LStrFromPChar_qqrr27System__AnsiStringT_us_i0__pcus
push dword [ebp - 0x228]
push 0x5982e13c
push 0x5982e14c
lea edx, [ebp - 0x230]
mov eax, ebx
call fcn.5982badc
mov edx, dword [ebp - 0x230]
lea eax, [ebp - 0x22c]
mov ecx, 0
call sub.rtl120.bpl__System__LStrFromUStr_qqrr27System__AnsiStringT_us_i0__x20System_UnicodeStringus
push dword [ebp - 0x22c]
push 0x5982e168
push dword [ebp - 4]
push 0x5982e180
push 0x5982e13c
push 0x5982e190
push 0x5982e13c
push 0x5982e1c0
push dword [ebp - 4]
push 0x5982e180
push 0x5982e13c
push 0x5982e13c
lea eax, [ebp - 0x224]
mov edx, 0x10
call sub.rtl120.bpl__System__LStrCatN_qqrv
mov edx, dword [ebp - 0x224]
mov eax, edi
call fcn.5982cf8c
mov esi, dword [ebp - 0xc]
test esi, esi
jbe 0x5982e09f
cmp esi, 0xff
jbe 0x5982e011
mov ebx, 0xff
jmp 0x5982e013
mov ebx, esi
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
lea eax, [ebp - 0x215]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_ReadFile
test eax, eax
je 0x5982e033
cmp ebx, dword [ebp - 0x14]
je 0x5982e045
mov edx, 0x5982e13c
mov eax, edi
call fcn.5982cf8c
mov byte [ebp - 0xd], 0
jmp 0x5982e09f
lea ecx, [ebp - 0x234]
lea eax, [ebp - 0x215]
mov edx, ebx
call sub.madBasic_.bpl__Madcrypt_Encode_qqrpvi
lea eax, [ebp - 0x234]
mov edx, 0x5982e13c
call sub.rtl120.bpl__System__LStrCat_qqrv
mov edx, dword [ebp - 0x234]
mov eax, edi
call fcn.5982cf8c
sub esi, ebx
cmp dword [ebp + 8], 0
je 0x5982e097
mov eax, dword [ebp - 0xc]
sub eax, esi
imul eax, eax, 0x3e8
xor edx, edx
div dword [ebp - 0xc]
mov edx, eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
call dword [ecx + 0x18]
test esi, esi
ja 0x5982e002
mov eax, dword [ebp + 8]
mov edx, dword [eax]
call dword [edx + 0x24]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5982e0ea
lea eax, [ebp - 0x234]
call sub.rtl120.bpl__System__LStrClr_qqrpv
lea eax, [ebp - 0x230]
call sub.rtl120.bpl__System__UStrClr_qqrpv
lea eax, [ebp - 0x22c]
mov edx, 5
call sub.rtl120.bpl__System__LStrArrayClr_qqrpvi
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
ret