Function at 0x10066590
Capabilities:
Check if file exists
Create directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1014ac40
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push esi
push edi
mov eax, dword [0x1019646c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
or ebx, 0xffffffff
mov dword [ebp - 4], 0
cmp dword [eax - 0xc], 0
je 0x10066862
cmp dword [eax - 4], 1
jle 0x100665e3
push dword [eax - 0xc]
lea ecx, [ebp + 8]
call fcn.10014050
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x1006685f
call fcn.10017640
mov ecx, eax
test ecx, ecx
je 0x1006689a
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov byte [ebp - 4], 1
cmp dword [eax - 0xc], 0
jge 0x1006661e
or edi, 0xffffffff
jmp 0x1006663e
push 0x10156e8c
push eax
call fcn.10116869
mov edi, eax
add esp, 8
mov eax, dword [ebp + 8]
test edi, edi
jne 0x1006663a
or edi, 0xffffffff
jmp 0x1006663e
sub edi, eax
sar edi, 1
mov esi, dword [eax - 0xc]
xor edx, edx
test edi, edi
mov ecx, esi
cmovns edx, edi
cmp edx, esi
cmovle ecx, edx
xor ebx, ebx
test esi, esi
cmovns ebx, ecx
cmp ebx, esi
jne 0x1006666e
add eax, 0xfffffff0
push eax
call fcn.10019550
add esp, 4
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
jmp 0x1006669a
mov ecx, dword [eax - 0x10]
test ecx, ecx
je 0x1006667e
mov eax, dword [ecx]
call dword [eax + 0x10]
test eax, eax
jne 0x1006668a
call fcn.10017640
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
push eax
push ebx
push dword [ebp + 8]
lea ecx, [ebp - 0x14]
call fcn.100611e0
mov esi, dword [ebp - 0x14]
push dword [esi - 0xc]
lea ecx, [ebp - 0x10]
mov byte [ebp - 4], 2
push esi
call fcn.10065fd0
mov byte [ebp - 4], 1
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x100666c6
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x10]
cmp dword [esi - 4], 1
jle 0x100666dd
push dword [esi - 0xc]
lea ecx, [ebp - 0x10]
call fcn.10014050
mov esi, dword [ebp - 0x10]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x10066705
cmp dword [esi - 4], 1
jle 0x100666fc
push dword [esi - 0xc]
lea ecx, [ebp - 0x10]
call fcn.10014050
mov esi, dword [ebp - 0x10]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov eax, dword [ebp + 8]
lea ecx, [edi + 1]
mov ebx, dword [eax - 0xc]
mov edx, ebx
sub edx, edi
xor edi, edi
test ecx, ecx
cmovns edi, ecx
xor esi, esi
sub edx, 1
mov ecx, SysReAllocString
cmovns esi, edx
sub ecx, edi
cmp ecx, esi
jl 0x10066890
lea ecx, [esi + edi]
cmp ecx, ebx
jle 0x1006673b
mov esi, ebx
sub esi, edi
xor ecx, ecx
cmp edi, ebx
cmovle ecx, esi
mov dword [ebp - 0x1c], ecx
test edi, edi
jne 0x10066761
cmp ecx, ebx
jne 0x10066761
add eax, 0xfffffff0
push eax
call fcn.10019550
add esp, 4
add eax, 0x10
mov dword [ebp - 0x18], eax
jmp 0x10066793
mov ecx, dword [eax - 0x10]
test ecx, ecx
je 0x10066771
mov eax, dword [ecx]
call dword [eax + 0x10]
test eax, eax
jne 0x1006677d
call fcn.10017640
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
push eax
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0x18]
push dword [ebp - 0x1c]
lea eax, [eax + edi*2]
push eax
call fcn.100611e0
mov eax, dword [ebp - 0x18]
mov edi, dword [ebp + 8]
lea esi, [eax - 0x10]
add edi, 0xfffffff0
mov byte [ebp - 4], 3
cmp esi, edi
je 0x100667ea
cmp dword [edi + 0xc], 0
lea ebx, [edi + 0xc]
jl 0x100667de
mov ecx, dword [esi]
cmp ecx, dword [edi]
jne 0x100667de
push esi
call fcn.10019550
add esp, 4
mov dword [ebp - 0x1c], eax
or ecx, 0xffffffff
lock xadd dword [ebx], ecx
dec ecx
test ecx, ecx
jg 0x100667d6
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x1c]
add eax, 0x10
mov dword [ebp + 8], eax
jmp 0x100667ea
push dword [eax - 0xc]
lea ecx, [ebp + 8]
push eax
call fcn.1001c180
or ebx, 0xffffffff
mov byte [ebp - 4], 1
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10066805
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
push 1
push 0x10156e8c
lea ecx, [ebp - 0x10]
call fcn.10065fd0
mov eax, dword [ebp + 8]
cmp dword [eax - 0xc], 0
jl 0x10066841
push 0x10156e8c
push eax
call fcn.10116869
mov ecx, eax
add esp, 8
test ecx, ecx
je 0x10066841
mov eax, dword [ebp + 8]
sub ecx, eax
sar ecx, 1
cmp ecx, 0xffffffff
jne 0x10066613
mov edx, dword [ebp - 0x10]
mov eax, ebx
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1006685f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp + 8]
mov dword [ebp - 4], 0xffffffff
lea edx, [eax - 0x10]
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x1006687e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x80070216
call fcn.10013b40
push 0x80004005
call fcn.10013b40
int3