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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x25c
mov eax, dword [0x478bf4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
lea eax, [ebp - 0x25c]
push edi
push eax
push 0x12c
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea eax, [esi + 1]
push 0x5c
push eax
call fcn.0044437d
mov ebx, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov edi, eax
add esp, 8
mov ecx, 0x5c5c
test edi, edi
je 0x406acc
mov byte [edi], 0
cmp word [esi], cx
jne 0x4069e8
lea eax, [esi + 2]
push 0x5c
push eax
call fcn.00438c80
add esp, 8
test eax, eax
je 0x406a16
cmp byte [esi], 0
je 0x406a0d
push esi
call ebx
test eax, eax
jne 0x406a0d
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x406a0d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x406a26
lea eax, [ebp - 0x25c]
push eax
call ebx
lea eax, [edi + 1]
mov byte [edi], 0x5c
push 0x5c
push eax
call fcn.0044437d
jmp 0x4069bc
push str.Error_creating_directory__s:_s
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00408940
add esp, 8
push eax
push esi
push 0xa97
push str.D:MyProjectsProPilotLibMisc.c
push str.Error_creating_directory__s:_s
lea eax, [ebp - 0x130]
push 0x12c
push eax
call fcn.0040ae30
add esp, 0x20
cmp dword [ebp + 8], 0xffffffff
je 0x406bbe
call fcn.00414b10
test eax, eax
je 0x406bbe
call fcn.00414b10
cmp dword [eax], 0
je 0x406bbe
mov eax, dword [0x48c5c0]
test eax, eax
je 0x406a97
mov esi, dword [eax + 0x190]
jmp 0x406a9d
mov esi, dword [0x48c5c4]
call fcn.00414b10
test eax, eax
je 0x406aaf
call fcn.00414b10
mov eax, dword [eax]
jmp 0x406ab1
xor eax, eax
lea ecx, [ebp - 0x130]
push ecx
push ecx
push dword [0x48c5c0]
push esi
push 0
push 0xa99
jmp 0x406baf
cmp word [esi], cx
jne 0x406ae7
lea eax, [esi + 2]
push 0x5c
push eax
call fcn.00438c80
add esp, 8
test eax, eax
je 0x406be3
cmp byte [esi], 0
je 0x406bda
push esi
call ebx
test eax, eax
jne 0x406bda
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne 0x406bda
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 0xb7
je 0x406bda
push str.Error_creating_directory__s:__s
push 0
call edi
push eax
call fcn.00408940
add esp, 8
push eax
push esi
push 0xaa5
push str.D:MyProjectsProPilotLibMisc.c
push str.Error_creating_directory__s:__s
lea eax, [ebp - 0x130]
push 0x12c
push eax
call fcn.0040ae30
add esp, 0x20
cmp dword [ebp + 8], 0xffffffff
je 0x406bbe
call fcn.00414b10
test eax, eax
je 0x406bbe
call fcn.00414b10
cmp dword [eax], 0
je 0x406bbe
mov eax, dword [0x48c5c0]
test eax, eax
je 0x406b7f
mov esi, dword [eax + 0x190]
jmp 0x406b85
mov esi, dword [0x48c5c4]
call fcn.00414b10
test eax, eax
je 0x406b97
call fcn.00414b10
mov eax, dword [eax]
jmp 0x406b99
xor eax, eax
lea ecx, [ebp - 0x130]
push ecx
push ecx
push dword [0x48c5c0]
push esi
push 0
push 0xaa7
push str.D:MyProjectsProPilotLibMisc.c
push 0x103
call eax
add esp, 0x20
lea eax, [ebp - 0x25c]
push eax
call ebx
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004379e8
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x25c]
push eax
call ebx
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004379e8
mov esp, ebp
pop ebp
ret