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

Disassembly:
push ebp
mov ebp, eax
push edi
push esi
push ebx
sub esp, 0x8c
lea eax, [esp + 0x48]
mov dword [esp + 8], 0x38
mov dword [esp + 4], 0x418044
mov dword [esp], eax
mov dword [esp + 0x20], edx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x68], 0
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x48], 0
call fcn.00408190
mov ebx, eax
test eax, eax
jne 0x4018bb
mov dword [esp], 0x2000
call sub.msvcrt.dll_malloc
mov esi, eax
test eax, eax
je 0x4018e0
mov dword [esp], 0x2000
call sub.msvcrt.dll_malloc
mov edi, eax
mov eax, dword [esp + 0x20]
test edi, edi
je 0x401906
mov eax, dword [eax + 8]
xor edx, edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x2c], edx
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x28]
mov ebx, dword [esp + 0x2c]
xor eax, eax
mov edx, 0x2000
mov esi, eax
cmp edx, ecx
sbb esi, ebx
mov esi, dword [esp + 0x24]
cmovae edx, ecx
cmovae eax, ebx
mov dword [esp + 0x18], edx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], eax
mov eax, dword [ebp]
mov dword [esp + 8], ecx
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], esi
mov dword [esp + 0x30], ecx
call sub.msvcrt.dll_fread
mov edx, dword [esp + 0x30]
mov ebx, eax
cmp eax, edx
jne 0x4018a8
mov eax, dword [ebp]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x4018a8
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x48], esi
mov dword [esp + 0x30], eax
mov dword [esp + 0x38], ebp
lea eax, [esp + 0x48]
mov dword [esp + 4], 0
mov dword [esp], eax
mov dword [esp + 0x58], 0x2000
mov dword [esp + 0x54], edi
call fcn.00408260
mov ebx, eax
cmp eax, 0xffffffff
jge 0x401800
cmp eax, 0xfffffffc
jge 0x401860
mov ecx, dword [esp + 0x58]
mov eax, dword [esp + 0x34]
mov ebp, 0x2000
sub ebp, ecx
test eax, eax
je 0x401868
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebp
mov dword [esp + 4], 1
mov dword [esp], edi
call sub.msvcrt.dll_fwrite
cmp eax, ebp
jne 0x4018b1
mov eax, dword [esp + 0x34]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x4018b1
mov ecx, dword [esp + 0x58]
test ecx, ecx
je 0x40171e
mov eax, dword [esp + 0x30]
mov ebp, dword [esp + 0x38]
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x24], esi
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
sub dword [esp + 0x28], ebx
sbb dword [esp + 0x2c], esi
cmp dword [esp + 0x3c], 1
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
je 0x401928
mov esi, edx
or esi, ecx
jne 0x4016a3
mov ecx, dword [esp + 0x3c]
mov esi, dword [esp + 0x24]
mov ebx, eax
cmp ecx, 1
je 0x40182e
jmp 0x40180e
cmp eax, 2
jne 0x401752
mov ecx, 0xfffffffd
mov eax, dword [esp + 0x20]
mov dword [esp + 8], ecx
mov dword [esp], str.Failed_to_extract__s:_decompression_resulted_in_return_code__d__n
add eax, 0x12
mov dword [esp + 4], eax
call fcn.00402430
mov ebx, 0xffffffff
lea eax, [esp + 0x48]
mov dword [esp], eax
call fcn.0040a470
mov dword [esp], esi
call sub.msvcrt.dll_free
mov dword [esp], edi
call sub.msvcrt.dll_free
add esp, 0x8c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, eax
jmp 0x40180e
mov eax, dword [esp + 0xa0]
test eax, eax
je 0x4017a1
mov eax, dword [esp + 0xa0]
mov dword [esp + 8], ebp
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [esp + 0x24], ecx
call sub.msvcrt.dll_memcpy
add dword [esp + 0xa0], ebp
mov ecx, dword [esp + 0x24]
jmp 0x4017a1
mov esi, dword [esp + 0x24]
jmp 0x401829
mov ecx, 0xffffffff
jmp 0x40180e
mov dword [esp + 8], eax
mov eax, dword [esp + 0x20]
mov ebx, 0xffffffff
mov dword [esp], str.Failed_to_extract__s:_inflateInit___failed_with_return_code__d__n
add eax, 0x12
mov dword [esp + 4], eax
call fcn.00402430
jmp 0x40184a
mov eax, dword [esp + 0x20]
mov dword [esp + 4], str.Failed_to_extract__s:_failed_to_allocate_temporary_input_buffer__n
xor edi, edi
mov dword [esp], 0x4180d2
add eax, 0x12
mov dword [esp + 8], eax
call fcn.00402480
jmp 0x40182e
add eax, 0x12
mov dword [esp + 4], str.Failed_to_extract__s:_failed_to_allocate_temporary_output_buffer__n
xor edi, edi
mov dword [esp + 8], eax
mov dword [esp], 0x4180d2
call fcn.00402480
jmp 0x40182e
mov esi, dword [esp + 0x24]
mov ebx, eax
jmp 0x40182e