Function at 0x1004e940
Capabilities:
Check if file exists
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x218
mov eax, dword [0x1007b00c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x208
lea eax, [ebp - 0x20c]
mov edi, edx
push 0
push eax
mov dword [ebp - 0x214], edi
mov esi, ecx
mov ebx, 1
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push str.rundll32
push esi
call dword [sym.imp.SHLWAPI.dll_StrStrIW]
cmp eax, esi
jb 0x1004ea31
lea eax, [ebp - 0x20c]
jne 0x1004e9d5
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push str.rundll32.exe
lea eax, [ebp - 0x20c]
push eax
push 0x100676d8
push 0xffffffffffffffff
push dword [ebp + 8]
push edi
call fcn.1000f290
add esp, 0x18
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1005b6db
mov esp, ebp
pop ebp
ret
push str..exe
push esi
push 0x100676d8
push 0xffffffffffffffff
push 0x104
push eax
call fcn.1000f290
add esp, 0x18
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1004ea85
mov ecx, dword [ebp + 8]
lea eax, [ecx - 1]
push eax
lea eax, [ebp - 0x20c]
push eax
push ecx
push edi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
add esp, 0x10
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1005b6db
mov esp, ebp
pop ebp
ret
push 0xb
push str.SystemRoot
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsnicmp]
add esp, 0xc
test eax, eax
jne 0x1004ea9a
push 0x104
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0xffffffffffffffff
lea eax, [esi + 0x16]
push eax
lea eax, [ebp - 0x20c]
push 0x104
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncat_s]
add esp, 0x10
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveArgsW]
jmp 0x1004e9f0
pop edi
xor ebx, ebx
pop esi
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1005b6db
mov esp, ebp
pop ebp
ret
push 0x2c
push esi
call dword [sym.imp.VCRUNTIME140.dll_wcsrchr]
mov edi, eax
add esp, 8
test edi, edi
je 0x1004eb72
sub edi, esi
mov dword [ebp - 0x210], 0
sar edi, 1
cmp edi, 0x104
jge 0x1004eae4
push edi
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
lea eax, [ebp - 0x20c]
push esi
push 0x104
push eax
call edi
lea esi, [ebp - 0x20c]
jmp 0x1004eb3b
xor ecx, ecx
mov dword [ebp - 0x210], ebx
lea eax, [edi + 2]
mov edx, 2
mul edx
push 0x1007da74
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.1005be25
add esp, 8
mov dword [ebp - 0x218], eax
test eax, eax
jne 0x1004eb26
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1005b6db
mov esp, ebp
pop ebp
ret
push edi
lea ecx, [edi + 2]
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy_s]
push esi
push ecx
push eax
call edi
mov esi, dword [ebp - 0x218]
add esp, 0x10
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1004eb5f
mov ecx, dword [ebp + 8]
lea eax, [ecx - 1]
push eax
push esi
push ecx
push dword [ebp - 0x214]
call edi
add esp, 0x10
jmp 0x1004eb61
xor ebx, ebx
cmp dword [ebp - 0x210], 0
je 0x1004eb87
push esi
call fcn.1005be17
jmp 0x1004eb84
push dword [ebp + 8]
mov edx, dword [ebp - 0x214]
mov ecx, esi
call fcn.1004e6f0
mov ebx, eax
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1005b6db
mov esp, ebp
pop ebp
ret