Function at 0x402840
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x5c
mov dword [esp + 0x4c], ebx
mov ebx, dword [esp + 0x68]
mov dword [esp + 0x54], edi
mov edi, edx
mov edx, dword [esp + 0x6c]
mov dword [esp + 0x58], ebp
mov dword [esp + 0x50], esi
mov esi, dword [esp + 0x60]
mov ebp, ebx
or ebp, edx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x64]
je 0x402937
mov ebp, esi
or ebp, eax
je 0x402937
test eax, eax
je 0x402940
mov ebp, dword [esp + 0x70]
test ebp, ebp
je 0x402937
mov ecx, dword [esp + 0x70]
mov dword [esp + 8], edx
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ecx
mov dword [esp + 4], ebx
mov dword [esp], str.Size_truncation_prevents_reading_0x_llx_elements_of_size_0x_llx_for__s_n
call fcn.00436bb0
xor edx, edx
mov eax, edx
mov ebx, dword [esp + 0x4c]
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
mov ebp, dword [esp + 0x58]
add esp, 0x5c
ret
mov edx, dword [esp + 0x20]
test edx, edx
je 0x402a8d
mov dword [esp], edx
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp + 0x24], edx
call sub.msvcrt.dll_fread
mov edx, dword [esp + 0x24]
cmp ebx, eax
je 0x4028b7
mov eax, dword [esp + 0x70]
test eax, eax
je 0x402929
mov ebx, dword [esp + 0x70]
mov ecx, dword [esp + 0x28]
mov dword [esp], str.Unable_to_read_in_0x_llx_bytes_of__s_n
mov dword [esp + 0xc], ebx
mov ebx, dword [esp + 0x2c]
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
call fcn.00436bb0
mov edx, dword [esp + 0x24]
cmp edx, dword [esp + 0x20]
je 0x402937
mov dword [esp], edx
call sub.msvcrt.dll_free
xor edx, edx
jmp 0x4028b7
test edx, edx
jne 0x402885
mov eax, esi
mul ebx
cmp edx, 0
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], edx
jbe 0x402a02
mov ebp, dword [0x471090]
mov dword [esp + 0x38], ebp
mov ebp, dword [0x471094]
cmp dword [esp + 0x2c], ebp
ja 0x402a56
jb 0x402987
mov eax, dword [esp + 0x38]
cmp dword [esp + 0x28], eax
ja 0x402a56
mov edx, dword [0x471098]
add edx, ecx
mov dword [esp + 0x3c], edx
mov eax, dword [esp + 0x3c]
xor edx, edx
add eax, dword [esp + 0x28]
adc edx, dword [esp + 0x2c]
cmp ebp, edx
jbe 0x402a49
mov ebp, dword [esp + 0x3c]
mov dword [esp + 8], 0
mov dword [esp], edi
mov dword [esp + 0x24], ecx
mov dword [esp + 4], ebp
call sub.msvcrt.dll_fseek
mov ecx, dword [esp + 0x24]
test eax, eax
je 0x4028cd
mov edx, dword [esp + 0x70]
test edx, edx
je 0x402937
mov ebx, dword [esp + 0x70]
add ecx, dword [0x471098]
mov dword [esp], str.Unable_to_seek_to_0x_lx_for__s_n
mov dword [esp + 8], ebx
mov dword [esp + 4], ecx
call fcn.00436bb0
xor edx, edx
jmp 0x4028b7
cmp eax, ebx
jae 0x40295d
mov edi, dword [esp + 0x70]
test edi, edi
je 0x402937
mov ecx, dword [esp + 0x70]
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], 0
mov dword [esp + 4], ebx
mov dword [esp + 0x14], ecx
mov dword [esp + 8], 0
mov dword [esp], str.Size_overflow_prevents_reading_0x_llx_elements_of_size_0x_llx_for__s_n
call fcn.00436bb0
xor edx, edx
jmp 0x4028b7
jb 0x402a56
cmp dword [esp + 0x38], eax
nop
jae 0x4029a9
mov ecx, dword [esp + 0x70]
test ecx, ecx
je 0x402937
mov ecx, dword [esp + 0x70]
mov edx, dword [esp + 0x28]
mov dword [esp], str.Reading_0x_llx_bytes_extends_past_end_of_file_for__s_n
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 4], edx
mov dword [esp + 8], ecx
call fcn.00436bb0
xor edx, edx
jmp 0x4028b7
mov eax, dword [esp + 0x28]
add eax, 1
mov dword [esp], eax
call sub.msvcrt.dll_malloc
test eax, eax
mov edx, eax
je 0x402aaf
mov eax, dword [esp + 0x28]
mov byte [edx + eax], 0
jmp 0x4028d9
cmp dword [esp + 0x70], 0
je 0x402937
mov ebp, dword [esp + 0x70]
mov ecx, dword [esp + 0x28]
mov ebx, dword [esp + 0x2c]
mov dword [esp], str.Out_of_memory_allocating_0x_llx_bytes_for__s_n
mov dword [esp + 0xc], ebp
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov dword [esp + 0x24], eax
call fcn.00436bb0
mov edx, dword [esp + 0x24]
jmp 0x4028b7