Function at 0x4a2ad4
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x19]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x56ac7b
lea esi, [ebp - 0x2c]
mov dword [esp], esi
call fcn.00509af0
mov dword [esp + 0xc], str.InitFwImage
mov dword [esp + 8], esi
mov dword [esp + 4], 0x400
mov eax, dword [ebx + 0x78]
mov dword [esp], eax
call fcn.0042ddbc
mov eax, dword [ebp - 0x2c]
lea esi, [eax - 0xc]
cmp esi, 0x55a154
jne 0x4a2f0f
mov dword [esp + 4], 0x56acbe
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov esi, eax
lea eax, [ebp - 0x1a]
mov dword [esp + 8], eax
mov dword [esp + 4], str.allocating_buffers_for_FW_images...
lea edi, [ebp - 0x30]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp + 8], edi
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x78]
mov dword [esp], eax
call fcn.0042ddbc
mov eax, dword [ebp - 0x30]
lea edi, [eax - 0xc]
mov edx, 0x55a154
cmp edx, edi
jne 0x4a303f
mov eax, dword [ebx + 4]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x78]
mov dword [esp], eax
call fcn.0042ef1c
mov dword [ebx + 0xc], eax
mov dword [esp], ebx
call fcn.004a288c
mov eax, dword [ebx + 0xc]
mov dword [esp], eax
call fcn.00538984
mov dword [ebx + 0x20], eax
test esi, esi
je 0x4a2fd7
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
test eax, eax
je 0x4a30d5
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.004a2040
mov dword [esp], ebx
call fcn.004a21a0
test al, al
je 0x4a30a3
mov eax, dword [ebx + 0x64]
test eax, eax
je 0x4a2e14
mov dword [ebx + 0x40], 0xa4
mov byte [ebx + 0x75], 1
mov eax, 0xa4
mov dword [esp], eax
call fcn.00538984
mov dword [ebx + 0x28], eax
test eax, eax
je 0x4a3107
lea eax, [ebp - 0x1b]
mov dword [esp + 8], eax
mov dword [esp + 4], str.allocating_buffers_for_primary_secondary_security_FW_images...
lea edi, [ebp - 0x34]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp + 8], edi
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x78]
mov dword [esp], eax
call fcn.0042ddbc
mov eax, dword [ebp - 0x34]
lea edi, [eax - 0xc]
mov ecx, 0x55a154
cmp ecx, edi
jne 0x4a2fa5
cmp byte [ebx + 0x75], 0
jne 0x4a2e24
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 0x4a3001
mov dword [esp], 0x400000
call fcn.00538984
mov dword [ebx + 0x24], eax
test eax, eax
je 0x4a316b
lea eax, [ebp - 0x1e]
mov dword [esp + 8], eax
mov dword [esp + 4], str.loading_buffers_for_FW_images...
lea edi, [ebp - 0x40]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp + 8], edi
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x78]
mov dword [esp], eax
call fcn.0042ddbc
mov eax, dword [ebp - 0x40]
lea edi, [eax - 0xc]
mov edx, 0x55a154
cmp edx, edi
jne 0x4a2f73
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 0x4a3139
lea eax, [ebp - 0x1f]
mov dword [esp + 8], eax
mov dword [esp + 4], str.loading_buffers_for_FUPH...
lea edi, [ebp - 0x44]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp + 8], edi
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x78]
mov dword [esp], eax
call fcn.0042ddbc
mov eax, dword [ebp - 0x44]
lea edi, [eax - 0xc]
mov ecx, 0x55a154
cmp ecx, edi
jne 0x4a2f41
mov edi, dword [ebx + 0x64]
test edi, edi
je 0x4a2df8
mov dword [esp + 8], 0
mov eax, dword [ebx + 0x68]
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 0x4a3071
mov ecx, dword [ebx + 0x64]
test ecx, ecx
jne 0x4a2e94
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov al, 1
add esp, 0x7c
pop ebx
pop esi
pop edi
leave
ret
mov dword [esp + 8], 0
mov eax, dword [ebx + 0x48]
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_fseek
jmp 0x4a2db2
mov dword [esp], ebx
call fcn.004a2084
mov dword [ebx + 0x40], eax
jmp 0x4a2c25
mov dword [ebx + 0x48], 0
lea eax, [ebp - 0x1c]
mov dword [esp + 8], eax
mov dword [esp + 4], str.IFWI
lea edi, [ebp - 0x38]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov eax, dword [ebx + 4]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x78]
mov dword [esp], eax
call fcn.0042d7e0
mov dword [ebx + 0x54], eax
mov edx, dword [ebp - 0x38]
lea edi, [edx - 0xc]
mov ecx, 0x55a154
cmp ecx, edi
jne 0x4a31b5
cmp eax, 0xffffffff
je 0x4a2ea4
add eax, 4
mov dword [ebx + 0x54], eax
add eax, dword [ebx + 0x20]
mov eax, dword [eax]
mov dword [ebx + 0x48], eax
jmp 0x4a2cb8
mov dword [esp], ebx
call fcn.004a2544
jmp 0x4a2de4
lea eax, [ebp - 0x1d]
mov dword [esp + 8], eax
mov dword [esp + 4], str.IFWI_has_invalid_FUP_header
lea edi, [ebp - 0x3c]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp + 8], edi
mov dword [esp + 4], 8
mov eax, dword [ebx + 0x78]
mov dword [esp], eax
call fcn.0042ddbc
mov dword [esp], edi
call fcn.0050a12c
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], 0xa
mov dword [esp + 8], 0
mov dword [esp + 4], 0x57285c
mov dword [esp], eax
call fcn.00539374
cmp dword [0x554500], 0
jne 0x4a320b
mov eax, dword [esi + 8]
lea edx, [eax - 1]
mov dword [esi + 8], edx
test eax, eax
jg 0x4a2b2b
lea eax, [ebp - 0x23]
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.005084ec
jmp 0x4a2b2b
cmp dword [0x554500], 0
jne 0x4a31db
mov eax, dword [edi + 8]
lea edx, [eax - 1]
mov dword [edi + 8], edx
test eax, eax
jg 0x4a2d94
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.005084ec
jmp 0x4a2d94
cmp dword [0x554500], 0
jne 0x4a3223
mov eax, dword [edi + 8]
lea edx, [eax - 1]
mov dword [edi + 8], edx
test eax, eax
jg 0x4a2d1e
lea eax, [ebp - 0x27]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.005084ec
jmp 0x4a2d1e
cmp dword [0x554500], 0
jne 0x4a31f3
mov eax, dword [edi + 8]
lea edx, [eax - 1]
mov dword [edi + 8], edx
test eax, eax
jg 0x4a2c7c
lea eax, [ebp - 0x25]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.005084ec
jmp 0x4a2c7c
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], 8
mov dword [esp + 8], 0
mov dword [esp + 4], 0x57285c
mov dword [esp], eax
call fcn.00539374
mov dword [esp], str.unknown_m_ifwi_size_size
call sub.msvcrt.dll_printf
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], 6
mov dword [esp + 8], 0
mov dword [esp + 4], 0x57285c
mov dword [esp], eax
call fcn.00539374
cmp dword [0x554500], 0
jne 0x4a319d
mov eax, dword [edi + 8]
lea edx, [eax - 1]
mov dword [edi + 8], edx
test eax, eax
jg 0x4a2b84
lea eax, [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.005084ec
jmp 0x4a2b84
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], 6
mov dword [esp + 8], 0
mov dword [esp + 4], 0x57285c
mov dword [esp], eax
call fcn.00539374
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], str.Ifwi_image_didnt_include_a_fuph_header
mov dword [esp + 8], 0
mov dword [esp + 4], 0x571f80
mov dword [esp], eax
call fcn.00539374
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], 8
mov dword [esp + 8], 0
mov dword [esp + 4], 0x57285c
mov dword [esp], eax
call fcn.00539374
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], 5
mov dword [esp + 8], 0
mov dword [esp + 4], 0x57285c
mov dword [esp], eax
call fcn.00539374
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], 6
mov dword [esp + 8], 0
mov dword [esp + 4], 0x57285c
mov dword [esp], eax
call fcn.00539374
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov dword [esp], 4
call fcn.00538b64
mov dword [eax], 5
mov dword [esp + 8], 0
mov dword [esp + 4], 0x57285c
mov dword [esp], eax
call fcn.00539374
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004dd8dc
jmp 0x4a3055
cmp dword [0x554500], 0
jne 0x4a345a
mov eax, dword [edi + 8]
lea edx, [eax - 1]
mov dword [edi + 8], edx
test eax, eax
jle 0x4a3446
mov eax, dword [ebx + 0x54]
jmp 0x4a2e79
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004dd8dc
jmp 0x4a2f57
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004dd8dc
jmp 0x4a2fbb
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004dd8dc
jmp 0x4a2f25
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004dd8dc
jmp 0x4a2f89
lea eax, [ebp - 0x26]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.005084ec
jmp 0x4a31d3
mov dword [esp + 4], 0xffffffff
sub edx, 4
mov dword [esp], edx
call fcn.004dd8dc
jmp 0x4a31cb