Function at 0x409658
Capabilities:
Get common file path

Disassembly:
sub esp, 4
push ebp
push edi
push esi
push ebx
xor ebp, ebp
mov esi, dword [esp + 0x18]
mov dword [esp + 0x10], 1
test esi, esi
je 0x409773
cmp byte [esi], 0
je 0x409773
mov eax, esi
mov ebx, esi
and eax, 3
je 0x40969d
jp 0x409698
cmp eax, 2
je 0x409693
cmp byte [ebx], ah
je 0x4096c1
inc ebx
cmp byte [ebx], ah
je 0x4096c1
inc ebx
cmp byte [ebx], ah
je 0x4096c1
inc ebx
mov eax, dword [ebx]
test al, ah
jne 0x4096ab
test al, al
je 0x4096c1
test ah, ah
je 0x4096c0
test eax, 0xff0000
je 0x4096bf
add ebx, 4
test eax, 0xff000000
jne 0x40969d
sub ebx, 3
inc ebx
inc ebx
mov edx, ebx
dec ebx
mov al, byte [ebx]
cmp al, 0x20
je 0x4096d6
cmp al, 0x22
je 0x4096d6
add al, 0xd0
cmp al, 9
ja 0x4096da
mov edx, ebx
cmp ebx, esi
jae 0x4096c3
push edx
call sub.crtdll.dll_atoi
mov ebp, eax
mov byte [ebx + 1], 0
mov edx, 0x41c9b0
add esp, 4
mov ebx, esi
mov cl, byte [ebx]
inc ebx
cmp cl, 0x22
je 0x4096fb
mov byte [edx], cl
inc edx
test cl, cl
jne 0x4096f0
push 0x41c9b0
push 0x41cf3c
call sub.crtdll.dll_strcpy
push 0x5c
push 0x41cf3c
call sub.crtdll.dll_strrchr
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x40974d
lea esi, [ebx + 1]
push esi
push 0x41cab4
call sub.crtdll.dll_strcpy
add esp, 8
cmp ebx, 0x41cf3c
je 0x409746
cmp byte [ebx - 1], 0x3a
jne 0x409926
mov ebx, esi
jmp 0x409926
push 0x41c9b0
push 0x41cab4
call sub.crtdll.dll_strcpy
push 0x41cf3c
push 0x104
call sub.kernel32.dll_GetCurrentDirectoryA
add esp, 8
jmp 0x409929
push 0x41cab4
push 0x41c9b0
call sub.crtdll.dll_strcpy
mov eax, dword [0x41e2a4]
add esp, 8
mov dword [0x41d084], eax
cmp dword [esp + 0x1c], 1
jne 0x4097ab
mov eax, 0x1d
cmp dword [0x41dee0], 0
je 0x4097be
mov eax, 0x1e
jmp 0x4097be
mov eax, 0x54
cmp dword [0x41dee0], 0
je 0x4097be
mov eax, 0x55
push pe_nt_image_headers32
push 0x41cbb4
push eax
mov eax, dword [0x41db78]
push eax
call sub.user32.dll_LoadStringA
dec eax
mov edx, 0x41cbb4
mov cl, byte [eax + edx]
test eax, eax
jl 0x4097ee
add edx, eax
cmp byte [edx], cl
jne 0x4097ea
mov byte [edx], 0
dec edx
dec eax
jns 0x4097e3
cmp dword [esp + 0x1c], 0
jne 0x409812
mov dword [0x41d0b4], 0x201814
push 0x41d080
call sub.comdlg32.dll_GetOpenFileNameA
mov dword [esp + 0x10], eax
jmp 0x4098f7
cmp dword [esp + 0x1c], 1
jne 0x4098c6
mov eax, 0x41c9b0
mov ecx, eax
mov edx, eax
and ecx, 3
je 0x409841
jp 0x40983c
cmp ecx, 2
je 0x409837
cmp byte [edx], ch
je 0x409867
inc edx
cmp byte [edx], ch
je 0x409867
inc edx
cmp byte [edx], ch
je 0x409867
inc edx
mov ecx, dword [edx]
test cl, ch
jne 0x40984f
test cl, cl
je 0x409867
test ch, ch
je 0x409866
test ecx, 0xff0000
je 0x409865
add edx, 4
test ecx, 0xff000000
jne 0x409841
sub edx, 3
inc edx
inc edx
sub edx, eax
lea eax, [edx - 4]
test eax, eax
jl 0x4098ac
push 0x426515
mov ebx, eax
add ebx, 0x41c9b0
push ebx
call sub.crtdll.dll__stricmp
add esp, 8
test eax, eax
jne 0x4098ac
push 0x42650f
push ebx
call sub.crtdll.dll_strcpy
add esp, 8
mov dword [0x41cc34], 2
mov dword [0x41d098], 2
mov dword [0x41d0b4], 0x208014
push 0x41d080
call sub.comdlg32.dll_GetSaveFileNameA
mov dword [esp + 0x10], eax
jmp 0x4098f7
mov dword [0x41d0b4], 0x280314
push 0x104
push 0
push 0x41c9b0
call sub.crtdll.dll_memset
push 0x41d080
call sub.comdlg32.dll_GetOpenFileNameA
mov dword [esp + 0x1c], eax
add esp, 0xc
jmp 0x409a71
cmp dword [esp + 0x10], 0
je 0x409a6d
push 0x41c9b0
push 0x41cf3c
call sub.crtdll.dll_strcpy
push 0x5c
push 0x41cf3c
call sub.crtdll.dll_strrchr
mov ebx, eax
add esp, 0x10
test ebx, ebx
je 0x409929
mov byte [ebx], 0
cmp dword [esp + 0x10], 0
je 0x409a6d
call fcn.004095b0
mov eax, 0x41cab4
mov ecx, eax
mov edx, eax
and ecx, 3
je 0x40995d
jp 0x409958
cmp ecx, 2
je 0x409953
cmp byte [edx], ch
je 0x409983
inc edx
cmp byte [edx], ch
je 0x409983
inc edx
cmp byte [edx], ch
je 0x409983
inc edx
mov ecx, dword [edx]
test cl, ch
jne 0x40996b
test cl, cl
je 0x409983
test ch, ch
je 0x409982
test ecx, 0xff0000
je 0x409981
add edx, 4
test ecx, 0xff000000
jne 0x40995d
sub edx, 3
inc edx
inc edx
sub edx, eax
mov dword [0x41cc34], 1
lea eax, [edx - 4]
test eax, eax
jl 0x4099df
push 0x42650f
mov ebx, eax
add ebx, 0x41cab4
push ebx
call sub.crtdll.dll__stricmp
add esp, 8
test eax, eax
jne 0x4099bc
mov dword [0x41cc34], 2
jmp 0x4099df
cmp dword [esp + 0x1c], 1
je 0x4099df
push 0x426515
push ebx
call sub.crtdll.dll__stricmp
add esp, 8
test eax, eax
jne 0x4099df
mov dword [0x41cc34], 3
mov eax, dword [0x41cc34]
mov dword [0x41d098], eax
cmp eax, 1
jle 0x409a5e
push 0x41cab4
push 0x41cc38
call sub.crtdll.dll_strcmp
add esp, 8
test eax, eax
jne 0x409a16
mov eax, dword [0x426998]
test eax, eax
jle 0x409a40
neg eax
mov dword [0x426998], eax
jmp 0x409a40
mov dword [0x426998], 0
cmp dword [0x423d78], 0
jne 0x409a40
cmp dword [0x41c5c0], 0
je 0x409a3b
cmp dword [0x41c578], 0
jne 0x409a40
call fcn.004181a8
push 0x41cab4
push 0x41cc38
call sub.crtdll.dll_strcpy
add esp, 8
test ebp, ebp
je 0x409a6d
mov dword [0x426998], ebp
jmp 0x409a6d
mov dword [0x426998], 0
call fcn.00417140
mov eax, dword [esp + 0x10]
pop ebx
pop esi
pop edi
pop ebp
add esp, 4
ret