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

Disassembly:
push 0x34
mov eax, 0x432c04
call fcn.0041e952
mov esi, ecx
mov dword [ebp - 0x20], esi
push dword [ebp + 8]
lea ebx, [esi + 0x78]
mov ecx, ebx
mov dword [ebp - 0x1c], ebx
call fcn.0040a5d0
mov dword [ebp - 0x30], eax
cmp byte [eax + 0x1c], 0
je 0x409a03
xor eax, eax
jmp 0x409e27
push dword [ebp + 8]
mov ecx, ebx
call fcn.0040a5d0
mov ecx, esi
push dword [eax + 4]
call fcn.0040a54a
mov ecx, dword [eax]
sub ecx, 0x10
call fcn.00404554
lea edi, [eax + 0x10]
mov dword [ebp - 0x34], edi
and dword [ebp - 4], 0
mov ecx, ebx
push dword [ebp + 8]
call fcn.0040a5d0
add eax, 0x18
lea edx, [ebp - 0x34]
push eax
lea ecx, [ebp - 0x10]
call fcn.0040a795
pop ecx
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x24]
mov eax, dword [ebp - 0x30]
push edi
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x28], eax
call fcn.00404200
push 2
pop eax
lea edx, [ebp - 0x24]
mov dword [ebp - 0x14], eax
lea ecx, [ebp - 0x38]
mov byte [ebp - 4], al
call fcn.004074cf
push dword [eax]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov ecx, dword [ebp - 0x38]
lea ebx, [eax - 1]
neg ebx
sbb bl, bl
add ecx, 0xfffffff0
inc bl
call fcn.004045ed
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x24]
lea ecx, [ecx - 0x10]
call fcn.004045ed
xor bl, 1
je 0x409ac2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x10]
mov ecx, esi
push eax
push 0x104
call fcn.0040a4fb
mov dword [ebp - 0x14], 0xe
jmp 0x409e11
push 0
push dword [ebp - 0x28]
mov ecx, edi
call fcn.00412819
mov ebx, dword [ebp + 0xc]
pop ecx
pop ecx
test al, al
jne 0x409b5f
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x409af0
mov eax, dword [ecx]
push 0
push dword [ebp - 0x28]
push edi
call dword [eax]
test eax, eax
jne 0x409b5f
cmp byte [0x44be08], 0
je 0x409b53
mov eax, dword [ebp - 0x30]
lea edx, [ebp - 0x34]
add eax, 0x18
lea ecx, [ebp + 0xc]
push eax
call fcn.0040a795
pop ecx
mov esi, eax
lea ecx, [ebp + 8]
call fcn.0040d2f1
mov ebx, eax
mov byte [ebp - 4], 4
mov ecx, ebx
mov esi, dword [esi]
push 0x440f90
call fcn.004036da
push esi
mov ecx, ebx
call fcn.0040d305
push eax
mov ecx, 0x44bdd8
call fcn.0040f355
mov ecx, dword [ebp + 8]
lea ecx, [ecx - 0x10]
call fcn.004045ed
mov ecx, dword [ebp + 0xc]
lea ecx, [ecx - 0x10]
call fcn.004045ed
mov dword [ebp - 0x14], 0xa
jmp 0x409e11
push dword [ebp + 8]
lea ecx, [esi + 0x78]
call fcn.0040a5d0
mov ebx, dword [ebx]
mov dword [ebp - 0x24], ebx
mov eax, dword [eax + 4]
mov dword [ebp + 0xc], eax
test ebx, ebx
je 0x409bb3
push dword [ebp + 8]
mov ecx, dword [ebp - 0x1c]
mov esi, dword [ebx]
call fcn.0040a5d0
push 0
mov ecx, ebx
push dword [eax + 0xc]
call dword [esi + 0x1c]
push dword [ebp + 8]
mov ecx, dword [ebp - 0x1c]
mov esi, dword [ebx]
call fcn.0040a5d0
lea ecx, [ebp - 0x10]
push dword [eax]
call fcn.004070f0
push eax
mov ecx, ebx
call dword [esi + 0x14]
mov esi, dword [ebp - 0x20]
mov eax, dword [ebp + 0xc]
cmp eax, 0xc
jne 0x409bc7
lea eax, [ebp - 0x10]
push eax
lea ecx, [esi + 0xa4]
call fcn.004032bc
lea eax, [esi + 0xb0]
xor dl, dl
push eax
lea ecx, [ebp - 0x10]
call fcn.004072a3
pop ecx
xor ebx, ebx
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], ebx
mov byte [ebp - 4], 5
cmp eax, 0xffffffff
jne 0x409ca4
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
push eax
lea eax, [ebp - 0x10]
mov ecx, esi
push eax
push 0x104
call fcn.0040a4fb
cmp byte [0x44be08], 0
je 0x409e03
push ecx
call ebx
mov edx, eax
lea ecx, [ebp - 0x38]
call fcn.0040f9cc
pop ecx
mov esi, eax
lea ecx, [ebp + 0xc]
call fcn.0040d2f1
mov ebx, eax
mov byte [ebp - 4], 7
mov ecx, ebx
mov eax, dword [esi]
mov esi, dword [ebp - 0x10]
push str.Failed_to_extract_file:
mov dword [ebp + 8], eax
call fcn.004036da
push esi
mov ecx, ebx
call fcn.0040d305
mov esi, eax
push str._Error:
mov ecx, esi
call fcn.004036da
push dword [ebp + 8]
mov ecx, esi
call fcn.0040d305
push eax
mov ecx, 0x44bdd8
call fcn.0040f355
mov ecx, dword [ebp + 0xc]
lea ecx, [ecx - 0x10]
call fcn.004045ed
mov ecx, dword [ebp - 0x38]
lea ecx, [ecx - 0x10]
call fcn.004045ed
jmp 0x409e03
mov ebx, dword [esi + 0x58]
push dword [ebp + 8]
mov ecx, dword [ebp - 0x1c]
mov esi, dword [esi + 0x5c]
call fcn.0040a5d0
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 + 0x84]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x409cfc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebx + 0x60]
mov ecx, ebx
push eax
push 0x103
call fcn.0040a4fb
jmp 0x409e03
mov dword [ebp - 0x30], esi
mov eax, 0x10000
mov byte [ebp - 4], 8
push eax
lea ecx, [ebp - 0x30]
call fcn.0040a58b
push dword [ebp + 8]
lea ecx, [ebx + 0x78]
mov dword [ebx + 0xd0], esi
call fcn.0040a5d0
push dword [ebp + 8]
lea ecx, [ebx + 0x78]
mov eax, dword [eax + 8]
shr eax, 1
and eax, 0xffffff01
mov dword [ebp - 0x38], eax
call fcn.0040a5d0
and dword [ebp - 0x14], 0
mov esi, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x24]
mov edx, dword [eax + 0xc]
mov dword [ebp + 0xc], edx
test ecx, ecx
je 0x409d5e
mov eax, dword [ecx]
call dword [eax + 0x24]
test al, al
jne 0x409e2f
mov edx, dword [ebp + 0xc]
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 + 0x84]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x409de9
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x409de9
cmp byte [ebp - 0x38], 0
je 0x409d9f
push eax
push esi
lea ecx, [ebx + 0xc8]
call fcn.00412794
mov eax, dword [ebp - 0x18]
push 0
lea ecx, [ebp - 0x18]
push ecx
push eax
push esi
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x409de9
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x409de9
mov edx, dword [ebp + 0xc]
add dword [ebp - 0x14], eax
sub edx, eax
mov ecx, dword [ebp - 0x24]
mov dword [ebp + 0xc], edx
test ecx, ecx
je 0x409de1
mov eax, dword [ebp - 0x14]
mov ebx, dword [ecx]
cdq
push edx
push eax
call dword [ebx + 0x20]
mov ebx, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp + 0xc]
test edx, edx
jg 0x409d4a
push dword [ebp + 8]
mov ecx, dword [ebp - 0x1c]
call fcn.0040a5d0
and dword [ebp - 0x14], 0
mov byte [eax + 0x1c], 1
push esi
call fcn.0041df98
pop ecx
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x409e11
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x10]
add ecx, 0xfffffff0
call fcn.004045ed
lea ecx, [edi - 0x10]
call fcn.004045ed
mov eax, dword [ebp - 0x14]
call fcn.0041e92c
ret 8
mov dword [ebp - 0x14], 0xf
jmp 0x409dfc