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

Disassembly:
push ebx
push esi
push edi
push 0x21a
call fcn.00489595
add esp, 4
mov edi, eax
push 0x21a
call fcn.00489595
add esp, 4
mov esi, eax
push 0x218
call fcn.00489595
add esp, 4
mov dword [0x54e4cc], eax
test edi, edi
je 0x405632
test esi, esi
je 0x405624
test eax, eax
je 0x405624
xor eax, eax
push edi
mov word [esi], ax
push 0xfc
mov word [edi], ax
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test eax, eax
jne 0x4053f0
push edi
call fcn.00488f53
add esp, 4
push esi
call fcn.00488f53
add esp, 4
push dword [0x54e4cc]
jmp 0x405649
mov edx, dword [0x54e4cc]
mov ecx, edi
nop dword [eax + eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx], ax
lea edx, [edx + 2]
test ax, ax
jne 0x405400
push 0x4ddd84
push 0x4ddd88
call fcn.004893ee
mov ebx, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
add esp, 8
test eax, eax
jne 0x405489
push esi
push 0
push 0
push 0x1a
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jne 0x405492
push esi
call ebx
test eax, eax
je 0x405492
push str.FT2_clone
call fcn.0048b675
add esp, 4
test eax, eax
je 0x405476
push str.FT2_clone
call fcn.0048a3f5
add esp, 4
push str.FT2_clone
call fcn.0048b675
add esp, 4
test eax, eax
jne 0x405492
push dword [0x54e4cc]
push 0xfc
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
jmp 0x405492
push eax
call fcn.00489118
add esp, 4
push esi
call fcn.00488f53
add esp, 4
push edi
call ebx
push edi
call fcn.00488f53
mov ecx, dword [0x54e4cc]
add esp, 4
add ecx, 0xfffffffe
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x4054b0
mov eax, dword [str.FT2.CFG]
mov dword [ecx], eax
mov eax, dword [0x4ddda0]
mov dword [ecx + 4], eax
mov eax, dword [0x4ddda4]
mov dword [ecx + 8], eax
mov eax, dword [0x4ddda8]
mov dword [ecx + 0xc], eax
mov ax, word [0x4dddac]
mov word [ecx + 0x10], ax
mov esi, dword [0x54e4cc]
test esi, esi
jne 0x405501
xor ebx, ebx
mov dword [0x54e4d4], esi
mov dword [0x54e4d0], ebx
pop edi
pop esi
pop ebx
ret
lea ecx, [esi + 2]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x405504
sub esi, ecx
sar esi, 1
lea eax, [esi*2 + 0x18]
push eax
call fcn.00489595
mov ebx, eax
add esp, 4
xor eax, eax
mov edi, ebx
mov word [ebx], ax
mov edx, dword [0x54e4cc]
movzx ecx, word [edx]
lea edx, [edx + 2]
mov word [edi], cx
lea edi, [edi + 2]
test cx, cx
jne 0x405532
xor eax, eax
lea ecx, [ebx - 2]
mov word [ebx + esi*2 - 0xe], ax
nop dword [eax]
mov ax, word [ecx + 2]
lea ecx, [ecx + 2]
test ax, ax
jne 0x405550
mov eax, dword [str.mididev.ini]
mov dword [ecx], eax
mov eax, dword [0x4ddd20]
mov dword [ecx + 4], eax
mov eax, dword [0x4ddd24]
mov dword [ecx + 8], eax
mov eax, dword [0x4ddd28]
mov dword [ecx + 0xc], eax
mov eax, dword [0x4ddd2c]
mov dword [ecx + 0x10], eax
mov eax, dword [0x4ddd30]
mov dword [ecx + 0x14], eax
mov esi, dword [0x54e4cc]
mov dword [0x54e4d4], ebx
test esi, esi
jne 0x4055a7
xor ebx, ebx
mov dword [0x54e4d0], ebx
pop edi
pop esi
pop ebx
ret
lea ecx, [esi + 2]
nop word [eax + eax]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x4055b0
sub esi, ecx
sar esi, 1
lea eax, [esi*2 + 0x1a]
push eax
call fcn.00489595
mov ebx, eax
add esp, 4
xor eax, eax
mov edi, ebx
mov word [ebx], ax
mov edx, dword [0x54e4cc]
nop
movzx ecx, word [edx]
lea edx, [edx + 2]
mov word [edi], cx
lea edi, [edi + 2]
test cx, cx
jne 0x4055e0
xor eax, eax
lea edi, [ebx - 2]
mov word [ebx + esi*2 - 0xe], ax
nop dword [eax + eax]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x405600
mov ecx, 6
mov esi, str.audiodev.ini
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov dword [0x54e4d0], ebx
pop edi
pop esi
pop ebx
ret
push edi
call fcn.00488f53
mov eax, dword [0x54e4cc]
add esp, 4
test esi, esi
je 0x405644
push esi
call fcn.00488f53
mov eax, dword [0x54e4cc]
add esp, 4
test eax, eax
je 0x405651
push eax
call fcn.00488f53
add esp, 4
push str.Error:_Couldnt_set_config_file_location._You_cant_load_save_the_config_
mov dword [0x54e4cc], 0
call fcn.004468b0
add esp, 4
pop edi
pop esi
pop ebx
ret