Function at 0x40a389
Capabilities:
Copy file
Delete file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x421c
call fcn.00411570
mov ecx, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 0x14]
push esi
xor eax, eax
push edi
mov esi, 0x104
push esi
push eax
mov dword [ebp - 4], eax
mov dword [ebp - 0xc], eax
mov byte [ebp - 0x114], al
lea eax, [ebp - 0x113]
shr ebx, 0x1c
push eax
and ebx, 3
mov dword [ebp - 8], ecx
call sub.msvcrt.dll_memset
push str.gzip
push dword [ebp + 0x20]
call sub.msvcrt.dll__mbsicmp
add esp, 0x14
test eax, eax
jne 0x40a3fa
push 0x412cf4
lea edi, [ebp - 0x114]
mov dword [ebp - 0xc], 1
call fcn.00403ca6
mov eax, edi
pop ecx
mov dword [ebp - 8], eax
test ebx, ebx
jne 0x40a45a
push esi
lea eax, [ebp - 0x21b]
push ebx
push eax
mov byte [ebp - 0x21c], bl
call sub.msvcrt.dll_memset
push dword [ebp + 0x10]
lea eax, [ebp - 0x21c]
push dword [ebp + 0xc]
push str._s_8.8Xd01
push esi
push eax
call sub.msvcrt.dll__snprintf
lea eax, [ebp - 0x21c]
push eax
call fcn.00403d41
add esp, 0x24
test eax, eax
je 0x40a539
push ebx
push dword [ebp - 8]
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.KERNEL32.DLL_CopyFileA]
mov dword [ebp - 4], eax
jmp 0x40a539
cmp ebx, 3
ja 0x40a539
mov eax, dword [ebp + 0x14]
mov esi, dword [ebp + 8]
lea ecx, [ebx + ebx - 2]
mov edx, 0x100
shl edx, cl
and eax, 0xffffff
mov edi, 0x1000
add esi, 0x14
imul eax, edx
add eax, edi
push edi
mov dword [ebp + 0x10], edx
mov dword [ebp + 0xc], eax
call fcn.00404f12
push dword [ebp - 8]
call fcn.004039b2
cmp eax, 0xffffffff
pop ecx
mov dword [ebp + 0x20], eax
je 0x40a539
cmp dword [ebp + 0x18], 0
jne 0x40a4bd
mov eax, dword [ebp + 0x14]
shr eax, 0x18
and eax, 3
imul eax, dword [ebp + 0x10]
mov dword [ebp + 0x18], eax
mov eax, dword [ebp + 0x18]
shr eax, 0xc
mov dword [ebp - 4], eax
je 0x40a4fb
mov ecx, dword [ebp + 0xc]
mov dword [ebp + 0x14], ecx
mov dword [ebp + 0x10], eax
mov eax, dword [ebp + 8]
push edi
push dword [esi]
push dword [ebp + 0x14]
push dword [eax + ebx*4]
call fcn.0040452d
push edi
push dword [esi]
push dword [ebp + 0x20]
call fcn.0040450e
add dword [ebp + 0x14], edi
add esp, 0x1c
dec dword [ebp + 0x10]
jne 0x40a4d1
mov eax, dword [ebp - 4]
mov edi, dword [ebp + 0x18]
and edi, 0xfff
jbe 0x40a529
push edi
push dword [esi]
shl eax, 0xc
add eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push dword [eax + ebx*4]
call fcn.0040452d
push edi
push dword [esi]
push dword [ebp + 0x20]
call fcn.0040450e
add esp, 0x1c
push dword [ebp + 0x20]
mov dword [ebp - 4], 1
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp dword [ebp - 0xc], 0
je 0x40a5a6
push dword [ebp + 0x1c]
call dword [sym.imp.KERNEL32.DLL_DeleteFileA]
lea eax, [ebp - 0x114]
push eax
call fcn.0040cccb
mov esi, eax
test esi, esi
pop ecx
je 0x40a5a6
push 0x412cfc
push dword [ebp + 0x1c]
call sub.msvcrt.dll_fopen
mov edi, eax
test edi, edi
pop ecx
pop ecx
je 0x40a59f
jmp 0x40a587
je 0x40a598
push edi
push eax
lea eax, [ebp - 0x421c]
push 1
push eax
call sub.msvcrt.dll_fwrite
add esp, 0x10
lea eax, [ebp - 0x421c]
mov ecx, esi
call fcn.0040cf14
test eax, eax
jge 0x40a572
push edi
call sub.msvcrt.dll_fclose
pop ecx
mov eax, esi
call fcn.0040d160
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret 0x1c