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

Disassembly:
sub esp, 0x894
push ebx
push ebp
push esi
call fcn.0045e0e0
mov esi, dword [0x621808]
mov ebp, eax
mov eax, dword [0x628930]
xor ebx, ebx
mov byte [esp + 0x10], bl
mov dword [esp + 0x44], esi
cmp byte [eax + 4], bl
je 0x494742
cmp byte [ebp + 0x440], bl
jne 0x494742
cmp esi, ebx
je 0x49473d
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 0x34]
mov byte [esp + 0x10], 1
push edi
push 1
push ebx
mov ecx, 0x628700
call fcn.005cc7c0
mov eax, dword [ebp]
mov ecx, ebp
call dword [eax + 0x40]
mov edx, dword [ebp]
mov ecx, ebp
call dword [edx + 0x40]
mov ecx, 0x628700
call fcn.005cd000
lea eax, [esp + 0x1a0]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea ecx, [esp + 0x13]
push 8
push ecx
lea ecx, [esp + 0x20]
call fcn.00405da0
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x13]
push eax
lea ecx, [esp + 0x40]
mov byte [edx], bl
call fcn.00405d90
mov edi, str.lastfile
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
add ecx, str.lastfile
push ecx
push str.lastfile
lea ecx, [esp + 0x44]
call fcn.00406380
lea ecx, [esp + 0x15]
push ecx
lea ecx, [esp + 0x34]
call fcn.00405d90
mov edi, str.user
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
add ecx, str.user
push ecx
push str.user
lea ecx, [esp + 0x38]
call fcn.00406380
lea edx, [esp + 0x18]
lea eax, [esp + 0x3c]
push edx
lea ecx, [esp + 0x34]
push eax
lea edx, [esp + 0x2c]
push ecx
push edx
call fcn.00409be0
lea ecx, [esp + 0x28]
add esp, 0x10
cmp eax, ecx
je 0x494830
mov edx, dword [esp + 0x48]
mov ecx, dword [eax + 4]
push edx
mov edx, dword [eax]
push ecx
push edx
lea ecx, [esp + 0x24]
call fcn.00406830
lea ecx, [esp + 0x24]
call fcn.00406010
lea ecx, [esp + 0x30]
call fcn.00406010
lea ecx, [esp + 0x3c]
call fcn.00406010
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x99]
mov byte [esp + 0x98], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0x1c]
mov edi, dword [esp + 0x18]
sub eax, edi
je 0x494899
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x98]
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x48]
mov ecx, 0x13
xor eax, eax
lea edi, [esp + 0x4c]
rep stosd dword es:[edi], eax
mov dword [esp + 0x4c], 0x4c
call fcn.0045e0e0
mov ecx, dword [eax + 0x4c4]
lea edx, [esp + 0x4a4]
push edx
mov dword [esp + 0x54], ecx
call fcn.00494490
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x4a8]
mov dword [esp + 0x5c], eax
mov eax, dword [esp + 0x1c]
add esp, 4
sub ecx, eax
jne 0x494903
lea edx, [esp + 0x2a4]
push edx
call fcn.00494520
add esp, 4
test al, al
je 0x494903
lea eax, [esp + 0x2a4]
mov dword [esp + 0x78], eax
lea edx, [esp + 0x6a4]
lea ecx, [esp + 0x98]
push edx
push 0x135
mov dword [esp + 0x70], ecx
mov dword [esp + 0x74], 0x108
call fcn.0045e0e0
mov ecx, eax
call fcn.00404ab0
mov ecx, dword [0x6285c8]
lea eax, [esp + 0x6a4]
push 1
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], 0x81024
mov dword [esp + 0x8c], 0x610530
mov dword [esp + 0x94], 0x4c1640
mov byte [esp + 0x17], bl
call fcn.005bf7a0
push 1
call fcn.00409a60
add esp, 4
lea ecx, [esp + 0x4c]
mov byte [0x624aec], 1
push ecx
call sub.comdlg32.dll_GetOpenFileNameA
mov edi, eax
mov byte [0x624aec], bl
call fcn.005ef540
push ebx
call fcn.00409a60
mov ecx, dword [0x6285c8]
add esp, 4
push ebx
call fcn.005bf7a0
mov edx, dword [ebp]
mov ecx, ebp
call dword [edx + 0x40]
mov ecx, 0x628700
call fcn.005cd010
lea eax, [esp + 0x1a0]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
cmp edi, ebx
je 0x494b28
lea ecx, [esp + 0x98]
push 0x60ac20
push ecx
call fcn.005f190a
mov edi, eax
add esp, 8
cmp edi, ebx
je 0x494b28
mov ecx, dword [0x621c88]
mov edx, dword [ecx]
call dword [edx + 0x1c]
push edi
call fcn.004951b0
push edi
mov byte [esp + 0x1b], al
call fcn.005f1894
mov al, byte [esp + 0x1b]
add esp, 8
cmp al, bl
je 0x494b28
lea eax, [esp + 0x15]
push ebx
push eax
lea ecx, [esp + 0x34]
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
call fcn.0046fe80
lea edi, [esp + 0x98]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x98]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea ecx, [esp + ecx + 0x98]
push ecx
push edx
lea ecx, [esp + 0x2c]
call fcn.00406380
lea eax, [esp + 0x17]
push ebx
push eax
lea ecx, [esp + 0x40]
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
call fcn.0046fe80
mov edi, str.lastfile
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
add ecx, str.lastfile
push ecx
push str.lastfile
lea ecx, [esp + 0x38]
call fcn.00406380
lea ecx, [esp + 0x16]
push ebx
push ecx
lea ecx, [esp + 0x4c]
mov dword [esp + 0x44], ebx
mov dword [esp + 0x48], ebx
call fcn.0046fe80
mov edi, str.user
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
add ecx, str.user
push ecx
push str.user
lea ecx, [esp + 0x44]
call fcn.00406380
lea edx, [esp + 0x24]
lea eax, [esp + 0x30]
push edx
lea ecx, [esp + 0x40]
push eax
push ecx
call fcn.0040a0b0
add esp, 0xc
lea ecx, [esp + 0x3c]
call fcn.00406010
lea ecx, [esp + 0x30]
call fcn.00406010
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x24]
sub edx, eax
lea ecx, [esp + 0x2c]
push edx
push eax
call fcn.0041d810
mov ecx, dword [0x628930]
call fcn.0049d450
mov ecx, dword [0x628930]
call fcn.0049ce20
mov al, byte [esp + 0x14]
pop edi
cmp al, bl
je 0x494b38
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x38]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
sub ecx, eax
pop esi
pop ebp
cmp eax, ebx
pop ebx
je 0x494b7b
cmp ecx, 0x80
jbe 0x494b65
push eax
call fcn.005f0905
mov al, byte [esp + 7]
add esp, 4
add esp, 0x894
ret
dec ecx
shr ecx, 3
mov edx, dword [ecx*4 + 0x61f1a0]
lea ecx, [ecx*4 + 0x61f1a0]
mov dword [eax], edx
mov dword [ecx], eax
mov al, byte [esp + 3]
add esp, 0x894
ret