Function at 0x40f330
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x294
mov eax, dword [0x436008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov ebx, edx
mov dword [ebp - 0x290], ebx
mov dword [ebp - 0x288], edi
mov dword [ebp - 0x25c], 0
call fcn.0040f060
mov ecx, eax
mov dword [ebp - 0x26c], ecx
test ecx, ecx
jne 0x40f393
push 0x43e9ec
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 [ecx]
mov dword [0x4487ec], 0
test eax, eax
je 0x40f6c4
push 0
push ebx
push eax
call dword [sym.imp.zip.dll_zip_name_locate]
mov esi, eax
add esp, 0xc
test esi, esi
jns 0x40f3dc
push ebx
push str.ERROR:_zip_name_locate:__s_n
call fcn.00404d10
add esp, 8
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 - 0x258]
push eax
call dword [sym.imp.zip.dll_zip_stat_init]
add esp, 4
mov eax, esi
cdq
mov edi, eax
mov esi, edx
lea eax, [ebp - 0x258]
push eax
mov eax, dword [ebp - 0x26c]
push 0
push esi
push edi
push dword [eax]
call dword [sym.imp.zip.dll_zip_stat_index]
add esp, 0x14
test eax, eax
je 0x40f435
push ebx
push 0x43ea20
call fcn.00404d10
add esp, 8
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 0x100000
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov dword [ebp - 0x260], eax
test eax, eax
jne 0x40f46e
push 0x43ea3c
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 [ebp - 0x26c]
push 0
push esi
push edi
push dword [eax]
call dword [sym.imp.zip.dll_zip_fopen_index]
mov esi, eax
add esp, 0x10
mov dword [ebp - 0x264], esi
test esi, esi
jne 0x40f4b1
push ebx
push 0x43ea60
call fcn.00404d10
add esp, 8
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 ebx, dword [ebp - 0x288]
push 0x43ea7c
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
add esp, 8
mov dword [ebp - 0x28c], eax
test eax, eax
jne 0x40f4f9
push ebx
push str.ERROR:_Unable_to_open_output_file:__s_n
call fcn.00404d10
push esi
call dword [sym.imp.zip.dll_zip_fclose]
add esp, 0xc
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 [ebp - 0x23c]
xorps xmm0, xmm0
mov esi, dword [ebp - 0x240]
mov edx, 0x100000
movlpd qword [ebp - 0x278], xmm0
mov dword [ebp - 0x268], edx
mov dword [ebp - 0x284], eax
test eax, eax
jne 0x40f52d
test esi, esi
je 0x40f693
mov ecx, dword [ebp - 0x274]
mov dword [ebp - 0x280], ecx
mov ecx, dword [ebp - 0x278]
mov dword [ebp - 0x27c], ecx
nop word [eax + eax]
cmp dword [0x4487ec], 0
jne 0x40f693
test eax, eax
ja 0x40f573
jb 0x40f56b
cmp esi, 0x100000
jae 0x40f573
mov edx, esi
mov dword [ebp - 0x268], edx
mov eax, edx
cdq
mov edi, eax
mov eax, edx
push eax
push edi
push dword [ebp - 0x260]
mov dword [ebp - 0x274], eax
push dword [ebp - 0x264]
call dword [sym.imp.zip.dll_zip_fread]
mov ebx, eax
add esp, 0x10
test ebx, ebx
js 0x40f677
push dword [ebp - 0x28c]
push ebx
push 1
push dword [ebp - 0x260]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, ebx
jne 0x40f66a
mov eax, dword [ebp - 0x27c]
mov ecx, dword [ebp - 0x280]
add eax, edi
mov dword [ebp - 0x27c], eax
adc ecx, dword [ebp - 0x274]
cmp dword [ebp + 0xc], 0
mov dword [ebp - 0x280], ecx
je 0x40f63d
mov edx, ecx
mov ecx, eax
call fcn.00430150
mov edx, dword [ebp - 0x23c]
mov ecx, dword [ebp - 0x240]
movsd qword [ebp - 0x278], xmm0
call fcn.00430150
movsd xmm1, qword [ebp - 0x278]
divsd xmm1, xmm0
mulsd xmm1, qword [0x432db8]
cvttsd2si edi, xmm1
cmp dword [0x4487e8], edi
je 0x40f637
push edi
push str.unzip:_d__n
call fcn.00404cb0
add esp, 8
mov dword [0x4487e8], edi
mov eax, ebx
cdq
sub esi, eax
mov eax, dword [ebp - 0x284]
sbb eax, edx
mov edx, dword [ebp - 0x268]
mov dword [ebp - 0x284], eax
test eax, eax
ja 0x40f550
jb 0x40f693
test esi, esi
jne 0x40f550
jmp 0x40f693
push dword [ebp - 0x288]
push str.ERROR:_frite:__s_n
jmp 0x40f682
push dword [ebp - 0x290]
push 0x43eaa8
call fcn.00404d10
add esp, 8
or eax, 0xffffffff
mov dword [ebp - 0x25c], eax
push dword [ebp - 0x260]
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call esi
add esp, 4
push dword [ebp - 0x28c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push dword [ebp - 0x264]
call dword [sym.imp.zip.dll_zip_fclose]
jmp 0x40f976
mov ecx, dword [ecx + 4]
mov edx, ebx
call fcn.0040efe0
mov ebx, eax
push 0
push ebx
mov dword [ebp - 0x264], ebx
call sub.api_ms_win_crt_filesystem_l1_1_0.dll__access
add esp, 8
test eax, eax
jne 0x40f944
mov esi, dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
push eax
lea eax, [ebp - 0x110]
push eax
push 0x104
push ebx
call esi
test eax, eax
je 0x40f944
push 0
push edi
call sub.api_ms_win_crt_filesystem_l1_1_0.dll__access
add esp, 8
test eax, eax
jne 0x40f76a
push eax
lea eax, [ebp - 0x218]
push eax
push 0x104
push edi
call esi
test eax, eax
je 0x40f76a
lea ecx, [ebp - 0x218]
lea eax, [ebp - 0x110]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x40f756
test dl, dl
je 0x40f752
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x40f756
add eax, 2
add ecx, 2
test dl, dl
jne 0x40f736
xor eax, eax
jmp 0x40f75b
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40f76a
mov dword [ebp - 0x25c], eax
jmp 0x40f96d
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
lea eax, [ebp - 0x110]
push 0x43eb04
push eax
call esi
mov edi, eax
add esp, 8
test edi, edi
jne 0x40f7bc
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
lea eax, [ebp - 0x110]
push eax
push 0x43eb08
call fcn.00404d10
add esp, 0xc
mov dword [ebp - 0x25c], 0xffffffff
jmp 0x40f96d
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
add esp, 4
lea ecx, [ebp - 0x248]
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 0x40f81a
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
lea eax, [ebp - 0x110]
push eax
push str.ERROR:_fstat:__s:__s_n
call fcn.00404d10
add esp, 0xc
mov dword [ebp - 0x25c], 0xffffffff
jmp 0x40f96d
lea eax, [ebp - 0x218]
push 0x43eb38
push eax
call esi
add esp, 8
mov dword [ebp - 0x260], eax
test eax, eax
jne 0x40f874
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
lea eax, [ebp - 0x218]
push eax
push str.ERROR:_fopen:__s:__s_n
call fcn.00404d10
add esp, 0xc
mov dword [ebp - 0x25c], 0xffffffff
jmp 0x40f96d
push 0x100000
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov ebx, eax
push edi
test ebx, ebx
jne 0x40f8b7
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
call esi
add esp, 4
push dword [ebp - 0x260]
call esi
add esp, 4
push str.ERROR:_Unable_to_allocate_memory_n
call fcn.00404d10
mov ebx, dword [ebp - 0x264]
add esp, 4
jmp 0x40f964
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
add esp, 4
test eax, eax
jne 0x40f91b
cmp dword [0x4487ec], 0
jne 0x40f91b
push edi
push 0x100000
push 1
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
push dword [ebp - 0x260]
mov esi, eax
push esi
push 1
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x20
cmp eax, esi
jne 0x40f905
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
add esp, 4
test eax, eax
je 0x40f8c4
jmp 0x40f91b
push str.ERROR:_fwrite_failed_n
call fcn.00404d10
add esp, 4
or eax, 0xffffffff
mov dword [ebp - 0x25c], eax
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
push edi
call esi
add esp, 4
push dword [ebp - 0x260]
call esi
mov ebx, dword [ebp - 0x264]
add esp, 4
jmp 0x40f96d
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.ERROR:_realpath_failed_on__s:__s_n
call fcn.00404d10
add esp, 0xc
or eax, 0xffffffff
mov dword [ebp - 0x25c], eax
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call esi
mov ebx, dword [ebp - 0x26c]
add esp, 4
push dword [ebx + 4]
call esi
mov eax, dword [ebx]
add esp, 4
test eax, eax
je 0x40f9a2
push eax
call dword [sym.imp.zip.dll_zip_unchange_all]
add esp, 4
push dword [ebx]
call dword [sym.imp.zip.dll_zip_close]
add esp, 4
push ebx
call esi
mov eax, dword [ebp - 0x25c]
add esp, 4
cmp dword [0x4487ec], 0
mov ecx, 0xfffffffe
cmovne eax, ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0042eb3e
mov esp, ebp
pop ebp
ret