Function at 0x46f540
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 0x46f549
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
push 0
push 0
push 0
mov eax, 0x4c309c
xor ecx, ecx
mov edx, ebx
call fcn.00462758
test al, al
jne 0x46f588
cmp byte [ebp + 0x14], 0
jne 0x46f82c
push 1
push 0
mov eax, 0x4c309c
mov ecx, esi
mov edx, ebx
call fcn.0046109c
mov edi, eax
cmp edi, 1
je 0x46f612
cmp dword [ebp + 8], 1
jne 0x46f5df
test edi, edi
jne 0x46f5df
mov edx, 0x4a8d68
mov eax, ebx
call fcn.0040bea8
test al, al
jne 0x46f5cb
mov edx, 0x4a8d6c
mov eax, ebx
call fcn.0040bea8
test al, al
je 0x46f5df
mov eax, 0x1fc
call fcn.0041202c
push eax
push ebx
call fcn.00448a00
add esp, 8
cmp dword [ebp + 8], 0
je 0x46f82c
inc edi
jne 0x46f82c
xor edx, edx
mov eax, ebx
call fcn.0040a504
test al, al
je 0x46f82c
mov eax, 0x4af020
mov edx, ebx
call fcn.0042cdb8
jmp 0x46f82c
cmp byte [ebp + 0xc], 0
je 0x46f632
lea edx, [ebp - 0xa0]
mov eax, 0x4c309c
call fcn.004626b8
cmp byte [ebp - 0xa], 0
jne 0x46f82c
cmp byte [ebp + 0x10], 0
je 0x46f6be
mov eax, 0x4c309c
call fcn.004626b0
test eax, eax
je 0x46f6be
push 0
push 0
push 0
lea ecx, [ebp - 0x4a0]
mov eax, 0x4c309c
mov edx, ebx
call fcn.00462758
lea edx, [ebp - 0x4a0]
mov eax, ebx
call fcn.0040ee00
test eax, eax
je 0x46f688
lea ecx, [ebp - 0x4a0]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x46f82c
mov edx, 0x4a8d70
lea eax, [ebp - 0x4a0]
call fcn.0040bd90
lea edx, [ebp - 0x4a0]
mov eax, ebx
call fcn.0040ee00
test eax, eax
je 0x46f6be
lea ecx, [ebp - 0x4a0]
push ecx
call sub.KERNEL32.DLL_GetFileAttributesA
cmp eax, 0xffffffff
jne 0x46f82c
push 0xc30
push 0
lea eax, [ebp - 0x10d0]
push eax
call fcn.00494ce4
add esp, 0xc
lea edx, [ebp - 0x10d0]
mov eax, ebx
call fcn.0040a9a4
call fcn.0040ffc8
test eax, eax
je 0x46f728
test esi, esi
je 0x46f6f4
cmp word [esi], 0
jne 0x46f728
lea edx, [ebp - 0x20d0]
push edx
push 0x800
call sub.KERNEL32.DLL_GetCurrentDirectoryW
lea eax, [ebp - 0x20d0]
call fcn.0040efc4
test al, al
jne 0x46f728
lea esi, [ebp - 0x18d0]
mov ecx, 0x10000000
mov edx, esi
mov eax, ebx
call fcn.00410040
mov eax, esi
call fcn.0040edb0
lea edx, [ebp - 0xcd0]
call fcn.0040a9ec
mov ecx, dword [0x4c32a4]
mov eax, 0x4c309c
mov dword [ebp - 0x4a4], ecx
call fcn.004626b0
test eax, eax
je 0x46f75b
or dword [ebp - 0x4b4], 4
mov edi, dword [ebp - 4]
test edi, edi
jne 0x46f79e
lea eax, [ebp - 0x2570]
call fcn.004137a4
lea eax, [ebp - 0x2544]
call fcn.004137a4
lea eax, [ebp - 0x2518]
call fcn.004137a4
push 0
lea ecx, [ebp - 0x3184]
mov edx, esi
mov eax, ebx
call fcn.004128bc
test al, al
je 0x46f79e
lea edi, [ebp - 0x3184]
test edi, edi
je 0x46f7d2
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 [0x4c563c]
mov eax, dword [ebp - 0x4d0]
mov edx, dword [ebp - 0x4cc]
add dword [0x4c5648], eax
adc dword [0x4c564c], edx
lea edx, [ebp - 0x10d0]
mov eax, dword [ebp + 0x18]
call fcn.0046b778
mov ebx, eax
mov eax, 0x35c
inc ebx
push ebx
call fcn.0041202c
push eax
lea edx, [ebp - 0x3284]
push edx
call fcn.00497dc4
add esp, 0xc
lea edx, [ebp - 0x3284]
mov eax, 0x4c28c4
call fcn.004494f8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14