Function at 0x402790
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 8]
push ebx
push esi
lea esi, [eax + 0x810]
add eax, 0x830
push edi
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push eax
push 0x20
push 1
push esi
call fcn.00419559
add esp, 0x10
cmp eax, 0x20
je 0x4027e0
push str.ERROR__Couldnt_properly_read_out_FFUSecurityHeader_n
push 0x94f
push str.ParseFFUHeaders
push 1
call fcn.00401210
add esp, 0x10
push 1
call fcn.004017c0
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0x1c]
mov edx, dword [esi + 0x18]
shl eax, 0xa
lea esi, [ecx + edx + 0x20]
cdq
push edx
mov ebx, eax
push ebx
xor edi, edi
push edi
push esi
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x14], edx
call fcn.004289a0
mov ecx, eax
or ecx, edx
je 0x402818
sub ebx, eax
mov eax, dword [ebp - 0x14]
sbb eax, edx
add esi, ebx
adc edi, eax
mov ebx, dword [ebp + 0xc]
push 0
push edi
push esi
push ebx
call fcn.00418c8a
push ebx
mov ebx, dword [ebp - 4]
push 0x18
push 1
push ebx
call fcn.00419559
add esp, 0x20
cmp eax, 0x18
je 0x402847
push str.ERROR__Couldnt_properly_read_out_FFUImageHeader_n
push 0x960
jmp 0x4027ca
mov edx, dword [ebx + 0x10]
mov ebx, dword [ebp - 0x10]
xor eax, eax
add edx, 0x18
adc eax, eax
add esi, edx
adc edi, eax
mov eax, dword [ebp - 0xc]
push eax
push ebx
push edi
push esi
mov dword [ebp - 0x14], eax
call fcn.004289a0
mov ecx, eax
or ecx, edx
je 0x402878
sub ebx, eax
mov eax, dword [ebp - 0x14]
sbb eax, edx
add esi, ebx
adc edi, eax
mov ebx, dword [ebp + 0xc]
push 0
push edi
push esi
push ebx
call fcn.00418c8a
push ebx
mov ebx, dword [ebp + 8]
push 0xf8
push 1
add ebx, 0x848
push ebx
call fcn.00419559
add esp, 0x20
cmp eax, 0xf8
je 0x4028b5
push str.ERROR__Couldnt_properly_read_out_FFUStoreHeader_n
push 0x96b
jmp 0x4027ca
add esi, 0xf8
adc edi, 0
mov eax, esi
and eax, 0xf
xor ecx, ecx
mov edx, eax
or edx, ecx
je 0x4028da
mov edx, 0x10
sub edx, eax
mov eax, ecx
sbb eax, ecx
add esi, edx
adc edi, eax
mov eax, dword [ebx + 0xdc]
test eax, eax
je 0x4028f6
push eax
call fcn.00418846
mov ecx, dword [ebp + 8]
add esp, 4
mov dword [ecx + 0x940], eax
mov eax, dword [ebx + 0xd4]
test eax, eax
je 0x402912
push eax
call fcn.00418846
mov edx, dword [ebp + 8]
add esp, 4
mov dword [edx + 0x944], eax
mov ecx, dword [ebx + 0xdc]
cmp ecx, 0xf4240
jae 0x402a36
mov eax, dword [ebx + 0xd4]
cmp eax, 0xf4240
jae 0x402a36
cmp dword [ebx + 0xd0], 0x10000000
jae 0x402a36
test ecx, ecx
je 0x402955
mov edx, dword [ebp + 8]
cmp dword [edx + 0x940], 0
je 0x402965
test eax, eax
je 0x402974
mov eax, dword [ebp + 8]
cmp dword [eax + 0x944], 0
jne 0x402974
push str.ERROR__Failed_to_allocate_space_for_validation_entries_or_blockdataentries_n
push 0x97e
jmp 0x4027ca
test ecx, ecx
je 0x4029c2
mov ecx, dword [ebp + 0xc]
push 0
push edi
push esi
push ecx
call fcn.00418c8a
mov edx, dword [ebx + 0xdc]
mov eax, dword [ebp + 0xc]
push eax
push edx
mov dword [ebp - 4], edx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x940]
push 1
push eax
call fcn.00419559
mov ecx, dword [ebp - 4]
add esp, 0x20
cmp eax, ecx
je 0x4029bd
push str.ERROR__Failed_to_read_validation_entries_n
push 0x988
jmp 0x4027ca
add esi, ecx
adc edi, 0
cmp dword [ebx + 0xd4], 0
jbe 0x402a15
mov ecx, dword [ebp + 0xc]
push 0
push edi
push esi
push ecx
call fcn.00418c8a
mov edx, dword [ebx + 0xd4]
mov eax, dword [ebp + 0xc]
push eax
push edx
mov dword [ebp - 4], edx
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x944]
push 1
push eax
call fcn.00419559
mov ecx, dword [ebp - 4]
add esp, 0x20
cmp eax, ecx
je 0x402a10
push str.ERROR__Failed_to_read_block_data_entries_n
push 0x994
jmp 0x4027ca
add esi, ecx
adc edi, 0
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
push edi
push esi
push ecx
push edx
call fcn.00402690
mov ecx, dword [ebp + 8]
add esp, 0x10
mov dword [ecx + 0x948], eax
mov dword [ecx + 0x94c], edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret