Function at 0x40a8d6
Capabilities:
Check if file exists
Read file on windows
Write file on windows

Disassembly:
push 0x3c
mov eax, 0x436c43
call fcn.00422682
mov ebx, ecx
mov dword [ebp - 0x20], ebx
push dword [ebp + 8]
lea esi, [ebx + 0x78]
mov ecx, esi
mov dword [ebp - 0x30], esi
call fcn.0040b67b
mov dword [ebp - 0x28], eax
cmp byte [eax + 0x1c], 0
je 0x40a907
xor eax, eax
jmp 0x40ad89
push dword [ebp + 8]
mov ecx, esi
call fcn.0040b67b
mov ecx, ebx
push dword [eax + 4]
call fcn.0040b612
mov ecx, dword [eax]
sub ecx, 0x10
call fcn.00404f5e
lea edi, [eax + 0x10]
mov dword [ebp - 0x2c], edi
and dword [ebp - 4], 0
mov ecx, esi
push dword [ebp + 8]
call fcn.0040b67b
add eax, 0x18
lea edx, [ebp - 0x2c]
push eax
lea ecx, [ebp - 0x10]
call fcn.0040b7ab
pop ecx
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x1c]
mov eax, dword [ebp - 0x28]
push edi
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x24], eax
call fcn.00402742
push 2
pop eax
lea edx, [ebp - 0x1c]
mov dword [ebp - 0x14], eax
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], al
call fcn.00407fd4
push dword [eax]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov ecx, dword [ebp - 0x34]
mov esi, eax
add ecx, 0xfffffff0
call fcn.00402471
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x1c]
add ecx, 0xfffffff0
call fcn.00402471
cmp esi, 1
je 0x40a9bf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x10]
mov ecx, ebx
push eax
push 0x104
call fcn.0040b5c3
mov dword [ebp - 0x14], 0xe
jmp 0x40ad73
push 0
push dword [ebp - 0x24]
mov ecx, edi
call fcn.00415105
mov esi, dword [ebp + 0xc]
pop ecx
pop ecx
test al, al
jne 0x40aa82
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x40a9f1
mov eax, dword [ecx]
push 0
push dword [ebp - 0x24]
push edi
call dword [eax]
test eax, eax
jne 0x40aa82
cmp byte [0x44fccc], 0
je 0x40aa76
mov eax, dword [ebp - 0x28]
lea edx, [ebp - 0x2c]
add eax, 0x18
lea ecx, [ebp + 0xc]
push eax
call fcn.0040b7ab
pop ecx
mov esi, eax
mov byte [ebp - 4], 3
call fcn.0040219e
push eax
lea ecx, [ebp + 8]
call fcn.00401fe1
mov ebx, 0x4451e0
mov byte [ebp - 4], 4
mov esi, dword [esi]
push ebx
call fcn.00425b9b
pop ecx
push eax
push ebx
lea ecx, [ebp + 8]
call fcn.00404e09
test esi, esi
je 0x40aa52
push esi
call fcn.00425b9b
pop ecx
push eax
push esi
lea ecx, [ebp + 8]
call fcn.00404e09
lea eax, [ebp + 8]
mov ecx, 0x44fc98
push eax
call fcn.004117dd
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.00402471
mov ecx, dword [ebp + 0xc]
lea ecx, [ecx - 0x10]
call fcn.00402471
mov dword [ebp - 0x14], 0xa
jmp 0x40ad73
push dword [ebp + 8]
lea ecx, [ebx + 0x78]
call fcn.0040b67b
mov eax, dword [eax + 4]
mov dword [ebp - 0x34], eax
mov eax, dword [esi]
mov dword [ebp + 0xc], eax
test eax, eax
je 0x40aad5
push dword [ebp + 8]
mov esi, dword [eax]
lea ecx, [ebx + 0x78]
call fcn.0040b67b
mov ecx, dword [ebp + 0xc]
push 0
push dword [eax + 0xc]
call dword [esi + 0x1c]
mov eax, dword [ebp + 0xc]
lea ecx, [ebx + 0x78]
push dword [ebp + 8]
mov esi, dword [eax]
call fcn.0040b67b
lea ecx, [ebp - 0x10]
push dword [eax]
call fcn.00407b3d
mov ecx, dword [ebp + 0xc]
push eax
call dword [esi + 0x14]
cmp dword [ebp - 0x34], 0xc
jne 0x40aaea
lea eax, [ebp - 0x10]
push eax
lea ecx, [ebx + 0xa4]
call fcn.004042a2
lea eax, [ebx + 0xb0]
xor dl, dl
push eax
lea ecx, [ebp - 0x10]
call fcn.00407d76
pop ecx
xor eax, eax
push eax
push 0x80
push 2
push eax
push eax
push 0x40000000
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x48], 0x443654
mov dword [ebp - 0x44], eax
mov byte [ebp - 4], 5
cmp eax, 0xffffffff
jne 0x40ac03
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
lea eax, [ebp - 0x10]
mov ecx, ebx
push eax
push 0x104
call fcn.0040b5c3
cmp byte [0x44fccc], 0
je 0x40ad65
push ecx
call esi
mov edx, eax
lea ecx, [ebp + 0xc]
call fcn.00411ea7
pop ecx
mov esi, eax
mov byte [ebp - 4], 6
call fcn.0040219e
push eax
lea ecx, [ebp + 8]
call fcn.00401fe1
mov byte [ebp - 4], 7
mov esi, dword [esi]
mov ebx, dword [ebp - 0x10]
push str.Failed_to_extract_file:
call fcn.00425b9b
pop ecx
push eax
push str.Failed_to_extract_file:
lea ecx, [ebp + 8]
call fcn.00404e09
test ebx, ebx
je 0x40abaf
push ebx
call fcn.00425b9b
pop ecx
push eax
push ebx
lea ecx, [ebp + 8]
call fcn.00404e09
mov ebx, str._Error:
push ebx
call fcn.00425b9b
pop ecx
push eax
push ebx
lea ecx, [ebp + 8]
call fcn.00404e09
test esi, esi
je 0x40abda
push esi
call fcn.00425b9b
pop ecx
push eax
push esi
lea ecx, [ebp + 8]
call fcn.00404e09
lea eax, [ebp + 8]
mov ecx, 0x44fc98
push eax
call fcn.004117dd
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.00402471
mov ecx, dword [ebp + 0xc]
lea ecx, [ecx - 0x10]
call fcn.00402471
jmp 0x40ad65
mov esi, dword [ebp - 0x20]
push dword [ebp + 8]
mov ecx, dword [ebp - 0x30]
mov ebx, dword [ebx + 0x58]
mov esi, dword [esi + 0x5c]
call fcn.0040b67b
mov ecx, dword [eax + 0x10]
xor eax, eax
add ecx, ebx
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 0x40], ecx
adc eax, esi
xor esi, esi
push esi
mov dword [ebp - 0x3c], eax
lea eax, [ebp - 0x3c]
push eax
push ecx
push dword [ebx + 0x88]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40ac5e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebx + 0x60]
mov ecx, ebx
push eax
push 0x103
call fcn.0040b5c3
jmp 0x40ad65
mov dword [ebp - 0x28], esi
mov eax, 0x10000
mov byte [ebp - 4], 8
push eax
lea ecx, [ebp - 0x28]
call fcn.0040b63b
push dword [ebp + 8]
lea ecx, [ebx + 0x78]
mov dword [ebx + 0xd0], esi
call fcn.0040b67b
push dword [ebp + 8]
lea ecx, [ebx + 0x78]
mov eax, dword [eax + 8]
shr eax, 1
and eax, 0xffffff01
mov dword [ebp - 0x34], eax
call fcn.0040b67b
and dword [ebp - 0x1c], 0
mov esi, dword [ebp - 0x28]
mov ecx, dword [ebp + 0xc]
mov edx, dword [eax + 0xc]
mov dword [ebp - 0x14], edx
test ecx, ecx
je 0x40acc0
mov eax, dword [ecx]
call dword [eax + 0x24]
test al, al
jne 0x40ad91
mov edx, dword [ebp - 0x14]
push 0
mov ecx, 0x10000
lea eax, [ebp - 0x18]
push eax
cmp edx, ecx
mov eax, edx
cmova eax, ecx
push eax
push esi
push dword [ebx + 0x88]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40ad4b
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x40ad4b
cmp byte [ebp - 0x34], 0
je 0x40ad01
push eax
push esi
lea ecx, [ebx + 0xc8]
call fcn.0041508b
mov eax, dword [ebp - 0x18]
push 0
lea ecx, [ebp - 0x18]
push ecx
push eax
push esi
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40ad4b
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x40ad4b
mov edx, dword [ebp - 0x14]
add dword [ebp - 0x1c], eax
sub edx, eax
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x14], edx
test ecx, ecx
je 0x40ad43
mov eax, dword [ebp - 0x1c]
mov ebx, dword [ecx]
cdq
push edx
push eax
call dword [ebx + 0x20]
mov ebx, dword [ebp - 0x20]
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0x14]
test edx, edx
jg 0x40acac
push dword [ebp + 8]
mov ecx, dword [ebp - 0x30]
call fcn.0040b67b
and dword [ebp - 0x14], 0
mov byte [eax + 0x1c], 1
push esi
call fcn.004221b9
pop ecx
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x40ad73
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffff0
call fcn.00402471
lea ecx, [edi - 0x10]
call fcn.00402471
mov eax, dword [ebp - 0x14]
call fcn.0042265c
ret 8
mov dword [ebp - 0x14], 0xf
jmp 0x40ad5e