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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x904
mov eax, dword [0x436680]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [esi]
push ebx
xor ebx, ebx
cmp byte [eax + 0x485c], bl
jne 0x4137b1
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00418429
mov esp, ebp
pop ebp
ret
push edi
push 0xff
lea ecx, [ebp - 0x103]
push ebx
push ecx
mov byte [ebp - 0x104], bl
call fcn.00421c00
add esp, 0xc
lea edx, [ebp - 0x104]
push edx
push 0xff
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov eax, dword [esi]
mov dword [eax], 0x58
mov eax, dword [esi]
lea ecx, [eax + 0x58]
mov dword [eax + 0x2c], ecx
mov eax, dword [esi]
mov edx, dword [eax + 0x4858]
mov byte [edx + eax + 0x1858], bl
mov eax, dword [esi]
mov ecx, 1
add dword [eax + 0x4858], ecx
mov eax, dword [esi]
mov edx, dword [eax + 0x4858]
mov byte [edx + eax + 0x1858], bl
mov eax, dword [esi]
add dword [eax + 0x4858], ecx
mov eax, dword [esi]
lea ecx, [eax + 0x1858]
mov dword [eax + 0xc], ecx
mov eax, dword [esi]
lea edx, [eax + 0x1058]
mov dword [eax + 0x1c], edx
mov eax, dword [esi]
mov edi, 0x7ff
mov dword [eax + 0x20], edi
mov eax, dword [esi]
lea ecx, [eax + 0x3058]
mov dword [eax + 0x24], ecx
mov edx, dword [esi]
mov dword [edx + 0x28], edi
mov eax, dword [esi]
lea ecx, [eax + 0x858]
mov dword [eax + 0x30], ecx
mov edx, dword [esi]
mov dword [edx + 0x34], 0x1800
mov eax, dword [esi]
push eax
call dword [sym.imp.COMDLG32.dll_GetOpenFileNameA]
test eax, eax
jne 0x413892
lea ecx, [ebp - 0x104]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
pop edi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00418429
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x104]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [esi]
mov ecx, dword [eax + 0x1c]
push ecx
add eax, 0x2058
push eax
mov edx, edi
call fcn.004139e0
mov eax, dword [esi]
mov edx, dword [eax + 0x1c]
push edx
add eax, 0x4058
push 0x4311f8
push eax
mov edx, edi
call fcn.004139e0
mov ecx, dword [esi]
lea eax, [ecx + 0x4058]
add esp, 0x14
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
cmp dl, bl
jne 0x4138d8
sub eax, edi
dec eax
cmp eax, ebx
jl 0x4138fc
cmp byte [ecx + eax + 0x4058], 0x5c
je 0x4138f5
dec eax
jns 0x4138e6
jmp 0x4138fc
mov byte [ecx + eax + 0x4059], bl
mov eax, dword [esi]
lea ecx, [eax + 0x3058]
push ecx
add eax, 0x2858
push 0x4311f8
push eax
mov edx, 0x7ff
call fcn.004139e0
mov edi, dword [esi]
lea eax, [edi + 0x2858]
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x413928
sub eax, edx
dec eax
cmp eax, ebx
jle 0x413950
cmp byte [edi + eax + 0x2858], 0x2e
je 0x413947
dec eax
cmp eax, ebx
jg 0x413936
jmp 0x413950
mov ecx, edi
mov byte [ecx + eax + 0x2858], bl
push 0x7ff
lea edx, [ebp - 0x903]
push ebx
push edx
mov byte [ebp - 0x904], bl
call fcn.00421c00
mov eax, dword [esi]
add eax, 0x3058
push eax
lea ecx, [ebp - 0x904]
push 0x4311f8
push ecx
mov edx, 0x7ff
call fcn.004139e0
mov ecx, dword [esi]
lea eax, [ecx + 0x2858]
add esp, 0x18
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
cmp dl, bl
jne 0x413994
sub eax, edi
lea edx, [ebp + eax - 0x903]
push edx
add ecx, 0x3858
push 0x4311f8
push ecx
mov edx, 0x7ff
call fcn.004139e0
mov eax, dword [esi]
mov ecx, dword [ebp - 4]
add esp, 0xc
mov byte [eax + 0x485c], bl
pop edi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.00418429
mov esp, ebp
pop ebp
ret