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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x8c
mov dword [esp + 0x34], eax
lea eax, [esp + 0x48]
mov dword [esp + 8], 0x38
mov dword [esp + 4], 0x41a044
mov dword [esp], eax
mov dword [esp + 0x30], edx
mov dword [esp + 0x38], 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.0040aee0
mov ebx, eax
test eax, eax
jne 0x4017b3
mov dword [esp], 0x2000
call sub.msvcrt.dll_malloc
mov edi, eax
test eax, eax
je 0x4017d8
mov dword [esp], 0x2000
call sub.msvcrt.dll_malloc
mov ebp, eax
test eax, eax
je 0x40180a
mov eax, dword [esp + 0x30]
xor edx, edx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x2c], edx
mov eax, dword [eax + 8]
mov dword [esp + 0x28], eax
mov ecx, dword [esp + 0x28]
mov ebx, dword [esp + 0x2c]
xor eax, eax
mov edx, 0x2000
mov esi, eax
mov edi, dword [esp + 0x34]
mov dword [esp + 4], 1
cmp edx, ecx
sbb esi, ebx
mov dword [esp + 0xc], edi
cmovae eax, ebx
cmovae edx, ecx
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], edx
mov eax, dword [esp + 0x20]
mov dword [esp + 8], eax
mov ebx, eax
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_fread
mov esi, eax
cmp eax, ebx
jne 0x4017a0
mov dword [esp], edi
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x4017a0
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x4c], esi
mov ebx, eax
mov dword [esp + 0x48], edi
lea eax, [esp + 0x48]
mov dword [esp + 4], 0
mov dword [esp], eax
mov dword [esp + 0x58], 0x2000
mov dword [esp + 0x54], ebp
call fcn.0040afb0
mov esi, eax
cmp eax, 0xffffffff
jge 0x4016a0
cmp eax, 0xfffffffc
jl 0x4016b0
mov eax, dword [esp + 0x30]
mov dword [esp + 8], esi
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.00402450
mov ebx, 0xffffffff
lea esi, cs:[esi]
lea esi, [esi]
lea eax, [esp + 0x48]
mov dword [esp], eax
call fcn.0040d360
mov dword [esp], edi
call sub.msvcrt.dll_free
mov dword [esp], ebp
call sub.msvcrt.dll_free
add esp, 0x8c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
cmp eax, 2
jne 0x4016b0
mov esi, 0xfffffffd
jmp 0x401642
mov ecx, dword [esp + 0x58]
mov eax, dword [esp + 0x38]
mov edx, 0x2000
sub edx, ecx
test eax, eax
je 0x401760
mov dword [esp + 8], edx
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], ebp
mov dword [esp + 0x1c], edx
call sub.msvcrt.dll_fwrite
mov edx, dword [esp + 0x1c]
cmp eax, edx
jne 0x4017a9
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x4017a9
mov ecx, dword [esp + 0x58]
test ecx, ecx
je 0x401616
mov dword [esp + 0x3c], esi
mov esi, dword [esp + 0x20]
mov eax, ebx
sub dword [esp + 0x28], esi
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x1c], edi
mov edi, dword [esp + 0x24]
sbb dword [esp + 0x2c], edi
cmp dword [esp + 0x3c], 1
mov ebx, dword [esp + 0x2c]
je 0x40183c
mov edx, ecx
or edx, ebx
jne 0x4015a5
mov esi, dword [esp + 0x3c]
mov edi, dword [esp + 0x1c]
mov ebx, eax
cmp esi, 1
je 0x401670
jmp 0x401642
mov eax, dword [esp + 0xa0]
test eax, eax
je 0x401707
mov eax, dword [esp + 0xa0]
mov dword [esp + 8], edx
mov dword [esp + 4], ebp
mov dword [esp], eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x1c], edx
call sub.msvcrt.dll_memcpy
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x3c]
add dword [esp + 0xa0], edx
jmp 0x401707
mov edi, dword [esp + 0x1c]
jmp 0x40165d
mov esi, 0xffffffff
jmp 0x401642
mov dword [esp + 8], eax
mov eax, dword [esp + 0x30]
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.00402450
jmp 0x40168c
call dword [sym.imp.msvcrt.dll__errno]
mov edx, dword [esp + 0x30]
mov dword [esp + 8], str.Failed_to_extract__s:_failed_to_allocate_temporary_input_buffer__n
xor ebp, ebp
add edx, 0x12
mov dword [esp + 0xc], edx
mov eax, dword [eax]
mov dword [esp], str.malloc
mov dword [esp + 4], eax
call fcn.004024f0
jmp 0x401670
call dword [sym.imp.msvcrt.dll__errno]
mov edx, dword [esp + 0x30]
mov dword [esp + 8], str.Failed_to_extract__s:_failed_to_allocate_temporary_output_buffer__n
xor ebp, ebp
add edx, 0x12
mov dword [esp + 0xc], edx
mov eax, dword [eax]
mov dword [esp], str.malloc
mov dword [esp + 4], eax
call fcn.004024f0
jmp 0x401670
mov edi, dword [esp + 0x1c]
mov ebx, eax
jmp 0x401670