Function at 0x4105e0
Capabilities:
Check if file exists
Get file attributes
Get file size

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x50feeb
mov eax, dword fs:[0]
push eax
mov eax, 0x27f8
call fcn.0050c2d0
mov eax, dword [0x551aa8]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [ebp + 8]
push str.Patch_Step_1___DownloadPatch_Start
mov dword [ebp - 0x27e8], eax
call fcn.004172c0
add esp, 4
lea ecx, [ebp - 0x27fc]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
push edi
lea ecx, [ebp - 0x27fc]
mov dword [ebp - 4], 0
mov ebx, dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::Format]
push str._08d
push ecx
call ebx
add esp, 0xc
lea ecx, [ebp - 0x27fc]
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
push str.Download_Patch_Version___s_
call fcn.004172c0
add esp, 8
lea ecx, [ebp - 0x27ec]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
mov byte [ebp - 4], 1
test byte [0x56c888], 1
jne 0x4106a1
or dword [0x56c888], 1
call fcn.0040bb80
push 0x5107b0
call fcn.0050c11f
add esp, 4
lea esi, [ebp - 0x27f0]
mov eax, 0x56c808
call fcn.004098f0
push eax
lea ecx, [ebp - 0x27ec]
mov byte [ebp - 4], 2
call dword [0x51182c]
mov ecx, esi
mov byte [ebp - 4], 1
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
push 0x544728
lea ecx, [ebp - 0x27ec]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::operator_3]
lea ecx, [ebp - 0x27f4]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
lea ecx, [ebp - 0x27f8]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
push edi
lea ecx, [ebp - 0x27ec]
mov byte [ebp - 4], 4
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
lea edx, [ebp - 0x27f4]
push 0x54472c
push edx
call ebx
push edi
lea eax, [ebp - 0x27f8]
push str.Patch_08d.pak
push eax
call ebx
add esp, 0x1c
lea ecx, [ebp - 0x27f4]
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
call dword [sym.imp.WININET.dll_DeleteUrlCacheEntryW]
test byte [0x56c888], 1
jne 0x41075e
or dword [0x56c888], 1
call fcn.0040bb80
push 0x5107b0
call fcn.0050c11f
add esp, 4
lea esi, [ebp - 0x27f0]
mov eax, 0x56c808
call fcn.00409930
mov esi, eax
lea ecx, [ebp - 0x27f8]
mov byte [ebp - 4], 5
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
mov ecx, esi
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
lea ecx, [ebp - 0x27f4]
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
mov ecx, dword [ebp - 0x27e8]
mov edx, eax
call fcn.00410cc0
lea ecx, [ebp - 0x27f0]
mov esi, eax
mov byte [ebp - 4], 4
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
test esi, esi
je 0x4107ff
push str.Download_Failed_
xor esi, esi
call fcn.00417260
add esp, 4
lea ecx, [ebp - 0x27f8]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
lea ecx, [ebp - 0x27f4]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
lea ecx, [ebp - 0x27ec]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
lea ecx, [ebp - 0x27fc]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
xor eax, eax
jmp 0x410ca1
mov esi, dword [ebp - 0x27e8]
lea ecx, [esi + 0x30]
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x410835
lea ecx, [esi + 0x30]
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
push str.Failed__GetFileAttributes__s_
xor esi, esi
call fcn.00417260
add esp, 8
jmp 0x4107c8
push str.Download_txt_File
call fcn.004172c0
add esp, 4
lea ecx, [ebp - 0x2800]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_clas]
push edi
lea ecx, [ebp - 0x27ec]
mov byte [ebp - 4], 6
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
lea ecx, [ebp - 0x2800]
push str._sPatch_08d.txt
push ecx
call ebx
add esp, 0x10
test byte [0x56c888], 1
jne 0x410893
or dword [0x56c888], 1
call fcn.0040bb80
push 0x5107b0
call fcn.0050c11f
add esp, 4
lea esi, [ebp - 0x27f0]
mov eax, 0x56c808
call fcn.00409930
mov esi, dword [ebp - 0x27e8]
lea edx, [esi + 0x34]
push edi
mov ecx, eax
mov byte [ebp - 4], 7
mov dword [ebp - 0x27e8], edx
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
mov edi, dword [ebp - 0x27e8]
push eax
push str._sPatch_08d.txt
push edi
call ebx
add esp, 0x10
lea ecx, [ebp - 0x27f0]
mov byte [ebp - 4], 6
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
lea ecx, [ebp - 0x2800]
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
call dword [sym.imp.WININET.dll_DeleteUrlCacheEntryW]
mov ecx, edi
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
lea ecx, [ebp - 0x2800]
mov edi, eax
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
mov edx, edi
mov ecx, eax
call fcn.00415f70
mov edi, eax
test edi, edi
jne 0x41095c
mov ecx, dword [ebp - 0x27e8]
push eax
push 0x80
push 3
push eax
push 1
push 0x80000000
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
jne 0x41094d
lea edi, [eax + 1]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x410c05
push 0x1fff
lea eax, [ebp - 0x251b]
push 0
push eax
mov byte [ebp - 0x251c], 0
call sub.MSVCR100.dll_memset
add esp, 0xc
push 0
push 0
push 0x2000
lea ecx, [ebp - 0x251c]
push ecx
push 0xffffffffffffffff
lea ecx, [esi + 0x30]
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
lea edx, [ebp - 0x27e4]
push edx
call fcn.00421d30
push 1
lea eax, [ebp - 0x251c]
push eax
lea eax, [ebp - 0x27e4]
mov byte [ebp - 4], 8
call fcn.004223d0
mov ecx, dword [ebp - 0x2540]
sub ecx, dword [ebp - 0x2544]
mov eax, 0x67b23a55
imul ecx
sar edx, 7
push 0x103
mov ebx, edx
lea ecx, [ebp - 0x11b]
push 0
shr ebx, 0x1f
push ecx
add ebx, edx
mov byte [ebp - 0x11c], 0
call sub.MSVCR100.dll_memset
mov ecx, dword [ebp - 0x27e8]
add esp, 0xc
push 0x104
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
lea edx, [ebp - 0x11c]
push edx
call dword [sym.imp.MSVCR100.dll_wcstombs]
add esp, 0xc
push 0x3ff
lea eax, [ebp - 0x51b]
push 0
push eax
mov byte [ebp - 0x51c], 0
call sub.MSVCR100.dll_memset
add esp, 0xc
mov edi, ebx
mov dword [ebp - 0x2804], edi
test ebx, ebx
js 0x410bef
mov eax, ebx
imul eax, eax, 0x13c
mov dword [ebp - 0x27f0], eax
lea ebx, [ebx]
add eax, dword [ebp - 0x2544]
lea edx, [ebp - 0x51c]
push eax
push 0x5438cc
call fcn.00414220
add esp, 8
cmp ebx, edi
je 0x410bc9
mov edx, dword [esi]
mov edx, dword [edx + 8]
push str.resource
lea eax, [ebp - 0x51b]
push eax
mov ecx, esi
call edx
test al, al
jne 0x410ab4
mov eax, dword [esi]
mov edx, dword [eax + 8]
push str.mapdata
lea ecx, [ebp - 0x51b]
push ecx
mov ecx, esi
call edx
test al, al
je 0x410b24
mov ecx, 0x545708
lea eax, [ebp - 0x51b]
nop
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x410ae0
test dl, dl
je 0x410adc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x410ae0
add eax, 2
add ecx, 2
test dl, dl
jne 0x410ac0
xor eax, eax
jmp 0x410ae5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x410b24
lea eax, [ebp - 0x11c]
push 0x5447e4
push eax
call dword [sym.imp.MSVCR100.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
je 0x410b24
lea ecx, [ebp - 0x51b]
push ecx
push str.D__s_n
push edi
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0xc
push edi
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov edx, dword [esi]
mov edx, dword [edx + 8]
push str.resource
lea eax, [ebp - 0x51b]
push eax
mov ecx, esi
call edx
test al, al
jne 0x410bc9
mov eax, dword [esi]
mov edx, dword [eax + 8]
push str.mapdata
lea ecx, [ebp - 0x51b]
push ecx
mov ecx, esi
call edx
test al, al
jne 0x410bc9
mov ecx, 0x545708
lea eax, [ebp - 0x51b]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x410b85
test dl, dl
je 0x410b81
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x410b85
add eax, 2
add ecx, 2
test dl, dl
jne 0x410b65
xor eax, eax
jmp 0x410b8a
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x410bc9
lea eax, [ebp - 0x11c]
push 0x5447e4
push eax
call dword [sym.imp.MSVCR100.dll_fopen]
mov edi, eax
add esp, 8
test edi, edi
je 0x410bc9
lea ecx, [ebp - 0x51b]
push ecx
push str.C__s_n
push edi
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0xc
push edi
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov edi, dword [ebp - 0x2804]
mov eax, dword [ebp - 0x27f0]
dec edi
sub eax, 0x13c
mov dword [ebp - 0x2804], edi
mov dword [ebp - 0x27f0], eax
test edi, edi
jns 0x410a60
lea ebx, [ebp - 0x27e4]
call fcn.00422190
mov ecx, ebx
mov byte [ebp - 4], 6
call fcn.00421f10
push str.Download_txt_File_Success
call fcn.004172c0
mov esi, dword [ebp - 0x27e8]
add esp, 4
mov ecx, esi
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x410c53
mov ecx, esi
call dword [sym.imp.mfc100u.dll_ATL::CSimpleStringT_wchar_t_1_::GetBuffer_1]
push eax
push str.Failed__GetFileAttributes__s_
call fcn.004172c0
add esp, 8
lea ecx, [ebp - 0x2800]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
jmp 0x4107c8
push str.Patch_Step_1___DownloadPatch_End
call fcn.004172c0
add esp, 4
lea ecx, [ebp - 0x2800]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
lea ecx, [ebp - 0x27f8]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
lea ecx, [ebp - 0x27f4]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
lea ecx, [ebp - 0x27ec]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
lea ecx, [ebp - 0x27fc]
call dword [sym.imp.mfc100u.dll_ATL::CStringT_wchar_t_class_StrTraitMFC_DLL_wchar_t_class_ATL::ChTraitsCRT_wchar_t_____::CStringT_wchar_t_cla]
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 - 0x14]
xor ecx, ebp
call fcn.0050bf32
mov esp, ebp
pop ebp
ret 4