Function at 0x47a230
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov ebx, dword [ebp + 8]
mov dword [esp + 0xc], str.InitFwImage
mov dword [esp + 8], 0x52fdeb
mov dword [esp + 4], 0x400
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00421b78
mov dword [esp + 4], 0x52fe02
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov esi, eax
mov dword [esp + 8], str.allocating_buffers_for_FW_images...
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00421b78
mov eax, dword [ebx + 4]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00422d58
mov dword [ebx + 0xc], eax
mov dword [esp], eax
call fcn.0050963c
mov dword [ebx + 0x20], eax
test esi, esi
je 0x47a58f
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov edx, dword [ebx + 0xc]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_fread
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.msvcrt.dll_fseek
mov dword [esp], ebx
call fcn.00479ba4
mov dword [esp], ebx
call fcn.0047a120
test al, al
je 0x47a565
mov dword [esp], ebx
call fcn.00479be8
mov dword [ebx + 0x40], eax
mov dword [esp], eax
call fcn.0050963c
mov dword [ebx + 0x28], eax
test eax, eax
je 0x47a53b
mov dword [esp + 8], str.allocating_buffers_for_primary_secondary_security_FW_images...
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00421b78
cmp byte [ebx + 0x6d], 0
jne 0x47a454
mov edx, dword [ebx + 0x54]
inc edx
mov dword [ebx + 0x54], edx
mov ecx, dword [ebx + 0x20]
movzx eax, byte [ecx + edx + 3]
xor eax, dword [ebx + 0x48]
shl eax, 8
movzx edi, byte [ecx + edx + 2]
xor eax, edi
shl eax, 8
movzx edi, byte [ecx + edx + 1]
xor eax, edi
shl eax, 8
movzx edx, byte [ecx + edx]
xor eax, edx
mov dword [ebx + 0x48], eax
cmp eax, 0x400000
jne 0x47a505
mov dword [esp], 0x400000
call fcn.0050963c
mov dword [ebx + 0x24], eax
test eax, eax
je 0x47a60d
mov dword [esp + 8], str.loading_buffers_for_FW_images...
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00421b78
mov dword [esp], esi
call sub.msvcrt.dll_rewind
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0x400000
mov dword [esp + 4], 1
mov eax, dword [ebx + 0x24]
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 0x400000
jne 0x47a5e3
mov dword [esp + 8], str.loading_buffers_for_FUPH...
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00421b78
mov dword [esp + 8], 0
mov eax, dword [ebx + 0x48]
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_fseek
mov dword [esp + 0xc], esi
mov eax, dword [ebx + 0x40]
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [ebx + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, dword [ebx + 0x40]
jne 0x47a5b9
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov al, 1
add esp, 0x4c
pop ebx
pop esi
pop edi
leave
ret
mov dword [ebx + 0x48], 0
lea eax, [ebp - 0x19]
mov dword [esp + 8], eax
mov dword [esp + 4], str.IFWI
lea edi, [ebp - 0x20]
mov dword [esp], edi
call fcn.004da74c
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov eax, dword [ebx + 4]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.0042159c
mov dword [ebx + 0x54], eax
mov edx, dword [ebp - 0x20]
lea edi, [edx - 0xc]
cmp edi, 0x521134
jne 0x47a637
cmp eax, 0xffffffff
je 0x47a4c0
add eax, 4
mov dword [ebx + 0x54], eax
add eax, dword [ebx + 0x20]
mov eax, dword [eax]
mov dword [ebx + 0x48], eax
jmp 0x47a377
mov dword [esp + 8], str.IFWI_has_invalid_FUP_header
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x70]
mov dword [esp], eax
call fcn.00421b78
mov dword [esp], 4
call fcn.0050981c
mov dword [eax], 0xa
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5373fc
mov dword [esp], eax
call fcn.0050a02c
mov dword [esp], str.unknown_m_ifwi_size_size
call sub.msvcrt.dll_printf
mov dword [esp], 4
call fcn.0050981c
mov dword [eax], 6
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5373fc
mov dword [esp], eax
call fcn.0050a02c
mov dword [esp], 4
call fcn.0050981c
mov dword [eax], 5
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5373fc
mov dword [esp], eax
call fcn.0050a02c
mov dword [esp], 4
call fcn.0050981c
mov dword [eax], str.Ifwi_image_didnt_include_a_fuph_header
mov dword [esp + 8], 0
mov dword [esp + 4], 0x536b20
mov dword [esp], eax
call fcn.0050a02c
mov dword [esp], 4
call fcn.0050981c
mov dword [eax], 8
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5373fc
mov dword [esp], eax
call fcn.0050a02c
mov dword [esp], 4
call fcn.0050981c
mov dword [eax], 6
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5373fc
mov dword [esp], eax
call fcn.0050a02c
mov dword [esp], 4
call fcn.0050981c
mov dword [eax], 6
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5373fc
mov dword [esp], eax
call fcn.0050a02c
mov dword [esp], 4
call fcn.0050981c
mov dword [eax], 5
mov dword [esp + 8], 0
mov dword [esp + 4], 0x5373fc
mov dword [esp], eax
call fcn.0050a02c
cmp dword [0x51b4e0], 0
jne 0x47a758
mov eax, dword [edi + 8]
lea edx, [eax - 1]
mov dword [edi + 8], edx
test eax, eax
jle 0x47a744
mov eax, dword [ebx + 0x54]
jmp 0x47a4a8
lea eax, [ebp - 0x1a]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.004d9148
jmp 0x47a655
mov dword [esp + 4], 0xffffffff
sub edx, 4
mov dword [esp], edx
call fcn.004ae5e4
jmp 0x47a64d