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

Disassembly:
push 0xffffffffffffffff
push 0x5d09b3
mov eax, dword fs:[0]
push eax
sub esp, 0x25c
mov eax, dword [0x6d26f8]
xor eax, esp
mov dword [esp + 0x258], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6d26f8]
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 0x406682
sub eax, edx
sar eax, 1
push eax
mov eax, ebp
lea esi, [esp + 0x30]
call fcn.0040d4e0
mov ebx, 1
mov dword [esp + 0x278], ebx
push 0x694260
mov eax, esi
call fcn.0040d710
lea edx, [esp + 0x2c]
mov edi, ebx
push edx
mov ebx, 0x694260
mov esi, eax
call fcn.0040d7e0
cmp eax, 0xffffffff
je 0x40672b
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.0040b590
mov byte [esp + 0x278], 2
push 0xffffffffffffffff
xor edi, edi
push edi
lea ecx, [esp + 0x34]
call fcn.0040d430
mov byte [esp + 0x278], 1
cmp dword [esp + 0x60], 8
jb 0x406716
mov ecx, dword [esp + 0x4c]
push ecx
call fcn.0059392f
add esp, 4
xor edx, edx
mov dword [esp + 0x60], 7
mov dword [esp + 0x5c], edi
mov word [esp + 0x4c], dx
jmp 0x40672d
xor edi, edi
xor eax, eax
cmp dword [esp + 0x44], 8
mov word [esp + 0x64], ax
mov eax, dword [esp + 0x30]
jae 0x406743
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 0x406932
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x40691a
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.0040d430
mov byte [esp + 0x278], 3
mov dword [esp + 0x1c], 0x692fd0
mov dword [esp + 0x20], 0x6942e4
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 0x4067cb
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.00594946
mov esi, dword [esp + edi*4 + 0x28]
push esi
lea ecx, [esp + 0x74]
push 0x104
push ecx
call fcn.0059483d
add esp, 0x18
push 0x104
lea edx, [esp + 0x68]
push edx
mov eax, edx
push eax
call ebx
test eax, eax
jne 0x4068e4
push 0x104
lea ecx, [esp + 0x68]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x692fe8
lea edx, [esp + 0x68]
push 0x104
push edx
call fcn.0059483d
mov eax, dword [esp + 0x3c]
add esp, 0xc
cmp dword [esp + 0x44], ebp
jae 0x40683e
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.0059483d
push esi
lea ecx, [esp + 0x74]
push 0x104
push ecx
call fcn.0059483d
add esp, 0x18
lea ecx, [esp + 0x64]
call fcn.004063a0
test al, al
jne 0x4068e4
push 0x104
lea edx, [esp + 0x68]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0x692fe8
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.0059483d
mov eax, dword [esp + 0x3c]
add esp, 0xc
cmp dword [esp + 0x44], ebp
jae 0x4068a3
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x68]
push 0x104
push ecx
call fcn.0059483d
push esi
lea edx, [esp + 0x74]
push 0x104
push edx
call fcn.0059483d
add esp, 0x18
lea ecx, [esp + 0x64]
call fcn.004063a0
test al, al
jne 0x4068e4
xor eax, eax
inc edi
cmp edi, 3
mov word [esp + 0x64], ax
jle 0x4067b8
mov byte [esp + 0x278], 1
cmp dword [esp + 0x60], ebp
jb 0x4068ff
mov ecx, dword [esp + 0x4c]
push ecx
call fcn.0059392f
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 0x406932
push 0x104
push ebp
lea eax, [esp + 0x6c]
push 0x104
push eax
call fcn.00593ca2
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 0x406950
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x68]
call fcn.0040d4e0
mov dword [esp + 0x18], 1
mov byte [esp + 0x278], 0
cmp dword [esp + 0x44], 8
jb 0x40698d
mov edx, dword [esp + 0x30]
push edx
call fcn.0059392f
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.0059393a
add esp, 0x268
ret