Function at 0x408990
Capabilities:
Check if file exists
Create directory
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4502ec
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x118c
call fcn.00436a10
mov eax, dword [0x461194]
xor eax, esp
mov dword [esp + 0x1188], eax
push ebx
push esi
push edi
mov eax, dword [0x461194]
xor eax, esp
push eax
lea eax, [esp + 0x11a0]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
xor ebx, ebx
cmp dword [eax + 0x18], 8
mov edi, ecx
mov dword [esp + 0x28], edi
mov dword [esp + 0x50], 0x4127d0
mov dword [esp + 0x54], 0x412870
mov dword [esp + 0x58], 0x4128c0
mov dword [esp + 0x5c], 0x412910
mov dword [esp + 0x60], 0x412950
mov dword [esp + 0x64], 0x4129b0
mov dword [esp + 0x68], 0x4129e0
mov dword [esp + 0x6c], ebx
jb 0x408a27
mov eax, dword [eax + 4]
jmp 0x408a2a
add eax, 4
lea ecx, [esp + 0x50]
call fcn.00412cf0
mov esi, eax
mov dword [esp + 0x14], esi
cmp esi, ebx
je 0x408ec9
mov eax, dword [esi + 0x44]
push ebx
mov dword [esi + 0x34], eax
lea eax, [esi + 0x98]
push ebx
lea ecx, [esi + 0x48]
push eax
mov dword [esp + 0x3c], eax
push ecx
mov eax, esi
mov dword [esi + 0x30], ebx
mov dword [esp + 0x3c], ecx
call fcn.00412fa0
xor ecx, ecx
add esp, 0x10
cmp eax, ebx
sete cl
mov dword [esi + 0x38], ecx
cmp eax, ebx
je 0x408aa1
cmp dword [esi + 0x9c], ebx
je 0x408a86
mov edi, esi
call fcn.00413770
mov edx, dword [esi + 0x20]
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x14]
push edx
push eax
call ecx
push esi
call fcn.0043259d
add esp, 0xc
jmp 0x408ec9
push esi
call fcn.00413430
add esp, 4
test eax, eax
mov eax, esi
jne 0x408e75
push 0x104
lea edx, [esp + 0x90]
push edx
push 0
push 0
call fcn.00412fa0
add esp, 0x10
test eax, eax
jne 0x408e73
lea ebx, [esp + 0x8c]
lea esi, [esp + 0x20]
call fcn.0040ab30
mov dword [esp + 0x11a8], 0
mov edx, dword [esp + 0x20]
mov eax, edx
lea esi, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408b00
sub eax, esi
sar eax, 1
mov ebx, 0x2f
push 0xffffffffffffffff
cmp word [edx + eax*2 - 2], bx
jne 0x408bc5
xor eax, eax
push eax
mov word [esp + 0x5c], ax
push edi
lea eax, [esp + 0x5c]
mov dword [esp + 0x74], 7
mov dword [esp + 0x70], 0
call fcn.004030b0
mov byte [esp + 0x11a8], 1
mov edx, dword [esp + 0x20]
mov eax, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408b54
sub eax, esi
sar eax, 1
push eax
push edx
lea eax, [esp + 0x58]
call fcn.00406a20
mov ebx, dword [esp + 0x64]
dec ebx
or eax, 0xffffffff
lea esi, [esp + 0x50]
call fcn.004031c0
cmp dword [esp + 0x68], 8
mov eax, dword [esp + 0x54]
jae 0x408b8e
lea eax, [esp + 0x54]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov edi, dword [esp + 0x14]
call fcn.00413770
mov byte [esp + 0x11a8], 0
cmp dword [esp + 0x68], 8
jb 0x408dc8
mov ecx, dword [esp + 0x54]
push ecx
call fcn.00431205
add esp, 4
jmp 0x408dc8
xor eax, eax
push eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x50], eax
xor edx, edx
push edi
lea eax, [esp + 0x40]
mov dword [esp + 0x58], 7
mov word [esp + 0x44], dx
call fcn.004030b0
mov byte [esp + 0x11a8], 2
mov edx, dword [esp + 0x20]
mov eax, edx
lea esi, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x408c00
sub eax, esi
sar eax, 1
push eax
push edx
lea eax, [esp + 0x3c]
call fcn.00406a20
push 1
lea eax, [esp + 0x1c]
push eax
xor eax, eax
lea edx, [esp + 0x3c]
mov dword [esp + 0x20], ebx
call fcn.00407810
mov edi, eax
cmp edi, 0xffffffff
je 0x408c60
mov dword [esp + 0x18], ebx
jmp 0x408c40
lea esi, [esp + 0x34]
call fcn.00408ef0
push 1
lea ecx, [esp + 0x1c]
push ecx
mov eax, edi
mov edx, esi
call fcn.00407810
mov edi, eax
cmp edi, 0xffffffff
jne 0x408c40
lea edx, [esp + 0x34]
push edx
lea edi, [esp + 0x1c]
mov dword [esp + 0x1c], 0x5c
call fcn.00404fc0
xor edi, edi
mov ebx, 7
cmp eax, 0xffffffff
je 0x408d22
push eax
push edi
lea edx, [esp + 0x3c]
xor ecx, ecx
push edx
lea eax, [esp + 0x7c]
mov dword [esp + 0x94], ebx
mov dword [esp + 0x90], edi
mov word [esp + 0x80], cx
call fcn.004030b0
mov byte [esp + 0x11a8], 3
mov eax, dword [esp + 0x74]
mov esi, 8
cmp dword [esp + 0x88], esi
jae 0x408ccc
lea eax, [esp + 0x74]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x408ced
mov ecx, dword [esp + 0x74]
cmp dword [esp + 0x88], esi
jae 0x408ce8
lea ecx, [esp + 0x74]
call fcn.0040a000
mov byte [esp + 0x11a8], 2
cmp dword [esp + 0x88], esi
jb 0x408d0b
mov eax, dword [esp + 0x74]
push eax
call fcn.00431205
add esp, 4
xor ecx, ecx
mov dword [esp + 0x88], ebx
mov dword [esp + 0x84], edi
mov word [esp + 0x74], cx
jmp 0x408d27
mov esi, 8
mov eax, dword [esp + 0x38]
cmp dword [esp + 0x4c], esi
jae 0x408d35
lea eax, [esp + 0x38]
push 0x45bda4
push eax
lea edx, [esp + 0x24]
push edx
call fcn.00431a4f
add esp, 0xc
test eax, eax
jne 0x408e8a
mov edi, dword [esp + 0x14]
lea eax, [esp + 0x194]
push eax
mov eax, edi
call fcn.00413590
add esp, 4
test eax, eax
jle 0x408d84
mov ecx, dword [esp + 0x1c]
push ecx
push 1
push eax
lea edx, [esp + 0x1a0]
push edx
call fcn.00431cf7
add esp, 0x10
jmp 0x408d50
call fcn.00413770
mov eax, dword [esp + 0x1c]
push eax
call fcn.00431b19
add esp, 4
mov byte [esp + 0x11a8], 0
cmp dword [esp + 0x4c], esi
jb 0x408db1
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00431205
add esp, 4
mov edi, dword [esp + 0x14]
xor edx, edx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x48], 0
mov word [esp + 0x38], dx
cmp dword [edi + 0x38], 0
jne 0x408dd5
mov ebx, 0xffffff9c
jmp 0x408e25
mov eax, dword [edi + 0x24]
cmp eax, 0xffff
je 0x408dee
mov ecx, dword [edi + 0x30]
inc ecx
cmp ecx, eax
jne 0x408dee
mov ebx, 0xffffff9c
jmp 0x408e25
mov edx, dword [edi + 0x70]
add edx, dword [edi + 0x6c]
mov eax, dword [edi + 0x68]
inc dword [edi + 0x30]
lea ecx, [edx + eax + 0x2e]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
add dword [edi + 0x34], ecx
push 0
push 0
push edx
push eax
mov eax, edi
call fcn.00412fa0
xor ecx, ecx
add esp, 0x10
test eax, eax
sete cl
mov ebx, eax
mov dword [edi + 0x38], ecx
mov dword [esp + 0x11a8], 0xffffffff
mov esi, dword [esp + 0x24]
test esi, esi
je 0x408e62
lea edx, [esi + 4]
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x408e62
mov edx, dword [esi]
mov eax, dword [edx + 4]
mov ecx, esi
call eax
lea ecx, [esi + 8]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x408e62
mov eax, dword [esi]
mov edx, dword [eax + 8]
mov ecx, esi
call edx
test ebx, ebx
jne 0x408e7c
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x28]
jmp 0x408aa1
mov eax, esi
call fcn.00412f60
jmp 0x408ec9
mov eax, edi
call fcn.00412f60
mov eax, 1
jmp 0x408ecb
mov eax, dword [esp + 0x14]
call fcn.00412f60
cmp dword [esp + 0x4c], esi
jb 0x408ea6
mov eax, dword [esp + 0x38]
push eax
call fcn.00431205
add esp, 4
xor ecx, ecx
lea eax, [esp + 0x20]
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x48], edi
mov word [esp + 0x38], cx
mov dword [esp + 0x11a8], 0xffffffff
call fcn.00404d40
xor eax, eax
mov ecx, dword [esp + 0x11a0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1188]
xor ecx, esp
call fcn.00430e4c
mov esp, ebp
pop ebp
ret