Function at 0x4653a8
Capabilities:
Check if file exists
Get common file path
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push eax
mov eax, 3
add esp, 0xfffff004
push eax
dec eax
jne 0x4653b1
mov eax, dword [ebp - 4]
add esp, 0xfffffd80
push ebx
push esi
push edi
mov dword [ebp - 4], ecx
mov esi, edx
mov ebx, eax
test ebx, ebx
je 0x4653e4
push ebx
call fcn.00498eac
pop ecx
cmp eax, 0x400
jae 0x4656be
test esi, esi
je 0x4653fa
mov eax, esi
call fcn.00410af4
cmp eax, 0x400
jge 0x4656be
push 0
push 0
push 0
push 1
mov eax, 0x4c7c4c
xor ecx, ecx
mov edx, ebx
call fcn.00457e58
test al, al
jne 0x46541e
cmp byte [ebp + 0x14], 0
jne 0x4656be
push 1
push 0
mov eax, 0x4c7c4c
mov ecx, esi
mov edx, ebx
call fcn.004567bc
mov edi, eax
cmp edi, 1
je 0x4654a2
cmp dword [ebp + 8], 1
jne 0x46546f
test edi, edi
jne 0x46546f
push 0
push 1
push 0
push 0
mov eax, 0x4c7c4c
xor ecx, ecx
mov edx, ebx
call fcn.00457e58
test al, al
je 0x46546f
mov eax, 0x1fc
call fcn.004129c8
push eax
push ebx
call fcn.0047dfcc
add esp, 8
cmp dword [ebp + 8], 0
je 0x4656be
inc edi
jne 0x4656be
xor edx, edx
mov eax, ebx
call fcn.0040a838
test al, al
je 0x4656be
mov eax, 0x4b3b9c
mov edx, ebx
call fcn.0042db14
jmp 0x4656be
cmp byte [ebp + 0xc], 0
je 0x4654c2
lea edx, [ebp - 0xa0]
mov eax, 0x4c7c4c
call fcn.00457db0
cmp byte [ebp - 0xa], 0
jne 0x4656be
cmp byte [ebp + 0x10], 0
je 0x465550
mov eax, 0x4c7c4c
call fcn.00457da8
test eax, eax
je 0x465550
push 0
push 0
push 0
push 1
lea ecx, [ebp - 0x4a0]
mov eax, 0x4c7c4c
mov edx, ebx
call fcn.00457e58
lea edx, [ebp - 0x4a0]
mov eax, ebx
call fcn.0040f55c
test eax, eax
je 0x46551a
lea ecx, [ebp - 0x4a0]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x4656be
mov edx, 0x4ac000
lea eax, [ebp - 0x4a0]
call fcn.0040c18c
lea edx, [ebp - 0x4a0]
mov eax, ebx
call fcn.0040f55c
test eax, eax
je 0x465550
lea ecx, [ebp - 0x4a0]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x4656be
push 0xc30
push 0
lea eax, [ebp - 0x10d0]
push eax
call fcn.00498cfc
add esp, 0xc
lea edx, [ebp - 0x10d0]
mov eax, ebx
call fcn.0040acd8
call fcn.004107bc
test eax, eax
je 0x4655ba
test esi, esi
je 0x465586
cmp word [esi], 0
jne 0x4655ba
lea edx, [ebp - 0x20d0]
push edx
push 0x800
call sub.KERNEL32.DLL_GetCurrentDirectoryW
lea eax, [ebp - 0x20d0]
call fcn.0040f748
test al, al
jne 0x4655ba
lea esi, [ebp - 0x18d0]
mov ecx, 0x1000000
mov edx, esi
mov eax, ebx
call fcn.00410844
mov eax, esi
call fcn.0040f50c
lea edx, [ebp - 0xcd0]
call fcn.0040ad28
mov ecx, dword [0x4c7e54]
mov eax, 0x4c7c4c
mov dword [ebp - 0x4a4], ecx
call fcn.00457da8
test eax, eax
je 0x4655ed
or dword [ebp - 0x4b4], 4
mov edi, dword [ebp - 4]
test edi, edi
jne 0x465630
lea eax, [ebp - 0x2570]
call fcn.004141d8
lea eax, [ebp - 0x2544]
call fcn.004141d8
lea eax, [ebp - 0x2518]
call fcn.004141d8
push 0
lea ecx, [ebp - 0x3184]
mov edx, esi
mov eax, ebx
call fcn.00413298
test al, al
je 0x465630
lea edi, [ebp - 0x3184]
test edi, edi
je 0x465664
mov eax, dword [edi + 0xc00]
mov dword [ebp - 0x4d0], eax
mov eax, dword [edi + 0xc04]
mov dword [ebp - 0x4cc], eax
mov edx, dword [edi + 0x10a8]
mov dword [ebp - 0x4bc], edx
mov edx, dword [edi + 0x10ac]
mov dword [ebp - 0x4b8], edx
inc dword [0x4ca1e4]
mov eax, dword [ebp - 0x4d0]
mov edx, dword [ebp - 0x4cc]
add dword [0x4ca1f0], eax
adc dword [0x4ca1f4], edx
lea edx, [ebp - 0x10d0]
mov eax, dword [ebp + 0x18]
call fcn.00461080
mov ebx, eax
mov eax, 0x35c
inc ebx
push ebx
call fcn.004129c8
push eax
lea edx, [ebp - 0x3284]
push edx
call fcn.0049bdcc
add esp, 0xc
lea edx, [ebp - 0x3284]
mov eax, 0x4c7470
call fcn.0047d5e0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14