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

Disassembly:
sub esp, 0x140
mov eax, dword [0x438e28]
xor eax, esp
mov dword [esp + 0x13c], eax
push ebx
push ebp
mov ebp, dword [esp + 0x14c]
push esi
push edi
mov edi, dword [sym.imp.USER32.dll_SendMessageA]
push 0
push 0
push 0x147
push ebp
mov esi, ecx
mov dword [esp + 0x28], ebp
call edi
mov ebx, eax
mov eax, dword [0x43c548]
mov dword [esp + 0x14], ebx
cmp ebx, eax
jne 0x406106
lea eax, [esp + 0x14]
push eax
push 5
push esi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x4060f0
mov ecx, dword [esp + 0x14]
push 0x43c320
push ecx
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
test eax, eax
jne 0x4063e8
mov edx, dword [0x43c43c]
push 0
push edx
push 0x14e
push ebp
call edi
jmp 0x4063e8
lea ecx, [eax + 1]
cmp ebx, ecx
jne 0x40614d
lea edx, [esp + 0x14]
push edx
push 0x10
push esi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x406137
mov eax, dword [esp + 0x14]
push 0x43c320
push eax
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
test eax, eax
jne 0x4063e8
mov ecx, dword [0x43c43c]
push 0
push ecx
push 0x14e
push ebp
call edi
jmp 0x4063e8
add eax, 2
cmp ebx, eax
jne 0x406290
lea edx, [esp + 0x14]
push edx
push 0x12
push esi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
je 0x40617f
mov eax, dword [0x43c43c]
push 0
push eax
push 0x14e
push ebp
call edi
jmp 0x4063e8
mov ecx, dword [esp + 0x14]
xor eax, eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x34], eax
lea eax, [esp + 0x18]
lea edx, [esp + 0x40]
push eax
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x34], 1
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
lea ecx, [esp + 0x20]
push ecx
call dword [sym.imp.SHELL32.dll_SHBrowseForFolderA]
mov edi, eax
test edi, edi
je 0x40625a
lea edx, [esp + 0x40]
push edx
push edi
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
test eax, eax
je 0x40624d
xor eax, eax
jmp 0x4061e0
mov cl, byte [esp + eax + 0x40]
mov byte [eax + 0x43c320], cl
inc eax
test cl, cl
jne 0x4061e0
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x14]
push edi
push eax
call edx
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
push 0x3e8
push esi
call dword [sym.imp.USER32.dll_GetDlgItem]
push 0
push 0
mov esi, eax
push 0x184
push esi
call dword [sym.imp.USER32.dll_SendMessageA]
push 0
push 0
mov eax, 0x43c320
call fcn.00405b90
add esp, 8
jmp 0x4063e8
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x14]
push edi
push eax
call edx
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 0x14]
call eax
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [0x43c43c]
push 0
push eax
push 0x14e
push ebp
call dword [sym.imp.USER32.dll_SendMessageA]
jmp 0x4063e8
lea ecx, [esp + 0x40]
push ecx
push ebx
push 0x148
push ebp
call edi
xor esi, esi
cmp dword [0x43c548], esi
jle 0x4062eb
mov edi, 0x43bea4
lea ecx, [ecx]
mov ecx, edi
lea eax, [esp + 0x40]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4062d6
test dl, dl
je 0x4062d2
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4062d6
add eax, 2
add ecx, 2
test dl, dl
jne 0x4062b6
xor eax, eax
jmp 0x4062db
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4062eb
inc esi
add edi, 0x24
cmp esi, dword [0x43c548]
jl 0x4062b0
push 0x7f02
push 0
call dword [sym.imp.USER32.dll_LoadCursorA]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov dword [esp + 0x1c], eax
lea eax, [esi + esi*8]
lea edi, [eax*4 + 0x43bea0]
push edi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
jne 0x406381
mov ebp, dword [sym.imp.USER32.dll_LoadStringA]
mov ebx, dword [sym.imp.USER32.dll_MessageBoxA]
push 0x100
call fcn.0041882e
mov edx, dword [0x44d46c]
add esp, 4
push 0x100
mov esi, eax
push esi
push 0x6d
push edx
call ebp
push edi
lea eax, [esp + 0x44]
push esi
push eax
call fcn.00418202
push esi
call fcn.0041855e
add esp, 0x10
push 0x35
push 0x433250
lea ecx, [esp + 0x48]
push ecx
push 0
call ebx
cmp eax, 4
jne 0x40639c
push edi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x406324
mov ebp, dword [esp + 0x18]
mov ebx, dword [esp + 0x14]
mov edx, 0x43c320
mov eax, edi
sub edx, edi
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x406390
jmp 0x4063c8
mov eax, dword [0x43c43c]
mov dword [esp + 0x14], eax
lea eax, [eax + eax*8]
lea eax, [eax*4 + 0x43bea0]
mov edx, 0x43c320
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4063b6
mov ebp, dword [esp + 0x18]
mov ebx, dword [esp + 0x14]
push 0
push ebx
push 0x14e
push ebp
call dword [sym.imp.USER32.dll_SendMessageA]
mov edx, dword [esp + 0x1c]
push edx
mov dword [0x43c43c], ebx
call dword [sym.imp.USER32.dll_SetCursor]
mov ecx, dword [esp + 0x14c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004181f3
add esp, 0x140
ret