Function at 0x402027
Capabilities:
Check if file exists
Get file size
Prepare http request
Read http header
Receive http response

Disassembly:
sub esp, 0x2c
push ebx
push ebp
push esi
push edi
push dword [esp + 0x44]
mov byte [esp + 0x17], 0
push 0x904040
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov eax, dword [esp + 0x48]
xor ebp, ebp
mov dword [esp + 0x18], ebp
cmp eax, ebp
je 0x402052
mov dword [eax], ebp
mov eax, dword [esp + 0x4c]
cmp eax, ebp
je 0x40205c
mov dword [eax], ebp
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, 0x94f2d0
mov esi, 0x7f1028
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x24]
push eax
call fcn.00401b11
pop ecx
pop ecx
test al, al
je 0x4022f0
push ebp
push dword [esp + 0x24]
push 0x9221d0
push dword [esp + 0x4c]
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov dword [esp + 0x2c], eax
cmp eax, ebp
je 0x4022f0
movzx ecx, byte [esp + 0x24]
neg ecx
sbb ecx, ecx
and ecx, 0x800000
push ecx
lea ecx, [esp + 0x34]
push ecx
push ebp
push ebp
push 0x91d1d0
push 0x8eb028
push eax
mov dword [esp + 0x4c], 0x403324
mov dword [esp + 0x50], ebp
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov ebp, eax
test ebp, ebp
je 0x4022e4
push 4
lea eax, [esp + 0x18]
push eax
push 0x1f
push ebp
mov dword [esp + 0x24], 0x3100
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
push 4
lea eax, [esp + 0x18]
push eax
push 0x3f
push ebp
mov dword [esp + 0x24], 2
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
push str.Content_Type:_application_x_www_form_urlencoded_r_n
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push 0x9311d0
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4021a2
push 0x9311d0
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x4021a2
push eax
push 0x80
push 3
push eax
push 1
push 0x80000000
push 0x9311d0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esp + 0x28], eax
cmp eax, 0xffffffff
je 0x4021a2
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push dword [esp + 0x28]
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x1c], 0
je 0x4021a2
push dword [esp + 0x1c]
push str.Range:_bytes_u__r_n
push 0x94a2d0
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0x94a2d0
push edi
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0
push esi
call ebx
push eax
push esi
call ebx
push eax
movsx eax, byte [0x7f1028]
neg eax
sbb eax, eax
and eax, esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push edi
push ebp
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x402212
push dword [esp + 0x40]
push ebp
call fcn.00401fae
pop ecx
pop ecx
test al, al
je 0x4022dd
push 0
push esi
call ebx
push eax
push esi
call ebx
push eax
movsx eax, byte [0x7f1028]
neg eax
sbb eax, eax
and eax, esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push edi
push ebp
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
je 0x4022dd
push 0
push ebp
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
je 0x4022dd
push ebp
call fcn.00401cc5
pop ecx
push ebp
mov dword [esp + 0x2c], eax
call fcn.00401b8e
pop ecx
lea ecx, [eax - 0x12c]
mov dword [esp + 0x18], eax
cmp ecx, 0x63
ja 0x4022ad
push 0
lea eax, [esp + 0x2c]
push eax
push 0x90e108
push 0
push 0x21
push ebp
mov dword [esp + 0x40], 0x2800
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x40227e
push dword [esp + 0x20]
push dword [esp + 0x28]
push 0x9221d0
call fcn.00401d11
add esp, 0xc
jmp 0x402280
xor eax, eax
test eax, eax
je 0x4022dd
cmp dword [esp + 0x18], 0x12f
jne 0x40229c
push eax
push 0x904040
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
jmp 0x4022dd
mov ecx, dword [esp + 0x4c]
mov byte [esp + 0x13], 1
test ecx, ecx
je 0x4022dd
mov dword [ecx], eax
jmp 0x4022dd
cmp eax, 0xc8
je 0x4022bb
cmp eax, 0xce
jne 0x4022dd
push dword [esp + 0x28]
push ebp
call fcn.00401db6
pop ecx
pop ecx
mov byte [esp + 0x13], al
test al, al
jne 0x4022dd
mov eax, dword [esp + 0x48]
test eax, eax
je 0x4022dd
mov dword [eax], 0x904040
push ebp
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push dword [esp + 0x2c]
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
xor ebp, ebp
cmp dword [esp + 0x18], 0x12f
je 0x40206c
mov al, byte [esp + 0x13]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret