Function at 0x4d0470
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53766e
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
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 - 0x18], ecx
lea ecx, [ebp - 0x1c]
call fcn.004e1100
mov dword [ebp - 4], 0
call fcn.00401980
xor edx, edx
mov ecx, eax
test ecx, ecx
setne dl
test edx, edx
jne 0x4d04c9
push 0x80004005
call fcn.00401b40
mov eax, dword [ecx]
mov edx, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4d04de
lock inc dword [ecx + 0x14]
lea eax, [ecx + 8]
jmp 0x4d04e0
call edx
lea esi, [eax + 0x10]
mov dword [ebp - 0x14], esi
mov byte [ebp - 4], 1
call fcn.00401980
xor ecx, ecx
mov edx, eax
test edx, edx
setne cl
test ecx, ecx
jne 0x4d0506
push 0x80004005
call fcn.00401b40
mov eax, dword [edx]
mov edi, dword [eax + 0xc]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4d051b
lock inc dword [edx + 0x14]
lea eax, [edx + 8]
jmp 0x4d051f
mov ecx, edx
call edi
add eax, 0x10
mov dword [ebp - 0x24], eax
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], 2
call fcn.004e13e0
mov edi, dword [ebp - 0x24]
test eax, eax
je 0x4d0572
lea ecx, [edi - 0x10]
lea ebx, [esi - 0x10]
cmp ecx, ebx
je 0x4d0589
cmp dword [ebx + 0xc], 0
jl 0x4d0564
mov eax, dword [ecx]
cmp eax, dword [ebx]
jne 0x4d0564
call fcn.004021e0
mov ecx, ebx
mov esi, eax
call fcn.00402e90
add esi, 0x10
mov dword [ebp - 0x14], esi
jmp 0x4d0589
push dword [edi - 0xc]
lea ecx, [ebp - 0x14]
push edi
call fcn.00402d50
jmp 0x4d0586
push dword [ebp - 0x1c]
lea eax, [ebp - 0x14]
push str._sTempTxGameDownload
push eax
call fcn.004023f0
add esp, 0xc
mov esi, dword [ebp - 0x14]
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov ebx, dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
je 0x4d05a1
push esi
call ebx
test eax, eax
jne 0x4d05c2
push ecx
mov ebx, esp
lea ecx, [esi - 0x10]
mov dword [ebp - 0x20], ebx
call fcn.004021e0
add eax, 0x10
mov dword [ebx], eax
call fcn.004e1680
mov ebx, dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
add esp, 4
mov ecx, dword [ebp - 0x18]
push esi
add ecx, 0x24
push str.TEMP
call fcn.004d0ae0
cmp dword [edi - 0xc], 0
lea eax, [ebp - 0x14]
je 0x4d05e4
push edi
push str._sAPK
jmp 0x4d05ec
push dword [ebp - 0x1c]
push str._sTempTxGameDownloadAPK
push eax
call fcn.004023f0
mov esi, dword [ebp - 0x14]
add esp, 0xc
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4d060a
push esi
call ebx
test eax, eax
jne 0x4d0625
push ecx
mov ebx, esp
lea ecx, [esi - 0x10]
mov dword [ebp - 0x20], ebx
call fcn.004021e0
add eax, 0x10
mov dword [ebx], eax
call fcn.004e1680
add esp, 4
mov ecx, dword [ebp - 0x18]
push esi
push str.APKTEMP
lea ecx, [ecx + 0x24]
call fcn.004d0ae0
lea ecx, [edi - 0x10]
mov byte [ebp - 4], 1
or edi, 0xffffffff
mov eax, edi
lock xadd dword [ecx + 0xc], eax
dec eax
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
jg 0x4d0678
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
mov dword [ebp - 0x18], esi
mov esi, dword [ebp - 0x14]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4d0673
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call ebx
jmp 0x4d0678
mov ecx, edx
call dword [ebp - 0x18]
mov byte [ebp - 4], 0
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x4d06a8
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
mov edx, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4d06a6
mov eax, dword [ecx + 4]
push 0
push dword [eax + 4]
call ebx
jmp 0x4d06a8
call edx
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x1c]
add ecx, 0xfffffff0
lock xadd dword [ecx + 0xc], edi
dec edi
test edi, edi
jg 0x4d06de
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4d06da
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call ebx
jmp 0x4d06de
mov ecx, edx
call esi
xor eax, eax
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