Function at 0x402770
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.00419c29
add esp, 0x10
cmp eax, 0x20
je 0x4027c0
push str.ERROR__Couldnt_properly_read_out_FFUSecurityHeader_n
push 0x934
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.00429070
mov ecx, eax
or ecx, edx
je 0x4027f8
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.0041935a
push ebx
mov ebx, dword [ebp - 4]
push 0x18
push 1
push ebx
call fcn.00419c29
add esp, 0x20
cmp eax, 0x18
je 0x402827
push str.ERROR__Couldnt_properly_read_out_FFUImageHeader_n
push 0x945
jmp 0x4027aa
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.00429070
mov ecx, eax
or ecx, edx
je 0x402858
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.0041935a
push ebx
mov ebx, dword [ebp + 8]
push 0xf8
push 1
add ebx, 0x848
push ebx
call fcn.00419c29
add esp, 0x20
cmp eax, 0xf8
je 0x402895
push str.ERROR__Couldnt_properly_read_out_FFUStoreHeader_n
push 0x950
jmp 0x4027aa
add esi, 0xf8
adc edi, 0
mov eax, esi
and eax, 0xf
xor ecx, ecx
mov edx, eax
or edx, ecx
je 0x4028ba
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 0x4028d6
push eax
call fcn.00418f16
mov ecx, dword [ebp + 8]
add esp, 4
mov dword [ecx + 0x940], eax
mov eax, dword [ebx + 0xd4]
test eax, eax
je 0x4028f2
push eax
call fcn.00418f16
mov edx, dword [ebp + 8]
add esp, 4
mov dword [edx + 0x944], eax
mov ecx, dword [ebx + 0xdc]
cmp ecx, 0xf4240
jae 0x402a16
mov eax, dword [ebx + 0xd4]
cmp eax, 0xf4240
jae 0x402a16
cmp dword [ebx + 0xd0], 0x10000000
jae 0x402a16
test ecx, ecx
je 0x402935
mov edx, dword [ebp + 8]
cmp dword [edx + 0x940], 0
je 0x402945
test eax, eax
je 0x402954
mov eax, dword [ebp + 8]
cmp dword [eax + 0x944], 0
jne 0x402954
push str.ERROR__Failed_to_allocate_space_for_validation_entries_or_blockdataentries_n
push 0x963
jmp 0x4027aa
test ecx, ecx
je 0x4029a2
mov ecx, dword [ebp + 0xc]
push 0
push edi
push esi
push ecx
call fcn.0041935a
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.00419c29
mov ecx, dword [ebp - 4]
add esp, 0x20
cmp eax, ecx
je 0x40299d
push str.ERROR__Failed_to_read_validation_entries_n
push 0x96d
jmp 0x4027aa
add esi, ecx
adc edi, 0
cmp dword [ebx + 0xd4], 0
jbe 0x4029f5
mov ecx, dword [ebp + 0xc]
push 0
push edi
push esi
push ecx
call fcn.0041935a
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.00419c29
mov ecx, dword [ebp - 4]
add esp, 0x20
cmp eax, ecx
je 0x4029f0
push str.ERROR__Failed_to_read_block_data_entries_n
push 0x979
jmp 0x4027aa
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.00402670
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