Function at 0x4e71c0
Capabilities:
Check if file exists
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x539000
mov eax, dword fs:[0]
push eax
sub esp, 0x28
mov eax, dword [0x59a0a0]
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 - 0x30], ecx
call fcn.00401980
xor edx, edx
mov ecx, eax
test ecx, ecx
setne dl
test edx, edx
jne 0x4e720a
push 0x80004005
call fcn.00401b40
mov eax, dword [ecx]
mov edx, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4e721f
lock inc dword [ecx + 0x14]
lea eax, [ecx + 8]
jmp 0x4e7221
call edx
lea esi, [eax + 0x10]
mov dword [ebp - 0x2c], esi
push 0
push 0
push 0x55e274
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ebx, eax
test ebx, ebx
je 0x4e742a
lea edi, [ebx + 1]
test edi, edi
jns 0x4e7258
push 0x80070057
call fcn.00401b40
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x4e7275
push edi
lea ecx, [ebp - 0x2c]
call fcn.00402c70
mov esi, dword [ebp - 0x2c]
cmp edi, dword [esi - 8]
jg 0x4e724e
push ebx
push esi
xor eax, eax
mov dword [esi - 0xc], edi
push str._Temp_
mov word [esi + edi*2], ax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push dword [esi - 8]
push esi
call fcn.004a4fb5
add esp, 8
test eax, eax
js 0x4e724e
cmp eax, dword [esi - 8]
jg 0x4e724e
xor ecx, ecx
mov dword [esi - 0xc], eax
push ecx
push ecx
push esi
mov word [esi + eax*2], cx
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
mov ebx, eax
mov dword [ebp - 0x28], ebx
test ebx, ebx
je 0x4e742a
call fcn.00401980
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x4e72e0
push 0x80004005
call fcn.00401b40
mov eax, dword [edx]
mov edi, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4e72f5
lock inc dword [edx + 0x14]
lea eax, [edx + 8]
jmp 0x4e72f9
mov ecx, edx
call edi
lea edi, [eax + 0x10]
mov dword [ebp - 0x24], edi
add ebx, 1
mov byte [ebp - 4], 1
jns 0x4e7312
push 0x80070057
call fcn.00401b40
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, ebx
or eax, ecx
jge 0x4e732f
push ebx
lea ecx, [ebp - 0x24]
call fcn.00402c70
mov edi, dword [ebp - 0x24]
cmp ebx, dword [edi - 8]
jg 0x4e724e
push dword [ebp - 0x28]
xor eax, eax
mov dword [edi - 0xc], ebx
push edi
push esi
mov word [edi + ebx*2], ax
call dword [sym.imp.KERNEL32.dll_GetLongPathNameW]
push dword [edi - 8]
push edi
call fcn.004a4fb5
add esp, 8
test eax, eax
js 0x4e724e
cmp eax, dword [edi - 8]
jg 0x4e724e
xor ecx, ecx
mov dword [edi - 0xc], eax
mov word [edi + eax*2], cx
lea ebx, [edi - 0x10]
lea ecx, [esi - 0x10]
mov dword [ebp - 0x28], ecx
cmp ebx, ecx
je 0x4e73f6
cmp dword [ecx + 0xc], 0
lea esi, [ecx + 0xc]
jl 0x4e73e7
mov eax, dword [ebx]
cmp eax, dword [ecx]
jne 0x4e73e7
mov ecx, ebx
call fcn.004021e0
mov dword [ebp - 0x34], eax
or ecx, 0xffffffff
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x4e73d6
mov edx, dword [ebp - 0x28]
push edx
mov esi, dword [edx]
mov ecx, dword [esi]
mov edi, dword [ecx + 4]
cmp ecx, vtable.ATL::CAtlStringMgr.0
jne 0x4e73d2
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
push 0
push dword [eax + 4]
call edi
mov esi, dword [ebp - 0x34]
add esi, 0x10
mov dword [ebp - 0x2c], esi
jmp 0x4e73fc
mov ecx, esi
call edi
mov esi, dword [ebp - 0x34]
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
add esi, 0x10
mov dword [ebp - 0x2c], esi
jmp 0x4e73fc
push dword [edi - 0xc]
lea ecx, [ebp - 0x2c]
push edi
call fcn.00402d50
mov esi, dword [ebp - 0x2c]
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov byte [ebp - 4], 0
or eax, 0xffffffff
lock xadd dword [ebx + 0xc], eax
dec eax
test eax, eax
jg 0x4e742a
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4e7428
mov eax, dword [ecx + 4]
push 0
push dword [eax + 4]
call edi
jmp 0x4e742a
call edx
call fcn.00401980
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x4e7446
push 0x80004005
call fcn.00401b40
mov eax, dword [edx]
mov edi, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4e745b
lock inc dword [edx + 0x14]
lea eax, [edx + 8]
jmp 0x4e745f
mov ecx, edx
call edi
add eax, 0x10
mov dword [ebp - 0x28], eax
push esi
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 2
push str._sGameDownloadLog
push eax
call fcn.004023f0
mov ebx, dword [ebp - 0x28]
add esp, 0xc
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4e7494
push ebx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x4e74af
push ecx
mov edi, esp
lea ecx, [ebx - 0x10]
mov dword [ebp - 0x34], edi
call fcn.004021e0
add eax, 0x10
mov dword [edi], eax
call fcn.004e1680
add esp, 4
xor eax, eax
xorps xmm0, xmm0
mov word [ebp - 0x20], ax
mov dword [ebp - 0x16], eax
mov word [ebp - 0x12], ax
lea eax, [ebp - 0x20]
push eax
movq qword [ebp - 0x1e], xmm0
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
call fcn.00401980
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x4e74ea
push 0x80004005
call fcn.00401b40
mov eax, dword [edx]
mov edi, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4e74ff
lock inc dword [edx + 0x14]
lea eax, [edx + 8]
jmp 0x4e7503
mov ecx, edx
call edi
add eax, 0x10
mov dword [ebp - 0x24], eax
mov byte [ebp - 4], 3
movzx eax, word [ebp - 0x12]
push eax
movzx eax, word [ebp - 0x14]
push eax
movzx eax, word [ebp - 0x16]
push eax
movzx eax, word [ebp - 0x18]
push eax
movzx eax, word [ebp - 0x1a]
push eax
movzx eax, word [ebp - 0x1e]
push eax
movzx eax, word [ebp - 0x20]
push eax
push ebx
lea eax, [ebp - 0x24]
push str._s_04d_02d_02d__02d_02d_02d__03d.log
push eax
call fcn.004023f0
mov eax, dword [ebp - 0x30]
add esp, 0x28
mov edi, dword [ebp - 0x24]
mov ecx, dword [eax + 0x20]
test ecx, ecx
je 0x4e7567
push ecx
push 0x80
push 2
sub esp, 8
push 0x40000000
push edi
call fcn.00405420
jmp 0x4e7580
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x4e758c
call fcn.004054a0
jmp 0x4e7592
mov ecx, dword [ebp - 0x30]
mov dword [ecx + 0x1c], eax
push str.Log_Begin.
push dword [ebp - 0x30]
call fcn.004e76a0
add esp, 8
mov byte [ebp - 4], 2
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x4e75d7
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4e75d5
mov eax, dword [ecx + 4]
push 0
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4e75d7
call edx
or edi, 0xffffffff
mov byte [ebp - 4], 0
add ebx, 0xfffffff0
mov eax, edi
lock xadd dword [ebx + 0xc], eax
dec eax
test eax, eax
jg 0x4e7610
mov ecx, dword [ebx]
push ebx
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4e760e
mov eax, dword [ecx + 4]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
push 0
push dword [eax + 4]
call ebx
jmp 0x4e7616
call edx
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x4e7647
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4e7645
mov eax, dword [ecx + 4]
push 0
push dword [eax + 4]
call ebx
jmp 0x4e7647
call edx
mov eax, 1
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.0049aa22
mov esp, ebp
pop ebp
ret