Function at 0x40d110
Capabilities:
Check if file exists
Create directory
Get file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x64c
mov eax, dword [0x4a22d0]
xor eax, esp
mov dword [esp + 0x648], eax
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
push edi
mov edi, dword [ebp + 0xc]
mov dword [esp + 0x14], ebx
cmp dword [esi + 0x10], 0x104
jae 0x40d5d7
cmp dword [edi + 0x10], 0x104
jae 0x40d5d7
xor eax, eax
mov dword [esp + 0x344], 7
push 0xffffffffffffffff
push eax
push edi
lea ecx, [esp + 0x33c]
mov dword [esp + 0x34c], ebx
mov word [esp + 0x33c], ax
call fcn.00407bd0
cmp dword [esp + 0x344], 8
lea eax, [esp + 0x330]
cmovae eax, dword [esp + 0x330]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40d284
lea eax, [esp + 0x330]
push eax
lea eax, [esp + 0x31c]
push eax
call fcn.0040ce80
lea ecx, [esp + 0x338]
add esp, 8
cmp ecx, eax
je 0x40d1d2
push 0xffffffffffffffff
push ebx
push eax
call fcn.00407bd0
cmp dword [esp + 0x32c], 8
jb 0x40d1eb
push dword [esp + 0x318]
call fcn.0046d967
add esp, 4
cmp dword [esp + 0x340], ebx
je 0x40d319
lea eax, [esp + 0x360]
push esi
push eax
call fcn.0040ce80
mov eax, dword [esp + 0x378]
add esp, 8
test eax, eax
je 0x40d56c
cmp dword [esp + 0x340], eax
jb 0x40d23f
lea ecx, [esp + 0x360]
push ecx
push eax
push ecx
lea ecx, [esp + 0x33c]
call fcn.0040e3f0
test eax, eax
je 0x40d56c
mov ecx, dword [ebp + 0x10]
mov edx, 3
test cl, cl
mov eax, 1
cmovne eax, edx
push eax
push ecx
push esi
lea ecx, [esp + 0x3b4]
call fcn.0041d310
push esi
call fcn.0040d5f0
add esp, 4
test al, al
jne 0x40d320
lea ecx, [esp + 0x3a8]
xor bl, bl
call fcn.0041d4d0
jmp 0x40d56e
lea eax, [esp + 0x378]
push eax
lea ecx, [esp + 0x334]
call fcn.00405cb0
push eax
lea eax, [esp + 0x31c]
push eax
call fcn.0040ce80
lea ecx, [esp + 0x338]
add esp, 8
cmp ecx, eax
je 0x40d2be
push 0xffffffffffffffff
push 0
push eax
call fcn.00407bd0
cmp dword [esp + 0x32c], 8
jb 0x40d2d7
push dword [esp + 0x318]
call fcn.0046d967
add esp, 4
xor eax, eax
mov dword [esp + 0x32c], 7
cmp dword [esp + 0x38c], 8
mov dword [esp + 0x328], ebx
mov word [esp + 0x318], ax
jb 0x40d30c
push dword [esp + 0x378]
call fcn.0046d967
add esp, 4
cmp dword [esp + 0x340], ebx
jne 0x40d1f8
xor bl, bl
jmp 0x40d5a7
push esi
lea ecx, [esp + 0x34c]
call fcn.004054c0
push esi
call fcn.0040d610
add esp, 4
mov byte [esp + 0x14], al
lea ecx, [esp + 0x390]
mov byte [esp + 0x13], 1
push esi
call fcn.004054c0
cmp byte [ebp + 0x10], bl
je 0x40d38e
push edi
call fcn.0040d610
add esp, 4
test al, al
je 0x40d38e
lea eax, [esp + 0x378]
mov ecx, esi
push eax
call fcn.00405cb0
lea ecx, [esp + 0x390]
cmp ecx, eax
je 0x40d382
push 0xffffffffffffffff
push 0
push eax
call fcn.00407bd0
lea ecx, [esp + 0x378]
call fcn.00405570
mov esi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jmp 0x40d3a0
cmp dword [esp + 0x358], 0
je 0x40d532
xor eax, eax
mov dword [esp + 0x32c], 7
push 0xffffffffffffffff
push eax
push edi
lea ecx, [esp + 0x324]
mov dword [esp + 0x334], 0
mov word [esp + 0x324], ax
call fcn.00407bd0
lea eax, [esp + 0x348]
push eax
lea ecx, [esp + 0x394]
call fcn.00405610
test al, al
je 0x40d41a
lea eax, [esp + 0x318]
push eax
lea eax, [esp + 0x34c]
push eax
lea ecx, [esp + 0x398]
call fcn.00405a40
test al, al
je 0x40d55c
cmp byte [esp + 0x14], 0
lea eax, [esp + 0x318]
je 0x40d475
cmp dword [esp + 0x32c], 8
cmovae eax, dword [esp + 0x318]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40d44b
shr eax, 4
and al, 1
jne 0x40d4a0
cmp dword [esp + 0x32c], 8
lea eax, [esp + 0x318]
push 0
cmovae eax, dword [esp + 0x31c]
push eax
call esi
test eax, eax
jne 0x40d4a0
test bl, 4
je 0x40d49b
and ebx, 0xfffffffb
jmp 0x40d492
push eax
lea eax, [esp + 0x34c]
push eax
call fcn.0040e250
add esp, 8
test al, al
jne 0x40d4a0
test bl, 8
je 0x40d49b
and ebx, 0xfffffff7
lea ecx, [esp + 0x18]
call fcn.00409ac0
mov byte [esp + 0x13], 0
lea eax, [esp + 0x378]
push eax
lea ecx, [esp + 0x3ac]
call fcn.0041d5e0
lea ecx, [esp + 0x348]
cmp ecx, eax
je 0x40d4c9
push 0xffffffffffffffff
push 0
push eax
call fcn.00407bd0
cmp dword [esp + 0x38c], 8
jb 0x40d4e2
push dword [esp + 0x378]
call fcn.0046d967
add esp, 4
cmp dword [esp + 0x358], 0
je 0x40d50e
lea eax, [esp + 0xc8]
push eax
lea ecx, [esp + 0x3ac]
call fcn.0041d580
mov eax, dword [eax]
shr eax, 4
and eax, 0xffffff01
mov dword [esp + 0x14], eax
cmp dword [esp + 0x32c], 8
jb 0x40d527
push dword [esp + 0x318]
call fcn.0046d967
add esp, 4
cmp byte [esp + 0x13], 0
jne 0x40d3a0
mov bl, byte [esp + 0x13]
lea ecx, [esp + 0x390]
call fcn.00405570
lea ecx, [esp + 0x348]
call fcn.00405570
lea ecx, [esp + 0x3a8]
call fcn.0041d4d0
jmp 0x40d56e
lea ecx, [esp + 0x318]
xor bl, bl
call fcn.00405570
jmp 0x40d536
xor bl, bl
cmp dword [esp + 0x374], 8
jb 0x40d587
push dword [esp + 0x360]
call fcn.0046d967
add esp, 4
xor eax, eax
mov dword [esp + 0x374], 7
mov dword [esp + 0x370], 0
mov word [esp + 0x360], ax
cmp dword [esp + 0x344], 8
jb 0x40d5c0
push dword [esp + 0x330]
call fcn.0046d967
add esp, 4
mov al, bl
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x648]
xor ecx, esp
call fcn.0046e2b4
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x654]
xor al, al
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0046e2b4
mov esp, ebp
pop ebp
ret