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

Disassembly:
push 0xffffffffffffffff
push 0x57cfa3
mov eax, dword fs:[0]
push eax
sub esp, 0x25c
mov eax, dword [0x6531f0]
xor eax, esp
mov dword [esp + 0x258], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6531f0]
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 0x406b62
sub eax, edx
sar eax, 1
push eax
mov eax, ebp
lea esi, [esp + 0x30]
call fcn.0040e430
mov ebx, 1
mov dword [esp + 0x278], ebx
push 0x6302c8
mov eax, esi
call fcn.0040e660
lea edx, [esp + 0x2c]
mov edi, ebx
push edx
mov ebx, 0x6302c8
mov esi, eax
call fcn.0040e730
cmp eax, 0xffffffff
je 0x406c0b
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.0040c900
mov byte [esp + 0x278], 2
push 0xffffffffffffffff
xor edi, edi
push edi
lea ecx, [esp + 0x34]
call fcn.0040e380
mov byte [esp + 0x278], 1
cmp dword [esp + 0x60], 8
jb 0x406bf6
mov ecx, dword [esp + 0x4c]
push ecx
call fcn.004fdb3f
add esp, 4
xor edx, edx
mov dword [esp + 0x60], 7
mov dword [esp + 0x5c], edi
mov word [esp + 0x4c], dx
jmp 0x406c0d
xor edi, edi
xor eax, eax
cmp dword [esp + 0x44], 8
mov word [esp + 0x64], ax
mov eax, dword [esp + 0x30]
jae 0x406c23
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 0x406e12
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x406dfa
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.0040e380
mov byte [esp + 0x278], 3
mov dword [esp + 0x1c], 0x630230
mov dword [esp + 0x20], str..exe
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 0x406cab
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.004fe986
mov esi, dword [esp + edi*4 + 0x28]
push esi
lea ecx, [esp + 0x74]
push 0x104
push ecx
call fcn.004fe888
add esp, 0x18
push 0x104
lea edx, [esp + 0x68]
push edx
mov eax, edx
push eax
call ebx
test eax, eax
jne 0x406dc4
push 0x104
lea ecx, [esp + 0x68]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push 0x63132c
lea edx, [esp + 0x68]
push 0x104
push edx
call fcn.004fe888
mov eax, dword [esp + 0x3c]
add esp, 0xc
cmp dword [esp + 0x44], ebp
jae 0x406d1e
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.004fe888
push esi
lea ecx, [esp + 0x74]
push 0x104
push ecx
call fcn.004fe888
add esp, 0x18
lea ecx, [esp + 0x64]
call fcn.00406880
test al, al
jne 0x406dc4
push 0x104
lea edx, [esp + 0x68]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0x63132c
lea eax, [esp + 0x68]
push 0x104
push eax
call fcn.004fe888
mov eax, dword [esp + 0x3c]
add esp, 0xc
cmp dword [esp + 0x44], ebp
jae 0x406d83
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x68]
push 0x104
push ecx
call fcn.004fe888
push esi
lea edx, [esp + 0x74]
push 0x104
push edx
call fcn.004fe888
add esp, 0x18
lea ecx, [esp + 0x64]
call fcn.00406880
test al, al
jne 0x406dc4
xor eax, eax
inc edi
cmp edi, 3
mov word [esp + 0x64], ax
jle 0x406c98
mov byte [esp + 0x278], 1
cmp dword [esp + 0x60], ebp
jb 0x406ddf
mov ecx, dword [esp + 0x4c]
push ecx
call fcn.004fdb3f
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 0x406e12
push 0x104
push ebp
lea eax, [esp + 0x6c]
push 0x104
push eax
call fcn.004fde42
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 0x406e30
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x68]
call fcn.0040e430
mov dword [esp + 0x18], 1
mov byte [esp + 0x278], 0
cmp dword [esp + 0x44], 8
jb 0x406e6d
mov edx, dword [esp + 0x30]
push edx
call fcn.004fdb3f
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.004fdb4a
add esp, 0x268
ret