Function at 0x408700
Capabilities:
Check if file exists
Create directory
Set file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4172c1
mov eax, dword fs:[0]
push eax
mov eax, 0x4238
call fcn.004122b0
mov eax, dword [0x41e024]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0x401c
lea eax, [ebp + 8]
push eax
lea ecx, [ebp - 0x4194]
push ecx
call fcn.00411010
mov eax, dword [ebp + 0x4028]
mov edx, dword [ebp + 0x4024]
mov ecx, 0x20
lea esi, [ebp + 0x402c]
lea edi, [ebp - 0x4244]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp + 0x40ac]
mov edi, dword [ebp - 0x41d0]
mov dword [ebp - 0x41b4], ecx
mov ecx, dword [ebp + 0x40b0]
mov dword [ebp - 0x41b0], ecx
mov ecx, dword [edi + eax*4]
mov esi, dword [edi + eax*4 + 4]
mov dword [ebp - 0x4198], ecx
lea ecx, [edi + eax*4 + 4]
xor ebx, ebx
add esp, 0xc
sub esi, dword [ebp - 0x4198]
mov dword [ebp - 0x419c], edx
mov dword [ebp - 0x41a8], eax
mov dword [ebp - 0x41c0], 0xffffffff
mov dword [ebp - 0x41b8], ebx
mov dword [ebp - 0x41c4], ebx
mov dword [ebp - 0x41a0], ecx
je 0x408800
push ebx
call fcn.0040bbcf
add esp, 4
add esi, esi
je 0x408d2c
push esi
call fcn.0040bc09
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x408d2c
mov eax, dword [ebp - 0x41a8]
mov edx, dword [ebp - 0x419c]
mov ecx, dword [ebp - 0x41a0]
mov edi, dword [edi + eax*4]
mov eax, dword [ecx]
sub eax, edi
test ebx, ebx
je 0x40882d
mov ecx, dword [ebp - 0x41cc]
lea esi, [ecx + edi*2]
test eax, eax
je 0x40882d
mov ecx, ebx
sub esi, ebx
lea esp, [esp]
mov di, word [esi + ecx]
mov word [ecx], di
add ecx, 2
dec eax
jne 0x408820
mov eax, edx
mov dword [ebp - 0x124], 0xf
mov dword [ebp - 0x128], 0
mov byte [ebp - 0x138], 0
lea esi, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408850
sub eax, esi
push edx
mov edi, eax
lea esi, [ebp - 0x138]
call fcn.00409590
push 1
xor esi, esi
push 0x41bcd8
lea eax, [ebp - 0x138]
mov dword [ebp - 4], esi
call fcn.004092b0
mov edi, dword [ebp - 0x128]
cmp eax, 0xffffffff
je 0x40888d
cmp eax, edi
jae 0x4088b5
push 1
push 0x41bc04
lea eax, [ebp - 0x138]
call fcn.004092b0
cmp eax, 0xffffffff
je 0x4088a8
cmp eax, edi
jae 0x4088b5
push 1
lea eax, [ebp - 0x138]
call fcn.004094b0
xor edx, edx
mov eax, ebx
mov word [ebp - 0x154], dx
mov dword [ebp - 0x140], 7
mov dword [ebp - 0x144], esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x4088d3
sub eax, edx
sar eax, 1
push eax
mov eax, ebx
lea ecx, [ebp - 0x154]
call fcn.004099c0
sub esp, 0x1c
mov edi, esp
mov byte [ebp - 4], 1
mov dword [ebp - 0x41bc], esp
xor eax, eax
mov dword [edi + 0x14], 7
mov dword [edi + 0x10], esi
push esi
lea ecx, [ebp - 0x154]
mov word [edi], ax
push ecx
or eax, 0xffffffff
call fcn.00409350
lea ecx, [ebp - 0x170]
call fcn.00408620
add esp, 0x1c
push 0xffffffffffffffff
push esi
push eax
lea edi, [ebp - 0x138]
mov byte [ebp - 4], 2
call fcn.00409400
mov edi, 0x10
mov byte [ebp - 4], 1
cmp dword [ebp - 0x15c], edi
jb 0x40895f
mov edx, dword [ebp - 0x170]
push edx
call fcn.0040c16e
add esp, 4
push ebx
call fcn.0040bbcf
add esp, 4
push 1
lea eax, [ebp - 0x138]
push eax
call fcn.00409210
cmp eax, 0xffffffff
je 0x4089a1
jmp 0x408980
push 1
push eax
lea eax, [ebp - 0x138]
call fcn.00409080
push 1
lea ecx, [ebp - 0x138]
push ecx
call fcn.00409210
cmp eax, 0xffffffff
jne 0x408980
push 0x103
lea edx, [ebp - 0x11b]
push esi
push edx
mov byte [ebp - 0x11c], 0
call fcn.0040f650
mov eax, dword [ebp - 0x138]
add esp, 0xc
cmp dword [ebp - 0x124], edi
jae 0x4089d1
lea eax, [ebp - 0x138]
lea edx, [ebp - 0x11c]
sub edx, eax
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4089e0
lea eax, [ebp - 0x11c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
lea ecx, [ebp - 0x11c]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
jne 0x408a6c
push esi
lea edx, [ebp - 0x11c]
push edx
push esi
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExA]
test eax, eax
je 0x408a6c
cmp dword [ebp - 0x140], 8
jb 0x408a33
mov eax, dword [ebp - 0x154]
push eax
call fcn.0040c16e
add esp, 4
xor ecx, ecx
mov dword [ebp - 0x140], 7
mov dword [ebp - 0x144], esi
mov word [ebp - 0x154], cx
cmp dword [ebp - 0x124], edi
jb 0x408d2c
mov edx, dword [ebp - 0x138]
push edx
call fcn.0040c16e
add esp, 4
jmp 0x408d2c
mov edi, dword [ebp - 0x41a8]
mov ecx, edi
and ecx, 7
mov ebx, 0x80
sar ebx, cl
mov ecx, dword [ebp - 0x41fc]
mov eax, edi
sar eax, 3
test byte [eax + ecx], bl
mov dword [ebp - 0x41bc], eax
mov eax, dword [ebp - 0x138]
je 0x408b0e
mov edi, 0x10
cmp dword [ebp - 0x124], edi
jae 0x408aad
lea eax, [ebp - 0x138]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x408abf
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x140], 8
jb 0x408ad7
mov edx, dword [ebp - 0x154]
push edx
call fcn.0040c16e
add esp, 4
xor eax, eax
mov dword [ebp - 0x140], 7
mov dword [ebp - 0x144], esi
mov word [ebp - 0x154], ax
cmp dword [ebp - 0x124], edi
jb 0x408b07
mov ecx, dword [ebp - 0x138]
push ecx
call fcn.0040c16e
add esp, 4
mov al, 1
jmp 0x408d2e
cmp dword [ebp - 0x124], 0x10
jae 0x408b1d
lea eax, [ebp - 0x138]
push esi
push 0x80
push 2
push esi
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x4198], eax
cmp eax, 0xffffffff
jne 0x408b9b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
je 0x408b9b
cmp dword [ebp - 0x140], 8
jb 0x408b61
mov edx, dword [ebp - 0x154]
push edx
call fcn.0040c16e
add esp, 4
xor eax, eax
cmp dword [ebp - 0x124], 0x10
mov dword [ebp - 0x140], 7
mov dword [ebp - 0x144], esi
mov word [ebp - 0x154], ax
jb 0x408d2c
mov ecx, dword [ebp - 0x138]
push ecx
call fcn.0040c16e
add esp, 4
jmp 0x408d2c
lea edx, [ebp + 0x40b4]
push edx
lea eax, [ebp - 0x41b4]
push eax
lea ecx, [ebp - 0x41a4]
push ecx
lea edx, [ebp - 0x41a0]
push edx
lea eax, [ebp - 0x41c4]
push eax
lea ecx, [ebp - 0x41b8]
push ecx
lea edx, [ebp - 0x41c0]
push edx
lea eax, [ebp - 0x4194]
push edi
push eax
lea eax, [ebp - 0x4244]
mov dword [ebp - 0x41a0], esi
mov dword [ebp - 0x41a4], esi
call fcn.00403a90
add esp, 0x24
test eax, eax
je 0x408c44
cmp dword [ebp - 0x140], 8
jb 0x408c0a
mov ecx, dword [ebp - 0x154]
push ecx
call fcn.0040c16e
add esp, 4
xor edx, edx
cmp dword [ebp - 0x124], 0x10
mov dword [ebp - 0x140], 7
mov dword [ebp - 0x144], esi
mov word [ebp - 0x154], dx
jb 0x408d2c
mov eax, dword [ebp - 0x138]
push eax
call fcn.0040c16e
add esp, 4
jmp 0x408d2c
mov esi, dword [ebp - 0x41b8]
mov edx, dword [ebp - 0x41a0]
mov ecx, dword [ebp - 0x41a4]
add edx, esi
push edx
lea eax, [ebp - 0x4198]
push eax
lea edi, [ebp - 0x419c]
mov dword [ebp - 0x419c], ecx
call fcn.00404960
add esp, 8
test eax, eax
jne 0x408d05
mov ecx, dword [ebp - 0x41a4]
cmp dword [ebp - 0x419c], ecx
jne 0x408d05
lea edx, [ebp - 0x41b4]
push esi
push edx
call dword [ebp - 0x41b0]
add esp, 8
lea esi, [ebp - 0x4198]
call fcn.00404930
test eax, eax
jne 0x408d16
mov eax, dword [ebp - 0x41f0]
test eax, eax
je 0x408ceb
mov ecx, dword [ebp - 0x41bc]
test byte [ecx + eax], bl
je 0x408ceb
cmp dword [ebp - 0x124], 0x10
mov eax, dword [ebp - 0x138]
jae 0x408cd4
lea eax, [ebp - 0x138]
mov ecx, dword [ebp - 0x41a8]
mov edx, dword [ebp - 0x41ec]
mov edx, dword [edx + ecx*4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea esi, [ebp - 0x154]
call fcn.00409050
lea esi, [ebp - 0x138]
call fcn.00409020
mov al, 1
jmp 0x408d2e
lea eax, [ebp - 0x41b4]
push esi
push eax
call dword [ebp - 0x41b0]
add esp, 8
lea esi, [ebp - 0x154]
call fcn.00409050
lea esi, [ebp - 0x138]
call fcn.00409020
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0040bbc0
mov esp, ebp
pop ebp
ret 0x40b4