Function at 0x408bc7
Capabilities:
Check if file exists
Get common file path
Get file attributes
Resolve function by parsing pe exports
Set current directory

Disassembly:
push 0x240
push 0x42c9b0
call fcn.00417d90
mov dword [ebp - 0x24c], edx
mov esi, ecx
push 0x5c
pop eax
cmp word [esi], ax
je 0x41b5d4
lea ecx, [ebp - 0x244]
call fcn.00415a2e
xor eax, eax
cmp byte [ebp - 0x38], al
sete al
dec eax
and eax, 0x7ee3
add eax, 0x104
push eax
lea ecx, [ebp - 0x244]
call fcn.0040e3f0
test eax, eax
js 0x41b774
mov ecx, esi
call fcn.0040acb0
mov edi, eax
mov dword [ebp - 0x250], edi
test edi, edi
je 0x41b774
xor ebx, ebx
mov dword [ebp - 4], ebx
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x408c3d
sub ecx, edx
sar ecx, 1
lea eax, [edi + ecx*2]
mov ecx, eax
mov dword [ebp - 0x248], eax
cmp ecx, edi
jbe 0x408c66
cmp word [eax - 2], 0x20
je 0x41b5e8
xor ecx, ecx
mov word [eax], cx
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b5f0
push eax
push dword [ebp - 0x34]
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_GetCurrentDirectoryW]
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b5fb
movzx eax, word [eax]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
mov bx, ax
push 0x3d
pop eax
mov word [ebp - 0x28], ax
movzx ecx, word [edi]
push ecx
call dword [sym.imp.msvcrt.dll_iswalpha]
pop ecx
push 0x3a
pop esi
test eax, eax
je 0x41b606
cmp word [edi + 2], si
jne 0x41b606
movzx eax, word [edi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
mov word [ebp - 0x26], ax
mov word [ebp - 0x24], si
xor eax, eax
mov word [ebp - 0x22], ax
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b60f
lea ecx, [ebp - 0x248]
push ecx
push eax
push dword [ebp - 0x34]
push edi
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFullPathNameW]
test eax, eax
je 0x41b61a
cmp eax, dword [ebp - 0x34]
ja 0x41b64c
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
mov eax, ecx
je 0x41b674
xor edx, edx
cmp word [eax], dx
je 0x41b747
test ecx, ecx
mov eax, ecx
je 0x41b67f
cmp word [eax + 2], si
jne 0x41b747
test ecx, ecx
mov edx, ecx
je 0x41b68a
lea esi, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, word [ebp - 4]
jne 0x408d40
sub edx, esi
sar edx, 1
test ecx, ecx
je 0x41b695
lea edx, [ecx + edx*2]
mov esi, edx
mov dword [ebp - 0x248], edx
lea ecx, [ebp - 0x244]
call fcn.00417d82
add eax, 6
cmp esi, eax
jbe 0x408d82
push 0x5c
pop eax
cmp word [edx - 2], ax
je 0x408e77
xor eax, eax
mov word [edx], ax
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b6a0
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41b6ab
cmp byte [0x436755], 0
je 0x408dc9
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
je 0x41b6d3
xor eax, eax
push eax
mov edx, dword [ebp - 0x34]
call fcn.00410207
test eax, eax
je 0x41b64c
mov esi, dword [ebp - 0x24c]
cmp esi, 2
je 0x408dfa
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x41b6de
push eax
call dword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41b6e9
test eax, 0x410
je 0x41b6ff
test esi, esi
je 0x408e09
cmp esi, 1
jne 0x408e1f
cmp bx, word [ebp - 0x26]
jne 0x408e1f
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x408e87
push eax
call dword [sym.imp.api_ms_win_core_processenvironment_l1_1_0.dll_SetCurrentDirectoryW]
test eax, eax
je 0x41b61a
mov edx, dword [ebp - 0x3c]
test edx, edx
je 0x408e8f
lea ecx, [ebp - 0x28]
call fcn.0040a976
test eax, eax
jne 0x41b727
mov ecx, dword [0x448df8]
test ecx, ecx
je 0x408e97
xor eax, eax
push eax
mov edx, dword [0x448e00]
call fcn.00408e9e
mov dword [ebp - 4], 0xfffffffe
call fcn.00408e7f
lea ecx, [ebp - 0x244]
call fcn.004161e6
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
leave
ret
lea edx, [esi - 2]
jmp 0x408d5b
lea eax, [ebp - 0x244]
jmp 0x408e10
lea edx, [ebp - 0x244]
jmp 0x408e26
mov ecx, 0x448bf0
jmp 0x408e40
push ebp
or byte [ebx - 0x74afbbbe], cl
dec ebp
or byte [ebx - 0x2d00afaf], cl
add byte [eax], al
or byte [ebx - 0x17adfbaf], cl
dec ebx
sti
invalid
les ecx, [eax]
call fcn.0041d180
add esp, 4
mov edx, dword [ebp + 0xc]
movzx eax, byte [edx + 0x10]
test eax, eax
je 0x41b671
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call fcn.0041c770
add esp, 8
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
mov eax, dword [edx]
push eax
call fcn.0041c090
add esp, 8
push 4
add byte [ebx + 0x46a08c4], al
push 0x1000
push 0x20a
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov eax, dword [edx + 0x80]
call eax
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x18], eax
push 4
adc dword [ebx + 0x8082], ecx
add bh, bh
ror byte [ebx + 0x4189084d], 1
sbb byte [edx + 4], ch
or byte [ecx + 0x46a1841], cl
push 0x1000
push 0x20a
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov ecx, dword [eax + 0x80]
call ecx
mov edx, dword [ebp + 8]
mov dword [edx + 0x1c], eax
push 4
push 0x1000
push 0x20a
push 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x80]
call edx
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x20], eax
push 4
push 0x1000
add byte [eax], dl
add byte [eax], al
push 0x20a
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov ecx, dword [eax + 0x80]
call ecx
mov edx, dword [ebp + 8]
mov dword [edx + 0x24], eax
push 4
push 0x1000
push 0x20a
push 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x80]
call edx
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x28], eax
mov edx, 0x25
sub byte [edx + 0x25], bh
mov word [ebp - 0x48], dx
mov eax, 0x41
mov word [ebp - 0x46], ax
mov ecx, 0x50
mov word [ebp - 0x44], cx
mov edx, 0x50
mov word [ebp - 0x42], dx
mov eax, 0x44
mov word [ebp - 0x40], ax
mov ecx, 0x41
mov word [ebp - 0x3e], cx
add byte [esi - 0x77], ah
push ebp
mov esi, 0x44b8
add byte [esi - 0x77], ah
inc ebp
sar byte [ecx + 0x41], 0x66
mov dword [ebp - 0x3e], ecx
mov edx, 0x54
mov word [ebp - 0x3c], dx
mov eax, 0x41
mov word [ebp - 0x3a], ax
mov ecx, 0x25
mov word [ebp - 0x38], cx
xor edx, edx
mov word [ebp - 0x36], dx
add byte [esi - 0x77], ah
dec ebp
enter 0xffffffffffffd233, 0x66
mov dword [ebp - 0x36], edx
mov eax, 0x25
mov word [ebp - 0x24], ax
mov ecx, 0x73