Function at 0x401250
Capabilities:
Check http status code
Check internet connectivity via wininet
Create http request
Delete file
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4040b8
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x10154
call fcn.00403df0
mov eax, dword [0x407004]
xor eax, esp
mov dword [esp + 0x10150], eax
push ebx
push esi
push edi
mov eax, dword [0x407004]
xor eax, esp
push eax
lea eax, [esp + 0x10168]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x18], eax
push 0
lea eax, [esp + 0x40]
push eax
mov dword [esp + 0x40], ecx
mov dword [esp + 0x24], edx
call dword [sym.imp.WININET.dll_InternetGetConnectedState]
call dword [sym.imp.WINMM.dll_timeGetTime]
push eax
lea ecx, [esp + 0x10080]
push str.Agent_ld
push ecx
call dword [sym.imp.MSVCR90.dll_sprintf]
add esp, 0xc
test byte [esp + 0x3c], 4
push 0
push 0
push 0
jne 0x4012f3
push 4
lea edx, [esp + 0x1008c]
push edx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ebx, eax
mov dword [esp + 0x14], ebx
jmp 0x401309
push 0
lea eax, [esp + 0x1008c]
push eax
call dword [sym.imp.WININET.dll_InternetOpenA]
mov dword [esp + 0x14], eax
mov ebx, eax
test ebx, ebx
jne 0x401329
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Internet_Open_Fail__errno__d__n_r
call fcn.00403040
add esp, 8
or eax, 0xffffffff
jmp 0x401679
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push 4
lea ecx, [esp + 0x2c]
push ecx
push 2
push ebx
mov dword [esp + 0x38], 0x2710
call esi
test eax, eax
jne 0x40136a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Internet_Setoption_Fail__errno__d__n_r
call fcn.00403040
add esp, 8
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
or eax, 0xffffffff
jmp 0x401679
push 4
lea edx, [esp + 0x2c]
push edx
push 6
push ebx
call esi
test eax, eax
je 0x401347
mov ecx, 0x27
mov esi, str.Accept:___r_nAccept_Language:_zh_cn_r_nAccept_Encoding:_gzip__deflate_r_nUser_Agent:_Mozilla_4.0__compatible__MSIE_6.0__Windows_NT_5.0__MyIE2__.NET_CLR_1.1.4322_
lea edi, [esp + 0x100bc]
rep movsd dword es:[edi], dword [esi]
push 0xfffc
lea eax, [esp + 0x84]
push 0
push eax
movsw word es:[edi], word [esi]
mov dword [esp + 0x88], 0
call sub.MSVCR90.dll_memset
add esp, 0xc
push 0
push 0x84000100
lea ecx, [esp + 0x100c4]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x100c8]
push edx
push eax
push ebx
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov ebx, eax
xor edi, edi
cmp ebx, edi
jne 0x40140f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x18]
push eax
push ecx
push str.cant_open_this_URL__s__errno:__d___r_n
call fcn.00403040
mov edx, dword [esp + 0x20]
add esp, 0xc
push edx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
or eax, 0xffffffff
jmp 0x401679
mov esi, dword [sym.imp.WININET.dll_HttpQueryInfoW]
push edi
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x34]
push ecx
push 0x20000005
push ebx
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], 4
call esi
test eax, eax
jne 0x401469
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x18]
push eax
push edx
push str.cant_get_this_length:__s__errno__d__r_n
call fcn.00403040
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
add esp, 0xc
push ebx
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
or eax, 0xffffffff
jmp 0x401679
push 0
lea ecx, [esp + 0x38]
push ecx
lea edx, [esp + 0x28]
push edx
push 0x20000013
push ebx
mov dword [esp + 0x34], edi
mov dword [esp + 0x48], 4
call esi
cmp dword [esp + 0x20], 0xc8
je 0x4014c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x18]
push eax
mov eax, dword [esp + 0x24]
push eax
push ecx
push str.this_url__s_status_is__d_errno__d__r_n
call fcn.00403040
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
add esp, 0x10
push ebx
call esi
mov edx, dword [esp + 0x14]
push edx
call esi
or eax, 0xffffffff
jmp 0x401679
mov esi, dword [esp + 0x18]
push 0xc8
push esi
push str.this_url__s_status_is__d_r_n
call fcn.00403040
mov eax, dword [esp + 0x28]
sub esp, 0x10
mov ecx, esp
mov dword [esp + 0x5c], esp
push eax
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
lea ecx, [esp + 0x60]
push ecx
call fcn.004031e0
add esp, 0x20
mov dword [esp + 0x10170], 0
cmp dword [eax + 0x18], 0x10
jb 0x401514
mov eax, dword [eax + 4]
jmp 0x401517
add eax, 4
push eax
push esi
push str._HttpGet___s_to__s_n
call fcn.00403040
add esp, 0xc
lea ecx, [esp + 0x44]
mov dword [esp + 0x10170], 0xffffffff
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov edx, dword [esp + 0x1c]
push 0x4054a0
push edx
call dword [sym.imp.MSVCR90.dll__wfopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x401605
jmp 0x401560
lea eax, [esp + 0x24]
push eax
push 0x4000
lea ecx, [esp + 0x84]
push ecx
push ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x4015c2
mov eax, dword [esp + 0x24]
test eax, eax
je 0x4015b3
push esi
push eax
lea edx, [esp + 0x84]
push 1
push edx
call dword [sym.imp.MSVCR90.dll_fwrite]
mov ecx, dword [esp + 0x48]
add esp, 0x10
lea eax, [esp + 0x7c]
push eax
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::append_char_const__]
add edi, dword [esp + 0x24]
cmp edi, dword [esp + 0x2c]
jb 0x401560
push esi
call dword [sym.imp.MSVCR90.dll_fclose]
add esp, 4
jmp 0x40166c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x18]
push eax
push ecx
push str.this_url__s_InternetReadFile_errno__d_r_n
call fcn.00403040
mov edi, dword [sym.imp.WININET.dll_InternetCloseHandle]
add esp, 0xc
push ebx
call edi
mov edx, dword [esp + 0x14]
push edx
call edi
push esi
call dword [sym.imp.MSVCR90.dll_fclose]
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.MSVCR90.dll__wremove]
add esp, 8
or eax, 0xffffffff
jmp 0x401679
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x1c]
push eax
sub esp, 0x1c
mov ecx, esp
mov dword [esp + 0x60], esp
push edx
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
lea eax, [esp + 0x80]
push eax
call fcn.004031e0
add esp, 0x20
mov dword [esp + 0x10174], 1
cmp dword [eax + 0x18], 0x10
jb 0x401646
mov eax, dword [eax + 4]
jmp 0x401649
add eax, 4
push eax
push str._fopen___s:_d_n
call fcn.00403040
add esp, 0xc
lea ecx, [esp + 0x60]
mov dword [esp + 0x10170], 0xffffffff
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
xor eax, eax
mov ecx, dword [esp + 0x10168]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x10150]
xor ecx, esp
call fcn.004035cb
mov esp, ebp
pop ebp
ret