Function at 0x40fa80
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
mov eax, dword [0x436008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov ebx, edx
mov dword [ebp - 0x58], eax
mov eax, dword [ebp + 0xc]
push edi
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x5c], eax
call fcn.0040f060
mov esi, eax
test esi, esi
jne 0x40fad0
push str.ERROR:_Invalid_archive_n
call fcn.00404d10
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret
mov eax, dword [esi]
test eax, eax
je 0x40fc0d
push 0
push ebx
push eax
call dword [sym.imp.zip.dll_zip_name_locate]
mov edi, eax
add esp, 0xc
test edi, edi
jns 0x40fb16
push ebx
push str.NOTE:_zip_name_locate:__s_not_found_in_archive._n
call fcn.00404da0
add esp, 8
mov ecx, esi
call fcn.0040ff10
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x48]
push eax
call dword [sym.imp.zip.dll_zip_stat_init]
add esp, 4
lea ecx, [ebp - 0x48]
mov eax, edi
cdq
mov edi, edx
mov dword [ebp - 0x50], eax
push ecx
push 0
push edi
push eax
push dword [esi]
call dword [sym.imp.zip.dll_zip_stat_index]
add esp, 0x14
test eax, eax
je 0x40fb6b
push ebx
push str.ERROR:_zip_stat_index:__s_n
call fcn.00404d10
add esp, 8
mov ecx, esi
call fcn.0040ff10
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret
push 0
push edi
push dword [ebp - 0x50]
push dword [esi]
call dword [sym.imp.zip.dll_zip_fopen_index]
add esp, 0x10
mov dword [ebp - 0x4c], eax
test eax, eax
jne 0x40fb8b
push ebx
push str.ERROR:_zip_fopen_index:__s_n
jmp 0x40fb48
mov ebx, dword [ebp - 0x30]
lea eax, [ebx + 1]
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov edi, eax
add esp, 4
test edi, edi
jne 0x40fbbc
push 0x43ec30
call fcn.00404d10
add esp, 4
push dword [ebp - 0x4c]
call dword [sym.imp.zip.dll_zip_fclose]
add esp, 4
jmp 0x40fb50
push 0
push ebx
push edi
push dword [ebp - 0x4c]
call dword [sym.imp.zip.dll_zip_fread]
add esp, 0x10
cmp eax, ebx
jne 0x40fbe5
test edx, edx
jne 0x40fbe5
push dword [ebp - 0x4c]
mov byte [edi + ebx], dl
call dword [sym.imp.zip.dll_zip_fclose]
jmp 0x40fd79
push dword [ebp - 0x54]
push str.ERROR:_zip_fread:__s_n
call fcn.00404d10
push dword [ebp - 0x4c]
call dword [sym.imp.zip.dll_zip_fclose]
add esp, 0xc
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
jmp 0x40fb50
mov ecx, dword [esi + 4]
mov edx, ebx
call fcn.0040efe0
mov edi, eax
push 0x43ec60
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov ebx, eax
add esp, 8
mov dword [ebp - 0x4c], ebx
test ebx, ebx
jne 0x40fc78
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push edi
push 0x43ec64
push str.ERROR:__s:_fopen_failed_for__s:__s_n
call fcn.00404d10
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 0x14
mov ecx, esi
call fcn.0040ff10
lea eax, [ebx - 2]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
add esp, 4
lea ecx, [ebp - 0x38]
push ecx
push eax
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__fstat64i32]
add esp, 8
test eax, eax
je 0x40fccf
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push edi
push 0x43eca0
push str.ERROR:__s:_fstat_failed_for__s:__s_n
call fcn.00404d10
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 0x14
jmp 0x40fb50
mov ebx, dword [ebp - 0x24]
lea eax, [ebx + 1]
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov dword [ebp - 0x50], eax
test eax, eax
jne 0x40fd0e
push 0x43ecdc
call fcn.00404d10
add esp, 4
push dword [ebp - 0x4c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
jmp 0x40fb50
push dword [ebp - 0x4c]
push ebx
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
push dword [ebp - 0x4c]
cmp eax, ebx
je 0x40fd5f
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push edi
push str.ipsw_extract_to_memory
push str.ERROR:__s:_fread_failed_for__s:__s_n
call fcn.00404d10
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 0x14
jmp 0x40fb50
mov eax, dword [ebp - 0x50]
mov byte [eax + ebx], 0
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edi, dword [ebp - 0x50]
add esp, 4
mov ecx, esi
call fcn.0040ff10
mov eax, dword [ebp - 0x58]
mov ecx, dword [ebp - 4]
xor ecx, ebp
mov dword [eax], edi
mov eax, dword [ebp - 0x5c]
pop edi
pop esi
mov dword [eax], ebx
xor eax, eax
pop ebx
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret