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

Disassembly:
sub esp, 0x138
push ebx
mov ebx, dword [esp + 0x144]
push ebp
push esi
mov eax, dword [ebx + 8]
push edi
test eax, eax
jle 0x406f4f
mov eax, dword [ebx + 4]
mov eax, dword [eax]
jmp 0x406f51
xor eax, eax
push eax
call fcn.0043d110
mov dword [esp + 0x1c], eax
mov eax, dword [ebx + 8]
add esp, 4
mov dword [esp + 0x10], 0
test eax, eax
jle 0x406f74
mov ecx, dword [ebx + 4]
mov eax, dword [ecx]
jmp 0x406f76
xor eax, eax
push 0
push eax
call fcn.004312e0
mov edi, eax
add esp, 8
test edi, edi
je 0x406fb7
push 0
push edi
call fcn.00431160
mov esi, eax
add esp, 8
test esi, esi
je 0x406fae
push esi
call fcn.00431390
add esp, 4
mov dword [esp + 0x10], eax
push esi
call fcn.00431110
add esp, 4
push edi
call fcn.00431110
add esp, 4
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x406fcc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x138
ret
mov edx, dword [ebx + 8]
shl edx, 2
push edx
call fcn.004985f0
mov ebp, eax
mov eax, dword [ebx + 8]
add esp, 4
xor esi, esi
test eax, eax
jle 0x40703d
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x407002
cmp esi, eax
jge 0x406ffe
test esi, esi
jl 0x406ffe
mov eax, dword [ebx + 4]
mov eax, dword [eax + esi*4]
jmp 0x40701d
xor eax, eax
jmp 0x40701d
cmp esi, eax
jge 0x407012
test esi, esi
jl 0x407012
mov ecx, dword [ebx + 4]
mov eax, dword [ecx + esi*4]
jmp 0x407014
xor eax, eax
push eax
call fcn.0043d350
add esp, 4
mov edi, dword [esp + 0x10]
push 0
push eax
push edi
call fcn.00431320
add esp, 0xc
mov dword [ebp + esi*4], eax
test eax, eax
je 0x407041
mov eax, dword [ebx + 8]
inc esi
cmp esi, eax
jl 0x406fe6
mov edi, dword [esp + 0x10]
mov eax, dword [ebx + 8]
cmp esi, eax
jge 0x407064
push ebp
call fcn.00498600
mov edx, dword [edi]
add esp, 4
push edi
call dword [edx + 8]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x138
ret
mov ecx, dword [edi]
mov edi, dword [esp + 0x14c]
lea edx, [esp + 0x14]
push edx
push 0
push 0x4aa970
push ebp
push eax
mov eax, dword [esp + 0x24]
push edi
push eax
call dword [ecx + 0x28]
push ebp
mov esi, eax
call fcn.00498600
xor ebp, ebp
add esp, 4
cmp esi, ebp
jl 0x40715a
call dword [sym.imp.USER32.dll_CreatePopupMenu]
mov ebx, eax
cmp ebx, ebp
je 0x407150
mov eax, dword [esp + 0x14]
push 4
push 0x7fff
push 1
mov ecx, dword [eax]
push ebp
push ebx
push eax
call dword [ecx + 0xc]
mov esi, eax
cmp esi, ebp
jl 0x407149
mov edx, dword [esp + 0x158]
mov eax, dword [esp + 0x154]
push ebp
push edi
push ebp
push edx
push eax
push 0x102
push ebx
call dword [sym.imp.USER32.dll_TrackPopupMenu]
cmp eax, ebp
je 0x407149
dec eax
lea ecx, [esp + 0x40]
and eax, 0xffff
push ecx
push 0x105
mov dword [esp + 0x24], 0x24
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], ebp
mov dword [esp + 0x38], ebp
mov dword [esp + 0x3c], 1
mov dword [esp + 0x40], ebp
mov dword [esp + 0x44], ebp
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x1c]
push ecx
push eax
mov edx, dword [eax]
call dword [edx + 0x10]
lea edx, [esp + 0x40]
mov esi, eax
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push ebx
call dword [sym.imp.USER32.dll_DestroyMenu]
mov eax, dword [esp + 0x14]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
xor eax, eax
cmp esi, ebp
pop edi
pop esi
pop ebp
pop ebx
setge al
add esp, 0x138
ret