Function at 0x4065c0
Capabilities:
Check for peb beingdebugged flag
Check if file exists
Get common file path

Disassembly:
push 0xffffffffffffffff
push 0x600563
mov eax, dword fs:[0]
push eax
sub esp, 0x25c
mov eax, dword [0x711ab8]
xor eax, esp
mov dword [esp + 0x258], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x711ab8]
xor eax, esp
push eax
lea eax, [esp + 0x270]
mov dword fs:[0], eax
xor esi, esi
mov dword [esp + 0x278], esi
mov eax, dword [esp + 0x280]
mov ebp, dword [esp + 0x284]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], esi
xor ecx, ecx
mov eax, ebp
mov dword [esp + 0x44], 7
mov dword [esp + 0x40], esi
mov word [esp + 0x30], cx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x406632
sub eax, edx
sar eax, 1
push eax
mov eax, ebp
lea esi, [esp + 0x30]
call fcn.0040d7f0
mov ebx, 1
mov dword [esp + 0x278], ebx
push 0x6cb388
mov eax, esi
call fcn.0040da20
lea edx, [esp + 0x2c]
mov edi, ebx
push edx
mov ebx, 0x6cb388
mov esi, eax
call fcn.0040daf0
cmp eax, 0xffffffff
je 0x4066db
mov ecx, eax
lea eax, [esp + 0x48]
push eax
sub ecx, esi
lea eax, [esp + 0x30]
dec ecx
lea edx, [esi + 1]
push eax
call fcn.0040b680
mov byte [esp + 0x278], 2
push 0xffffffffffffffff
xor edi, edi
push edi
lea ecx, [esp + 0x34]
call fcn.0040d740
mov byte [esp + 0x278], 1
cmp dword [esp + 0x60], 8
jb 0x4066c6
mov ecx, dword [esp + 0x4c]
push ecx
call fcn.005c396f
add esp, 4
xor edx, edx
mov dword [esp + 0x60], 7
mov dword [esp + 0x5c], edi
mov word [esp + 0x4c], dx
jmp 0x4066dd
xor edi, edi
xor eax, eax
cmp dword [esp + 0x44], 8
mov word [esp + 0x64], ax
mov eax, dword [esp + 0x30]
jae 0x4066f3
lea eax, [esp + 0x30]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
push 0x104
lea ecx, [esp + 0x68]
push ecx
push eax
call ebx
test eax, eax
jne 0x4068e2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x4068ca
push 0xffffffffffffffff
xor edx, edx
push edi
lea eax, [esp + 0x34]
lea ecx, [esp + 0x50]
mov dword [esp + 0x68], 7
mov dword [esp + 0x64], edi
mov word [esp + 0x54], dx
call fcn.0040d740
mov byte [esp + 0x278], 3
mov dword [esp + 0x1c], 0x6ca128
mov dword [esp + 0x20], 0x6cb40c
mov dword [esp + 0x24], str..dll
mov dword [esp + 0x28], str..com
mov eax, dword [esp + 0x30]
mov ebp, 8
cmp dword [esp + 0x44], ebp
jae 0x40677b
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.005c4986
mov esi, dword [esp + edi*4 + 0x28]
push esi
lea ecx, [esp + 0x74]
push 0x104
push ecx
call fcn.005c487d
add esp, 0x18
push 0x104
lea edx, [esp + 0x68]
push edx
mov eax, edx
push eax
call ebx
test eax, eax
jne 0x406894
push 0x104
lea ecx, [esp + 0x68]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x6ca140
lea edx, [esp + 0x68]
push 0x104
push edx
call fcn.005c487d
mov eax, dword [esp + 0x3c]
add esp, 0xc
cmp dword [esp + 0x44], ebp
jae 0x4067ee
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.005c487d
push esi
lea ecx, [esp + 0x74]
push 0x104
push ecx
call fcn.005c487d
add esp, 0x18
lea ecx, [esp + 0x64]
call fcn.00406350
test al, al
jne 0x406894
push 0x104
lea edx, [esp + 0x68]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0x6ca140
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.005c487d
mov eax, dword [esp + 0x3c]
add esp, 0xc
cmp dword [esp + 0x44], ebp
jae 0x406853
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x68]
push 0x104
push ecx
call fcn.005c487d
push esi
lea edx, [esp + 0x74]
push 0x104
push edx
call fcn.005c487d
add esp, 0x18
lea ecx, [esp + 0x64]
call fcn.00406350
test al, al
jne 0x406894
xor eax, eax
inc edi
cmp edi, 3
mov word [esp + 0x64], ax
jle 0x406768
mov byte [esp + 0x278], 1
cmp dword [esp + 0x60], ebp
jb 0x4068af
mov ecx, dword [esp + 0x4c]
push ecx
call fcn.005c396f
add esp, 4
xor edx, edx
mov dword [esp + 0x60], 7
mov dword [esp + 0x5c], 0
mov word [esp + 0x4c], dx
xor edi, edi
jmp 0x4068e2
push 0x104
push ebp
lea eax, [esp + 0x6c]
push 0x104
push eax
call fcn.005c3ce2
add esp, 0x10
mov esi, dword [esp + 0x14]
mov ebx, 7
xor ecx, ecx
lea eax, [esp + 0x64]
mov dword [esi + 0x18], ebx
mov dword [esi + 0x14], edi
mov word [esi + 4], cx
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x406900
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x68]
call fcn.0040d7f0
mov dword [esp + 0x18], 1
mov byte [esp + 0x278], 0
cmp dword [esp + 0x44], 8
jb 0x40693d
mov edx, dword [esp + 0x30]
push edx
call fcn.005c396f
add esp, 4
xor eax, eax
mov dword [esp + 0x44], ebx
mov dword [esp + 0x40], edi
mov word [esp + 0x30], ax
mov eax, esi
mov ecx, dword [esp + 0x270]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x258]
xor ecx, esp
call fcn.005c397a
add esp, 0x268
ret