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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5249d1
mov eax, dword fs:[0]
push eax
sub esp, 0x21c
mov eax, dword [0x53120c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x224], ecx
call fcn.005048a0
mov ecx, eax
test ecx, ecx
je 0x50de8a
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x21c], eax
push 0x525a80
lea ecx, [ebp - 0x21c]
mov dword [ebp - 4], 0
call fcn.00506850
test al, al
jne 0x50dcae
push 0
push 0x525a80
lea ecx, [ebp - 0x21c]
call fcn.00504b10
push 0x104
lea eax, [ebp - 0x218]
mov dword [ebp - 4], 1
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
or ebx, 0xffffffff
test eax, eax
je 0x50ddfe
lea ecx, [ebp - 0x218]
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x50dce0
sub ecx, edx
lea eax, [ebp - 0x218]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x21c]
call fcn.00504b10
mov esi, dword [ebp - 0x21c]
cmp dword [esi - 0xc], 2
jg 0x50dd25
add esi, 0xfffffff0
push esi
call fcn.00504710
add esp, 4
lea edi, [eax + 0x10]
mov dword [ebp - 0x220], edi
jmp 0x50dd81
mov ecx, dword [esi - 0x10]
test ecx, ecx
je 0x50dd37
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x50dd4d
call fcn.005048a0
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
test ecx, ecx
je 0x50de94
mov eax, dword [ecx]
push 2
push 2
call dword [eax]
test eax, eax
je 0x50de9e
cmp dword [eax + 8], 2
lea edi, [eax + 0x10]
mov dword [ebp - 0x220], edi
jl 0x50de80
mov dword [edi - 0xc], 2
xor eax, eax
mov word [edi + 4], ax
mov eax, dword [esi]
mov dword [edi], eax
lea eax, [ebp - 0x220]
mov byte [ebp - 4], 2
push eax
lea ecx, [ebp - 0x21c]
call fcn.00504340
mov byte [ebp - 4], 1
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x50ddb2
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
push 0x525ab8
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x220]
push eax
call fcn.005043b0
add esp, 0xc
push eax
lea ecx, [ebp - 0x21c]
mov byte [ebp - 4], 3
call fcn.00504340
mov edx, dword [ebp - 0x220]
mov eax, ebx
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x50ddfe
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x21c]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x50de26
push eax
push 0x80
push 4
push eax
push 3
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
push ecx
mov edi, esp
add esi, 0xfffffff0
push esi
mov dword [ebp - 0x228], edi
call fcn.00504710
mov ecx, dword [ebp - 0x224]
add esp, 4
add eax, 0x10
mov dword [edi], eax
call fcn.0050d830
mov dword [ebp - 4], 0xffffffff
lock xadd dword [esi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x50de64
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0050f225
mov esp, ebp
pop ebp
ret
push 0x80070057
call fcn.005046e0
push 0x80004005
call fcn.005046e0
push 0x80004005
call fcn.005046e0
call fcn.00504c80
int3