Function at 0x412904
Capabilities:
Check if file exists
Get common file path
Get file attributes
Set current directory

Disassembly:
push 0x240
push 0x42bbb8
call fcn.004172ec
mov dword [ebp - 0x24c], edx
mov esi, ecx
push 0x5c
pop eax
cmp word [esi], ax
je 0x41ee37
lea ecx, [ebp - 0x244]
call fcn.0040fc81
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.0040fba0
test eax, eax
js 0x41ee4b
mov ecx, esi
call fcn.0040ce50
mov edi, eax
mov dword [ebp - 0x250], edi
test edi, edi
je 0x41ee4b
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 0x41297a
sub ecx, edx
sar ecx, 1
lea eax, [edi + ecx*2]
mov dword [ebp - 0x248], eax
cmp eax, edi
jbe 0x4129a1
cmp word [eax - 2], 0x20
je 0x41eea0
xor ecx, ecx
mov word [eax], cx
xor eax, eax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
setne al
test al, al
je 0x41eea8
push ecx
push dword [ebp - 0x34]
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_GetCurrentDirectoryW]
xor eax, eax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
setne al
test al, al
je 0x41eeb3
movzx eax, word [ecx]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
mov bx, ax
push 0x3d
pop eax
mov word [ebp - 0x2c], ax
movzx ecx, word [edi]
push ecx
call dword [sym.imp.msvcrt.dll_iswalpha]
pop ecx
push 0x3a
pop esi
test eax, eax
je 0x41eebe
cmp word [edi + 2], si
jne 0x41eebe
movzx eax, word [edi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
mov word [ebp - 0x2a], ax
mov word [ebp - 0x28], si
xor eax, eax
mov word [ebp - 0x26], ax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
setne al
test al, al
je 0x41eec7
lea eax, [ebp - 0x248]
push eax
push ecx
push dword [ebp - 0x34]
push edi
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFullPathNameW]
test eax, eax
je 0x41eed2
cmp eax, dword [ebp - 0x34]
ja 0x41ef04
xor eax, eax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
setne al
test al, al
mov eax, ecx
je 0x41ef2c
xor edx, edx
cmp word [eax], dx
je 0x41ee7a
xor eax, eax
test ecx, ecx
setne al
test al, al
mov eax, ecx
je 0x41ef37
cmp word [eax + 2], si
jne 0x41ee7a
xor eax, eax
test ecx, ecx
setne al
test al, al
mov edx, ecx
je 0x41ef42
lea esi, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, word [ebp - 4]
jne 0x412aa3
sub edx, esi
sar edx, 1
xor eax, eax
test ecx, ecx
setne al
test al, al
je 0x41ef4d
lea edx, [ecx + edx*2]
push 0x5c
pop esi
mov dword [ebp - 0x248], edx
lea ecx, [ebp - 0x244]
call fcn.004169f6
add eax, 6
cmp edx, eax
jbe 0x412aea
cmp word [edx - 2], si
je 0x412bff
xor eax, eax
mov word [edx], ax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
setne al
test al, al
je 0x41ef58
push ecx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41ef63
cmp byte [0x443cd9], 0
je 0x412b3d
xor eax, eax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
setne al
test al, al
je 0x41ef8b
xor eax, eax
push eax
mov edx, dword [ebp - 0x34]
call fcn.004116fa
test eax, eax
je 0x41ef04
mov esi, dword [ebp - 0x24c]
cmp esi, 2
je 0x412b75
xor eax, eax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
setne al
test al, al
je 0x41ef96
push ecx
call dword [sym.imp.api_ms_win_core_file_l1_2_1.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41efa1
test eax, 0x410
je 0x41efb7
test esi, esi
je 0x412b84
cmp esi, 1
jne 0x412ba5
cmp bx, word [ebp - 0x2a]
jne 0x412ba5
xor eax, eax
mov ecx, dword [ebp - 0x3c]
test ecx, ecx
setne al
test al, al
je 0x41efdf
push ecx
call dword [sym.imp.api_ms_win_core_processenvironment_l1_2_0.dll_SetCurrentDirectoryW]
test eax, eax
je 0x41eed2
xor eax, eax
mov edx, dword [ebp - 0x3c]
test edx, edx
setne al
test al, al
je 0x412c0f
lea ecx, [ebp - 0x2c]
call fcn.00412faa
test eax, eax
jne 0x41ee58
mov ecx, dword [0x443cc8]
test ecx, ecx
setne al
test al, al
je 0x412c17
xor eax, eax
push eax
mov edx, dword [0x443cd0]
call fcn.00412c1e
mov dword [ebp - 4], 0xfffffffe
call fcn.00412c07
lea ecx, [ebp - 0x244]
call fcn.0040fd18
xor eax, eax
call fcn.00417334
ret
add edx, 0xfffffffe
jmp 0x412ac8
lea edx, [ebp - 0x244]
jmp 0x412bb3
mov ecx, 0x443ac0
jmp 0x412bd2
cmp word [esi + 2], ax
jne 0x412927
mov eax, 0x400023c9
jmp 0x412bf9
lea ecx, [ebp - 0x244]
call fcn.0040fd18
jmp 0x41ee76
lea ecx, [ebp - 0x244]
call fcn.0040fd18
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42d0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
push 8
jmp 0x41ee9a
lea ecx, [ebp - 0x244]
call fcn.0040fd18
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42d0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
push 3
pop eax
jmp 0x412bf9
add eax, 0xfffffffe
jmp 0x41298c
lea ecx, [ebp - 0x244]
jmp 0x4129b8
lea ecx, [ebp - 0x244]
jmp 0x4129d4
mov word [ebp - 0x2a], bx
jmp 0x412a18
lea ecx, [ebp - 0x244]
jmp 0x412a32
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov esi, eax
jmp 0x41eedf
push 3
pop esi
lea ecx, [ebp - 0x244]
call fcn.0040fd18
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42d0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, esi
jmp 0x412bf9
lea ecx, [ebp - 0x244]
call fcn.0040fd18
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42d0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, 0xce
jmp 0x412bf9
lea eax, [ebp - 0x244]
jmp 0x412a69
lea eax, [ebp - 0x244]
jmp 0x412a85
lea edx, [ebp - 0x244]
jmp 0x412aa0
lea ecx, [ebp - 0x244]
jmp 0x412ac2
lea ecx, [ebp - 0x244]
jmp 0x412aff
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov esi, eax
cmp esi, 2
je 0x412b0f
cmp esi, 3
je 0x412b0f
cmp esi, 0x7b
jne 0x41eedf
jmp 0x412b0f
lea ecx, [ebp - 0x244]
jmp 0x412b2a
lea ecx, [ebp - 0x244]
jmp 0x412b5a
call dword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov esi, eax
cmp esi, 2
jne 0x41eedf
jmp 0x41eedc
lea ecx, [ebp - 0x244]
call fcn.0040fd18
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x42d0b4
call sub.msvcrt.dll__local_unwind4
add esp, 0xc
mov eax, 0x10b
jmp 0x412bf9
lea ecx, [ebp - 0x244]
jmp 0x412b96