Function at 0x40d370
Capabilities:
Get common file path
Set current directory

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x4450b4
push eax
mov eax, 0x1160
mov dword fs:[0], esp
call fcn.00443160
push ebx
push ebp
push esi
push edi
lea ecx, [esp + 0x14]
mov dword [esp + 0x1178], 0
call fcn.00442a9a
mov edi, dword [sym.imp.kernel32.dll_GetCurrentDirectoryA]
push 0
push 0
mov byte [esp + 0x1180], 1
call edi
mov esi, eax
call dword [sym.imp.kernel32.dll_GetProcessHeap]
mov ebx, eax
push esi
push 8
push ebx
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov ebp, eax
push ebp
push esi
call edi
mov eax, dword [esp + 0x1180]
push ebp
push eax
call dword [sym.imp.msvcrt.dll__mbscmp]
add esp, 8
test eax, eax
je 0x40d401
mov ecx, dword [esp + 0x1180]
push ecx
call dword [sym.imp.kernel32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x40d61b
lea edx, [esp + 0x30]
push edx
push 0x4548bc
call dword [sym.imp.kernel32.dll_FindFirstFileA]
add dword [eax + eax - 0x75], 0x244c8df0
adc byte [ecx - 0x17e7db8c], cl
jp 0x40d474
add eax, dword [eax]
cmp esi, 0xffffffff
mov byte [esp + 0x1178], 2
je 0x40d5f9
mov esi, dword [sym.imp.kernel32.dll_RemoveDirectoryA]
mov edi, dword [sym.imp.msvcrt.dll_sprintf]
lea eax, [esp + 0x5c]
lea ecx, [esp + 0x10]
push eax
call fcn.00442ad0
mov ecx, dword [esp + 0x10]
push 0x4548b8
push ecx
call dword [sym.imp.msvcrt.dll__mbscmp]
add esp, 8
test eax, eax
je 0x40d5d6
mov edx, dword [esp + 0x10]
push 0x4548b4
push edx
call dword [sym.imp.msvcrt.dll__mbscmp]
add esp, 8
test eax, eax
je 0x40d5d6
mov eax, dword [esp + 0x30]
and eax, 0x10
cmp al, 0x10
mov eax, dword [esp + 0x1180]
mov ecx, dword [eax - 8]
mov dl, byte [ecx + eax - 1]
jne 0x40d594
cmp dl, 0x5c
je 0x40d4ed
lea ecx, [esp + 0x1180]
push 0x5c
lea edx, [esp + 0x30]
push ecx
push edx
call sub.mfc42.dll_operator_2
push ecx
lea edx, [esp + 0x14]
mov ecx, esp
mov dword [esp + 0x28], esp
push edx
push eax
push ecx
mov byte [esp + 0x1188], 3
call sub.mfc42.dll_operator_1
call fcn.0040d370
add esp, 4
lea ecx, [esp + 0x2c]
mov byte [esp + 0x1178], 2
call sub.mfc42.dll_CString::CString
jmp 0x40d50f
push ecx
lea ecx, [esp + 0x14]
mov eax, esp
mov dword [esp + 0x28], esp
lea edx, [esp + 0x1184]
push ecx
push edx
push eax
call sub.mfc42.dll_operator_1
call fcn.0040d370
add esp, 4
mov eax, dword [esp + 0x1180]
mov ecx, dword [eax - 8]
cmp byte [ecx + eax - 1], 0x5c
je 0x40d56d
lea eax, [esp + 0x1180]
push 0x5c
lea ecx, [esp + 0x2c]
push eax
push ecx
call sub.mfc42.dll_operator_2
lea edx, [esp + 0x10]
mov byte [esp + 0x1178], 4
push edx
push eax
lea eax, [esp + 0x24]
push eax
call sub.mfc42.dll_operator_1
mov eax, dword [eax]
push eax
call esi
lea ecx, [esp + 0x1c]
call sub.mfc42.dll_CString::CString
lea ecx, [esp + 0x28]
mov byte [esp + 0x1178], 2
call sub.mfc42.dll_CString::CString
jmp 0x40d5d6
lea ecx, [esp + 0x10]
lea edx, [esp + 0x1180]
push ecx
lea eax, [esp + 0x24]
push edx
push eax
call sub.mfc42.dll_operator_1
mov eax, dword [eax]
push eax
call esi
lea ecx, [esp + 0x20]
call sub.mfc42.dll_CString::CString
jmp 0x40d5d6
mov ecx, dword [esp + 0x10]
cmp dl, 0x5c
push ecx
push eax
je 0x40d5a6
push 0x454820
jmp 0x40d5ab
push 0x4548ac
lea edx, [esp + 0x17c]
push edx
call edi
add esp, 0x10
lea eax, [esp + 0x170]
push 0
push eax
call dword [sym.imp.kernel32.dll_GetLastError_1]
lea ecx, [esp + 0x170]
push ecx
call dword [sym.imp.kernel32.dll_GetLastError_2]
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x30]
push edx
push eax
call dword [sym.imp.kernel32.dll_FindNextFileA]
test eax, eax
jne 0x40d43d
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.kernel32.dll_FindClose]
push ebp
call dword [sym.imp.kernel32.dll_SetCurrentDirectoryA]
push ebp
push 1
push ebx
call dword [sym.imp.kernel32.dll_HeapFree]
lea ecx, [esp + 0x10]
mov byte [esp + 0x1178], 1
call sub.mfc42.dll_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x1178], 0
call sub.mfc42.dll_CString::CString
lea ecx, [esp + 0x1180]
mov dword [esp + 0x1178], 0xffffffff
call sub.mfc42.dll_CString::CString
mov ecx, dword [esp + 0x1170]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x116c
ret