Function at 0x40f330
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
mov eax, dword [0x42c004]
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.0040e9d0
mov esi, eax
test esi, esi
jne 0x40f380
push str.ERROR:_Invalid_archive_n
call fcn.004035a0
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041c84a
mov esp, ebp
pop ebp
ret
mov eax, dword [esi]
test eax, eax
je 0x40f4ef
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 0x40f3bb
push ebx
push str.NOTE:_zip_name_locate:__s_not_found_in_archive._n
call fcn.00403610
push dword [esi + 4]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call edi
add esp, 0xc
jmp 0x40f46a
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 0x40f402
push ebx
push str.ERROR:_zip_stat_index:__s_n
call fcn.004035a0
push dword [esi + 4]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call edi
add esp, 0xc
jmp 0x40f46a
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 0x40f422
push ebx
push str.ERROR:_zip_fopen_index:__s_n
jmp 0x40f3ed
mov edi, dword [ebp - 0x30]
xor ecx, ecx
mov eax, edi
add eax, 1
setb cl
neg ecx
or ecx, eax
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40f49f
push str.ERROR:_Out_of_memory_n
call fcn.004035a0
add esp, 4
push dword [ebp - 0x4c]
call dword [sym.imp.zip.dll_zip_fclose]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [esi + 4]
call edi
add esp, 4
mov eax, dword [esi]
test eax, eax
je 0x40f485
push eax
call dword [sym.imp.zip.dll_zip_unchange_all]
add esp, 4
push dword [esi]
call dword [sym.imp.zip.dll_zip_close]
add esp, 4
push esi
call edi
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041c84a
mov esp, ebp
pop ebp
ret
push 0
push edi
push ebx
push dword [ebp - 0x4c]
call dword [sym.imp.zip.dll_zip_fread]
add esp, 0x10
cmp eax, edi
jne 0x40f4c8
test edx, edx
jne 0x40f4c8
push dword [ebp - 0x4c]
mov byte [ebx + edi], dl
call dword [sym.imp.zip.dll_zip_fclose]
jmp 0x40f681
push dword [ebp - 0x54]
push str.ERROR:_zip_fread:__s_n
call fcn.004035a0
push dword [ebp - 0x4c]
call dword [sym.imp.zip.dll_zip_fclose]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 0xc
push ebx
call edi
jmp 0x40f45f
mov ecx, dword [esi + 4]
mov edx, ebx
call fcn.0040e940
mov ebx, eax
push 0x41e700
push ebx
mov dword [ebp - 0x50], ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov edi, eax
add esp, 8
mov dword [ebp - 0x4c], edi
test edi, edi
jne 0x40f583
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 ebx
push str.ipsw_extract_to_memory
push str.ERROR:__s:_fopen_failed_for__s:__s_n
call fcn.004035a0
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call edi
add esp, 0x14
push dword [esi + 4]
call edi
mov eax, dword [esi]
add esp, 4
test eax, eax
je 0x40f567
push eax
call dword [sym.imp.zip.dll_zip_unchange_all]
add esp, 4
push dword [esi]
call dword [sym.imp.zip.dll_zip_close]
add esp, 4
push esi
call edi
add esp, 4
mov eax, 0xfffffffe
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041c84a
mov esp, ebp
pop ebp
ret
push edi
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 0x40f5dc
push edi
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 ebx
push str.ipsw_extract_to_memory
push str.ERROR:__s:_fstat_failed_for__s:__s_n
call fcn.004035a0
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call edi
add esp, 0x14
jmp 0x40f462
mov edi, dword [ebp - 0x24]
xor ecx, ecx
mov eax, edi
add eax, 1
setb cl
neg ecx
or ecx, eax
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40f626
push str.ERROR:_Out_of_memory_n
call fcn.004035a0
add esp, 4
push dword [ebp - 0x4c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [ebp - 0x50]
call edi
jmp 0x40f45f
push dword [ebp - 0x4c]
push edi
push 1
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
push dword [ebp - 0x4c]
cmp eax, edi
je 0x40f66b
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]
mov ebx, dword [ebp - 0x50]
add esp, 4
push eax
push ebx
push str.ipsw_extract_to_memory
push str.ERROR:__s:_fread_failed_for__s:__s_n
jmp 0x40f5c6
mov byte [ebx + edi], 0
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push dword [ebp - 0x50]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [esi + 4]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [esi]
add esp, 4
test eax, eax
je 0x40f6ab
push eax
call dword [sym.imp.zip.dll_zip_unchange_all]
add esp, 4
push dword [esi]
call dword [sym.imp.zip.dll_zip_close]
add esp, 4
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [ebp - 0x58]
add esp, 4
mov ecx, dword [ebp - 4]
xor ecx, ebp
mov dword [eax], ebx
mov eax, dword [ebp - 0x5c]
mov dword [eax], edi
xor eax, eax
pop edi
pop esi
pop ebx
call fcn.0041c84a
mov esp, ebp
pop ebp
ret