Function at 0x40cf70
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x496090
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4bd750]
xor eax, esp
push eax
lea eax, [esp + 0x28]
mov dword fs:[0], eax
mov edi, dword [esp + 0x3c]
push str.Patch_Step_1___DownloadPatch_Start
call fcn.004169a0
add esp, 4
call fcn.0045be93
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40cfc2
push 0x80004005
call fcn.00401c80
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x20], eax
push edi
lea ecx, [esp + 0x24]
push str._08d
push ecx
mov dword [esp + 0x3c], 0
call fcn.00401850
mov ebx, dword [esp + 0x2c]
add esp, 0xc
cmp dword [ebx - 4], 1
jle 0x40d008
mov edx, dword [ebx - 0xc]
push edx
lea ecx, [esp + 0x24]
call fcn.00401b60
mov ebx, dword [esp + 0x20]
push ebx
push str.Download_Patch_Version___s_
call fcn.004169a0
add esp, 8
call fcn.0045be93
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40d030
push 0x80004005
call fcn.00401c80
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
mov byte [esp + 0x30], 1
call fcn.00406040
lea esi, [esp + 0x24]
call fcn.00413c30
mov byte [esp + 0x30], 2
mov eax, dword [eax]
mov ecx, dword [eax - 0xc]
push ecx
push eax
lea ecx, [esp + 0x1c]
call fcn.0040bc50
mov byte [esp + 0x30], 1
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d08d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebx - 0xc]
push eax
push ebx
lea ecx, [esp + 0x1c]
call fcn.0040bc50
push 1
push 0x4abc44
lea ecx, [esp + 0x1c]
call fcn.0040bc50
call fcn.0045be93
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40d0c5
push 0x80004005
call fcn.00401c80
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
mov byte [esp + 0x30], 3
call fcn.0045be93
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40d0f4
push 0x80004005
call fcn.00401c80
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov byte [esp + 0x30], 4
mov ebp, dword [esp + 0x14]
mov esi, 1
cmp dword [ebp - 4], esi
jle 0x40d128
mov ecx, dword [ebp - 0xc]
push ecx
lea ecx, [esp + 0x18]
call fcn.00401b60
mov ebp, dword [esp + 0x14]
push edi
push ebp
lea edx, [esp + 0x24]
push 0x4abc48
push edx
call fcn.00401850
push edi
lea eax, [esp + 0x2c]
push str.Patch_08d.pak
push eax
call fcn.00401850
mov ebx, dword [esp + 0x38]
add esp, 0x1c
cmp dword [ebx - 4], esi
jle 0x40d166
mov ecx, dword [ebx - 0xc]
push ecx
lea ecx, [esp + 0x20]
call fcn.00401b60
mov ebx, dword [esp + 0x1c]
push ebx
call dword [sym.imp.WININET.dll_DeleteUrlCacheEntryW]
call fcn.00406040
lea esi, [esp + 0x24]
call fcn.00413c50
mov esi, eax
mov byte [esp + 0x30], 5
mov edi, dword [esp + 0x18]
cmp dword [edi - 4], 1
jle 0x40d19d
mov edx, dword [edi - 0xc]
push edx
lea ecx, [esp + 0x1c]
call fcn.00401b60
mov edi, dword [esp + 0x18]
mov eax, dword [esi]
sub eax, 0x10
cmp dword [eax + 0xc], 1
jle 0x40d1b3
mov eax, dword [eax + 4]
push eax
mov ecx, esi
call fcn.00401b60
cmp dword [ebx - 4], 1
mov esi, dword [esi]
jle 0x40d1cc
mov ecx, dword [ebx - 0xc]
push ecx
lea ecx, [esp + 0x20]
call fcn.00401b60
mov ebx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x38]
push 0
push 0
push 0
push edi
push esi
mov edx, ebx
call fcn.0040d770
mov esi, eax
mov byte [esp + 0x30], 4
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d206
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
test esi, esi
je 0x40d2e3
mov ecx, dword [esp + 0x3c]
push ecx
push ecx
lea edi, [ebp - 0x10]
mov dword [esp + 0x2c], esp
mov esi, esp
push edi
call fcn.004017d0
mov edx, dword [esp + 0x44]
add esp, 4
add eax, 0x10
push edx
mov dword [esi], eax
call fcn.00410fa0
test eax, eax
je 0x40d2df
push str.Download_Failed_
xor esi, esi
call fcn.00416940
mov byte [esp + 0x34], 3
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
add esp, 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d271
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebx - 0x10]
mov byte [esp + 0x30], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d292
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], 0
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d2b0
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov dword [esp + 0x30], 0xffffffff
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d2d8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x40d74e
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x38]
mov eax, dword [esi + 0x30]
add esi, 0x30
sub eax, 0x10
cmp dword [eax + 0xc], 1
jle 0x40d301
mov ecx, dword [eax + 4]
push ecx
mov ecx, esi
call fcn.00401b60
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40d3d1
mov eax, dword [esi]
sub eax, 0x10
cmp dword [eax + 0xc], 1
jle 0x40d329
mov edx, dword [eax + 4]
push edx
mov ecx, esi
call fcn.00401b60
mov esi, dword [esi]
push esi
push str.Failed__GetFileAttributes__s_
xor esi, esi
call fcn.00416940
lea eax, [edi - 0x10]
add esp, 8
mov byte [esp + 0x30], 3
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d35c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebx - 0x10]
mov byte [esp + 0x30], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d37d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], 0
lea eax, [ebp - 0x10]
or edx, 0xffffffff
lea ecx, [eax + 0xc]
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d39e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x30], 0xffffffff
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d2d8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x40d74e
push str.Download_txt_File
call fcn.004169a0
add esp, 4
call fcn.0045be93
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40d3f8
push 0x80004005
call fcn.00401c80
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x24], eax
mov bl, 6
mov byte [esp + 0x30], bl
cmp dword [ebp - 4], 1
jle 0x40d425
mov ecx, dword [ebp - 0xc]
push ecx
lea ecx, [esp + 0x18]
call fcn.00401b60
mov ebp, dword [esp + 0x14]
mov edi, dword [esp + 0x3c]
push edi
push ebp
lea edx, [esp + 0x2c]
push str._sPatch_08d.txt
push edx
call fcn.00401850
add esp, 0x10
call fcn.00406040
lea esi, [esp + 0x3c]
call fcn.00413c50
mov esi, eax
mov byte [esp + 0x30], 7
mov eax, dword [esi]
sub eax, 0x10
cmp dword [eax + 0xc], 1
jle 0x40d468
mov eax, dword [eax + 4]
push eax
mov ecx, esi
call fcn.00401b60
mov eax, dword [esi]
mov esi, dword [esp + 0x38]
push edi
push eax
add esi, 0x34
push str._sPatch_08d.txt
push esi
call fcn.00401850
mov byte [esp + 0x40], bl
mov eax, dword [esp + 0x4c]
add eax, 0xfffffff0
add esp, 0x10
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d4a5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [esp + 0x24]
mov ebx, 1
cmp dword [edi - 4], ebx
jle 0x40d4c4
mov ecx, dword [edi - 0xc]
push ecx
lea ecx, [esp + 0x28]
call fcn.00401b60
mov edi, dword [esp + 0x24]
push edi
call dword [sym.imp.WININET.dll_DeleteUrlCacheEntryW]
mov eax, dword [esi]
sub eax, 0x10
cmp dword [eax + 0xc], ebx
jle 0x40d4e0
mov edx, dword [eax + 4]
push edx
mov ecx, esi
call fcn.00401b60
cmp dword [edi - 4], ebx
mov ebp, dword [esi]
jle 0x40d4f8
mov eax, dword [edi - 0xc]
push eax
lea ecx, [esp + 0x28]
call fcn.00401b60
mov edi, dword [esp + 0x24]
push ebp
mov ecx, edi
call fcn.00415580
add esp, 4
test eax, eax
je 0x40d593
push str.Download_txt_File_Failed_
call fcn.004169a0
lea eax, [edi - 0x10]
add esp, 4
mov byte [esp + 0x30], 4
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d539
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], 3
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d55e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], bl
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d582
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], 0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
jmp 0x40d385
push str.Download_txt_File_Success
call fcn.004169a0
mov eax, dword [esi]
sub eax, 0x10
add esp, 4
cmp dword [eax + 0xc], ebx
jle 0x40d5b5
mov ecx, dword [eax + 4]
push ecx
mov ecx, esi
call fcn.00401b60
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
or ebp, 0xffffffff
cmp eax, ebp
jne 0x40d693
mov eax, dword [esi]
sub eax, 0x10
cmp dword [eax + 0xc], ebx
jle 0x40d5de
mov edx, dword [eax + 4]
push edx
mov ecx, esi
call fcn.00401b60
mov esi, dword [esi]
push esi
push str.Failed__GetFileAttributes__s_
call fcn.004169a0
lea eax, [edi - 0x10]
add esp, 8
mov byte [esp + 0x30], 4
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d60e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], 3
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d632
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], bl
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d655
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], 0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d679
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jmp 0x40d2cc
push str.Patch_Step_1___DownloadPatch_End
call fcn.004169a0
lea eax, [edi - 0x10]
add esp, 4
mov byte [esp + 0x30], 4
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d6c0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], 3
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d6e4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], bl
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d707
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x30], 0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d72b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x30], ebp
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jg 0x40d74c
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebx
mov ecx, dword [esp + 0x28]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 8