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

Disassembly:
push ebp
push edi
mov eax, 0x803c
push esi
push ebx
call fcn.004ce940
sub esp, eax
mov eax, dword [ecx + 0x24]
mov ebx, ecx
test eax, eax
je 0x538108
mov dword [esp], eax
call fcn.00606c30
mov dword [ebx + 0x24], 0
mov eax, dword [ebx + 0x34]
test eax, eax
je 0x538117
mov dword [esp], eax
call fcn.00606c30
lea esi, [ebx + 8]
lea edi, [ebx + 0xc]
xor eax, eax
mov edx, dword [ebx + 0x20]
and edi, 0xfffffffc
mov ecx, esi
mov dword [esi + 0x54], 0
sub ecx, edi
add ecx, 0x58
shr ecx, 2
rep stosd dword es:[edi], eax
mov dword [ebx + 0x20], edx
mov dword [ebx + 8], 0x58
mov edx, dword [ebx + 0x80]
test edx, edx
je 0x5381a6
mov eax, dword [ebx + 0x84]
sub eax, 1
test eax, eax
mov dword [ebx + 0x84], eax
js 0x538194
nop
lea edi, [edx + eax*4]
mov eax, dword [edi]
test eax, eax
je 0x538171
mov dword [esp], eax
call fcn.00606c30
mov dword [edi], 0
mov eax, dword [ebx + 0x84]
mov edx, dword [ebx + 0x80]
sub eax, 1
test eax, eax
mov dword [ebx + 0x84], eax
jns 0x538160
test edx, edx
je 0x53819c
mov dword [esp], edx
call fcn.00606c30
mov dword [ebx + 0x80], 0
mov eax, dword [ebx + 0x3c]
mov dword [ebx + 0x84], 0
mov edx, eax
or edx, 0x88010c
cmp dword [ebx], 5
mov dword [ebx + 0x3c], edx
ja case.0x5381c5.0
mov edx, dword [ebx]
jmp dword [edx*4 + 0x666290]
or eax, 0x88030c
mov dword [ebx + 0x3c], eax
mov dword [esp], 0x10000
call fcn.00606c50
xor edx, edx
xor ecx, ecx
mov dword [ebx + 0x24], eax
mov dword [ebx + 0x28], 0x7fff
mov word [eax], dx
mov word [eax + 2], cx
call dword [sym.imp.USER32.dll_GetForegroundWindow]
mov ebp, dword [ebx + 0x8c]
mov dword [ebx + 0xc], eax
test ebp, ebp
je 0x5387c0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
call edi
mov edx, eax
sub esp, 0x18
cmp edx, dword [0x621ad4]
mov eax, dword [0x621ad0]
jg 0x538820
mov dword [esp + 0x14], edx
mov dword [esp + 8], ebp
xor ebp, ebp
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call edi
mov eax, dword [0x621ad0]
sub esp, 0x18
mov dword [esp + 8], 0xc8
mov dword [esp], 0x622a00
mov dword [esp + 4], eax
call sub.msvcrt.dll_wcsncpy
mov word [0x622b8e], bp
mov ebp, dword [ebx + 0x94]
mov dword [ebx + 0x38], 0x622a00
test ebp, ebp
je 0x5387d5
mov edi, ebp
jmp 0x5382c2
mov edi, edx
mov dword [esp], edi
call sub.msvcrt.dll_strlen
lea edx, [edi + eax + 1]
cmp byte [edx], 0
jne 0x5382c0
lea eax, [edi + eax + 2]
mov dword [esp + 0x14], 0x8000
mov dword [esp + 0x10], 0x622ba0
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
sub eax, ebp
mov dword [esp], 0xfde9
mov dword [esp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebx + 0x14], 0x622ba0
sub esp, 0x18
mov ebp, dword [ebx + 0x9c]
test ebp, ebp
je 0x5383d2
mov dword [esp], ebp
call sub.msvcrt.dll_strlen
cmp eax, dword [ebx + 0x28]
jae 0x538b2f
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
call edi
mov edx, eax
sub esp, 0x18
cmp edx, dword [0x621ad4]
mov eax, dword [0x621ad0]
jg 0x5387f1
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call edi
mov eax, dword [0x621ad0]
sub esp, 0x18
xor edi, edi
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x24]
mov dword [esp], eax
call sub.msvcrt.dll_wcscpy
mov eax, dword [ebx + 0x24]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov edx, dword [ebx + 0x24]
xor ecx, ecx
mov word [edx + eax*2], cx
mov edx, dword [ebx + 0x24]
mov word [edx + eax*2 + 2], di
mov edx, dword [ebx + 0x88]
test edx, edx
je 0x538483
mov dword [esp], 0x10000
call fcn.00606c50
mov ebp, dword [ebx + 0x88]
mov dword [ebx + 0x34], eax
test ebp, ebp
je 0x538a73
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
call edi
mov edx, eax
sub esp, 0x18
cmp edx, dword [0x621ad4]
mov eax, dword [0x621ad0]
jg 0x5388e5
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call edi
mov edx, dword [0x621ad0]
mov eax, dword [ebx + 0x34]
sub esp, 0x18
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_wcscpy
mov dword [esp + 4], 0
mov dword [esp], 0
xor edi, edi
mov ebp, dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
call ebp
sub esp, 8
test eax, eax
je 0x5384c9
mov dword [esp], eax
mov dword [esp + 0x28], eax
call sub.msvcrt.dll_malloc
mov edx, dword [esp + 0x28]
mov edi, eax
mov dword [esp + 4], eax
mov dword [esp], edx
call ebp
sub esp, 8
test eax, eax
je 0x538b59
cmp dword [ebx], 4
mov dword [esp], esi
je 0x5387e1
call dword [sym.imp.COMDLG32.DLL_GetOpenFileNameW]
sub esp, 4
mov esi, eax
call dword [sym.imp.COMDLG32.DLL_CommDlgExtendedError]
test edi, edi
mov ebp, eax
je 0x538500
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
sub esp, 4
mov dword [esp], edi
call fcn.004defc0
test esi, esi
je 0x538760
mov ecx, dword [ebx]
cmp ecx, 5
ja 0x5387ae
mov eax, 1
shl eax, cl
test al, 0x2a
jne case.0x5381c5.1
test al, 0x11
jne 0x538911
test al, 4
je 0x5387ae
mov ebp, dword [ebx + 0x24]
mov dword [esp], ebp
call sub.msvcrt.dll_wcslen
test eax, eax
je 0x5387a0
lea edi, [ebp + eax*2 + 2]
lea esi, [esp + 0x30]
mov eax, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp word [edi], 0
je 0x5387a0
mov dword [esp + 0x28], ebx
mov ebx, eax
jmp 0x5386d4
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call ebx
mov eax, dword [0x621ad8]
sub esp, 0x20
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_strcpy
mov edx, esi
mov ecx, dword [edx]
add edx, 4
lea eax, [ecx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x5385bb
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea ecx, [edx + 2]
cmove edx, ecx
mov ecx, eax
add cl, al
mov eax, 0x5c
sbb edx, 3
mov word [edx], ax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call ebx
mov edx, eax
sub esp, 0x20
cmp edx, dword [0x621adc]
mov eax, dword [0x621ad8]
jle 0x538666
mov eax, dword [0x621ad8]
mov dword [esp + 4], edx
mov dword [0x621adc], edx
mov dword [esp + 0x2c], edx
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov edx, dword [esp + 0x2c]
mov dword [0x621ad8], eax
mov dword [esp + 0x14], edx
mov dword [esp + 8], edi
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call ebx
mov eax, dword [0x621ad8]
sub esp, 0x20
mov dword [esp], esi
mov dword [esp + 4], eax
call sub.msvcrt.dll_strcat
mov ecx, dword [esp + 0x28]
mov dword [esp], esi
call fcn.00537190
sub esp, 4
mov dword [esp], edi
call sub.msvcrt.dll_wcslen
lea edi, [edi + eax*2 + 2]
cmp word [edi], 0
je 0x53879c
test ebp, ebp
je 0x538b68
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call ebx
mov edx, eax
sub esp, 0x20
cmp edx, dword [0x621adc]
mov eax, dword [0x621ad8]
jle 0x538570
mov eax, dword [0x621ad8]
mov dword [esp + 4], edx
mov dword [0x621adc], edx
mov dword [esp + 0x2c], edx
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov edx, dword [esp + 0x2c]
mov dword [0x621ad8], eax
jmp 0x538570
test ebp, ebp
mov esi, 1
jne 0x538850
add esp, 0x803c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
call sub.msvcrt.dll_abort
test byte [ebx + 4], 1
je case.0x5381c5.0
or eax, 0x88010e
mov dword [ebx + 0x3c], eax
jmp case.0x5381c5.0
mov ebx, dword [esp + 0x28]
mov esi, dword [ebx + 0x84]
test esi, esi
je 0x538a7a
add esp, 0x803c
xor esi, esi
pop ebx
mov eax, esi
pop esi
pop edi
pop ebp
ret
mov ebp, dword [ebx + 0x94]
mov dword [ebx + 0x38], 0
test ebp, ebp
jne 0x5382bc
mov dword [ebx + 0x14], 0
jmp 0x538310
call dword [sym.imp.COMDLG32.DLL_GetSaveFileNameW]
sub esp, 4
mov esi, eax
jmp 0x5384e0
lea eax, [edx + edx]
mov dword [0x621ad4], edx
mov dword [esp + 0x28], edx
mov dword [esp + 4], eax
mov eax, dword [0x621ad0]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov edx, dword [esp + 0x28]
mov dword [0x621ad0], eax
jmp 0x538378
lea eax, [edx + edx]
mov dword [0x621ad4], edx
mov dword [esp + 0x28], edx
mov dword [esp + 4], eax
mov eax, dword [0x621ad0]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov edx, dword [esp + 0x28]
mov dword [0x621ad0], eax
jmp 0x538259
lea esi, [esp + 0x30]
mov dword [esp + 8], 0
mov dword [esp + 4], str.CommDlgExtendedError___code_d
mov dword [esp], esi
call sub.msvcrt.dll_sprintf
mov eax, dword [ebx + 0xa0]
test eax, eax
je 0x53887e
mov dword [esp], eax
call fcn.00606c30
mov dword [ebx + 0xa0], 0
mov edx, esi
mov ecx, dword [edx]
add edx, 4
lea eax, [ecx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x53888a
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea ecx, [edx + 2]
cmove edx, ecx
mov ecx, eax
add cl, al
sbb edx, 3
sub edx, esi
add edx, 1
mov dword [esp], edx
call fcn.00606c50
mov dword [esp + 4], esi
mov edi, eax
mov dword [esp], eax
call sub.msvcrt.dll_strcpy
mov esi, 0xffffffff
mov dword [ebx + 0xa0], edi
jmp 0x53876d
lea eax, [edx + edx]
mov dword [0x621ad4], edx
mov dword [esp + 0x28], edx
mov dword [esp + 4], eax
mov eax, dword [0x621ad0]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov edx, dword [esp + 0x28]
mov dword [0x621ad0], eax
jmp 0x538446
mov esi, dword [ebx + 0x24]
test esi, esi
je 0x538bb1
mov eax, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov dword [esp + 0x28], eax
call eax
mov edi, eax
sub esp, 0x20
cmp edi, dword [0x621adc]
mov eax, dword [0x621ad8]
jg 0x538b6f
mov dword [esp + 0x14], edi
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call dword [esp + 0x28]
mov edx, dword [ebx + 0x80]
sub esp, 0x20
mov edi, dword [0x621ad8]
test edx, edx
je 0x538a1b
mov eax, dword [ebx + 0x84]
sub eax, 1
test eax, eax
mov dword [ebx + 0x84], eax
js 0x538a09
lea esi, [edx + eax*4]
mov eax, dword [esi]
test eax, eax
je 0x5389e6
mov dword [esp], eax
call fcn.00606c30
mov dword [esi], 0
mov eax, dword [ebx + 0x84]
mov edx, dword [ebx + 0x80]
sub eax, 1
test eax, eax
mov dword [ebx + 0x84], eax
jns 0x5389d5
test edx, edx
je 0x538a11
mov dword [esp], edx
call fcn.00606c30
mov dword [ebx + 0x80], 0
mov dword [ebx + 0x84], 0
mov dword [esp], 4
call fcn.00606c50
test edi, edi
mov esi, eax
mov dword [ebx + 0x80], eax
je 0x538a60
mov dword [esp], edi
call sub.msvcrt.dll_strlen
add eax, 1
mov dword [esp], eax
call fcn.00606c50
mov ebp, eax
mov dword [esp + 4], edi
mov dword [esp], eax
mov edi, ebp
call sub.msvcrt.dll_strcpy
mov dword [esi], edi
mov dword [ebx + 0x84], 1
xor esi, esi
jmp 0x53876d
xor edx, edx
jmp 0x538477
test ebp, ebp
je 0x538bc2
mov eax, dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
mov dword [esp + 0x28], eax
call eax
mov edi, eax
sub esp, 0x20
cmp edi, dword [0x621adc]
mov eax, dword [0x621ad8]
jg 0x538b90
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call dword [esp + 0x28]
mov eax, dword [0x621ad8]
sub esp, 0x20
mov dword [esp], eax
mov ecx, ebx
call fcn.00537190
sub esp, 4
jmp 0x53876d
mov dword [esp + 8], eax
lea eax, [esp + 0x30]
mov dword [esp + 0xc], 0x8000
mov dword [esp + 4], str.preset_file___filename_is_too_long:__ld_is___ld
mov esi, 0xffffffff
mov dword [esp], eax
call sub.msvcrt.dll_sprintf
jmp 0x53876d
mov dword [esp], edi
xor edi, edi
call fcn.004defc0
jmp 0x5384c9
xor eax, eax
jmp 0x5385ad
mov eax, dword [0x621ad8]
mov dword [esp + 4], edi
mov dword [0x621adc], edi
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov dword [0x621ad8], eax
jmp 0x538978
mov eax, dword [0x621ad8]
mov dword [esp + 4], edi
mov dword [0x621adc], edi
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov dword [0x621ad8], eax
jmp 0x538ade
mov edx, dword [ebx + 0x80]
test edx, edx
je 0x538bc9
xor edi, edi
jmp 0x5389c2
xor eax, eax
jmp 0x538b1d
mov dword [ebx + 0x84], 0
mov dword [esp], 4
xor edi, edi
call fcn.00606c50
mov esi, eax
mov dword [ebx + 0x80], eax
jmp 0x538a60