Function at 0x40b660
Capabilities:
Check http status code
Connect to http server
Create http request
Download and write a file
Get http content length
Parse url
Read data from internet
Receive and write data from server to client
Receive data
Send data
Send http request
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x40d98c
mov eax, dword fs:[0]
push eax
mov eax, 0x3cd4
call fcn.0040d710
mov eax, dword [0x41401c]
xor eax, esp
mov dword [esp + 0x3cd0], eax
push ebx
push ebp
push esi
mov eax, dword [0x41401c]
xor eax, esp
push eax
lea eax, [esp + 0x3ce4]
mov dword fs:[0], eax
push 0x3c
lea eax, [esp + 0x38]
mov esi, ecx
push 0
push eax
mov dword [esp + 0x2c], esi
mov dword [esp + 0x1c], 0
call sub.MSVCR90.dll_memset
mov eax, 0x800
mov dword [esp + 0x54], eax
mov dword [esp + 0x70], eax
lea eax, [esp + 0x2ec]
lea ecx, [esp + 0x4ec]
mov dword [esp + 0x5c], eax
mov eax, 0x200
mov dword [esp + 0x50], ecx
add esp, 0xc
cmp dword [edi + 0x18], 8
lea edx, [esp + 0xce0]
lea ecx, [esp + 0xe0]
mov dword [esp + 0x54], eax
mov dword [esp + 0x5c], eax
mov eax, dword [edi + 0x14]
mov dword [esp + 0x34], 0x3c
mov dword [esp + 0x60], edx
mov dword [esp + 0x58], ecx
jb 0x40b719
mov ecx, dword [edi + 4]
jmp 0x40b71c
lea ecx, [edi + 4]
lea edx, [esp + 0x34]
push edx
push 0
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetCrackUrlW]
test eax, eax
je 0x40ba70
push 0
push 0
push 0
push 0
push 0x410400
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [esp + 0x2c], eax
test eax, eax
jne 0x40b75b
mov dword [esp + 0x10], 0xfffffffe
jmp 0x40ba6c
cmp dword [esi + 0xc], 0
je 0x40b76e
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ba65
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x50]
push 0
push 0
push 3
push ecx
mov ecx, dword [esp + 0x5c]
push edx
push ecx
lea edx, [esp + 0x4f8]
push edx
push eax
call dword [sym.imp.WININET.dll_InternetConnectW]
mov ebp, eax
mov dword [esp + 0x28], ebp
test ebp, ebp
jne 0x40b7a9
mov dword [esp + 0x10], 0xfffffffe
jmp 0x40ba56
cmp dword [esi + 0xc], 0
je 0x40b7bc
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ba56
cmp dword [edi + 0x38], 0
push 0
push 0
push 0
push 0
push 0
je 0x40b822
mov eax, dword [esp + 0x74]
push eax
push str.POST
push ebp
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov ebx, eax
mov eax, str.Content_Type:_application_x_www_form_urlencoded__charsetUTF_8__r_n
mov dword [esp + 0x14], ebx
lea edx, [eax + 2]
jmp 0x40b7f0
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40b7f0
sub eax, edx
push 0xa0000000
sar eax, 1
push eax
push str.Content_Type:_application_x_www_form_urlencoded__charsetUTF_8__r_n
push ebx
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
test eax, eax
jne 0x40b837
mov dword [esp + 0x10], 0xfffffffd
jmp 0x40ba47
mov ecx, dword [esp + 0x74]
push ecx
push 0x4104b4
push ebp
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [esp + 0x14], eax
mov ebx, dword [esp + 0x14]
test ebx, ebx
jne 0x40b84c
mov dword [esp + 0x10], 0xfffffffd
jmp 0x40ba56
cmp dword [esi + 0xc], 0
je 0x40b85f
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ba47
mov edx, dword [edi + 0x3c]
mov eax, dword [edi + 0x38]
push edx
push eax
push 0
push 0
push ebx
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x40b883
mov dword [esp + 0x10], 0xfffffffd
jmp 0x40ba47
cmp dword [esi + 0xc], 0
je 0x40b896
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ba47
mov ebp, dword [sym.imp.WININET.dll_HttpQueryInfoW]
push 0
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x38]
push edx
push 0x20000013
push ebx
mov dword [esp + 0x30], 4
call ebp
test eax, eax
je 0x40ba3f
cmp dword [esp + 0x30], 0x190
jae 0x40ba3f
cmp dword [edi + 0x30], 0
je 0x40ba47
cmp dword [edi + 0x50], 0
je 0x40b94d
cmp dword [edi + 0x18], 8
jb 0x40b8e9
mov eax, dword [edi + 4]
jmp 0x40b8ec
lea eax, [edi + 4]
push eax
lea esi, [esp + 0xc8]
call fcn.0040bd80
lea esi, [edi + 0x1c]
lea ebx, [esp + 0x70]
mov dword [esp + 0x3cec], 0
call fcn.00405b50
push eax
mov ecx, esi
mov byte [esp + 0x3cf0], 1
call dword [0x40f174]
mov ecx, ebx
mov byte [esp + 0x3cec], 0
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__::destructor_void_]
lea eax, [esp + 0xc4]
push eax
mov ecx, esi
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
lea ecx, [esp + 0xc4]
jmp 0x40ba00
cmp dword [edi + 0x54], 0
je 0x40ba15
lea esi, [esp + 0xa8]
call fcn.00405ab0
mov ebx, 2
push 0x4104bc
mov ecx, esi
mov dword [esp + 0x3cf0], ebx
call dword [0x40f184]
cmp dword [edi + 0x18], 8
jb 0x40b987
mov eax, dword [edi + 4]
jmp 0x40b98a
lea eax, [edi + 4]
push eax
lea esi, [esp + 0x74]
call fcn.0040bd80
push eax
lea ecx, [esp + 0xac]
mov byte [esp + 0x3cf0], 3
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov ecx, esi
mov byte [esp + 0x3cec], bl
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__::destructor_void_]
lea esi, [edi + 0x1c]
lea ebx, [esp + 0x8c]
call fcn.00405b50
push eax
mov ecx, esi
mov byte [esp + 0x3cf0], 4
call dword [0x40f174]
mov ecx, ebx
mov byte [esp + 0x3cec], 2
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__::destructor_void_]
lea ecx, [esp + 0xa8]
push ecx
mov ecx, esi
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
lea ecx, [esp + 0xa8]
mov dword [esp + 0x3cec], 0xffffffff
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__::destructor_void_]
mov esi, dword [esp + 0x20]
mov ebx, dword [esp + 0x14]
push 0
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x2c]
push eax
push 0x20000005
push ebx
mov dword [esp + 0x30], 4
call ebp
test eax, eax
jne 0x40ba97
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], 0xfffffffc
test ebx, ebx
je 0x40ba52
push ebx
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebp, dword [esp + 0x28]
test ebp, ebp
je 0x40ba61
push ebp
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0x2c]
push eax
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x3ce4]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3cd0]
xor ecx, esp
call fcn.0040cd4c
add esp, 0x3ce0
ret
cmp dword [esi + 0xc], 0
je 0x40baa7
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ba47
cmp dword [edi + 0x34], 8
jb 0x40bab2
mov eax, dword [edi + 0x20]
jmp 0x40bab5
lea eax, [edi + 0x20]
push 0
push 0
push 2
push 0
push 2
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x40badf
mov dword [esp + 0x10], 0xfffffffb
jmp 0x40ba47
mov eax, dword [esp + 0x24]
mov esi, eax
mov dword [esp + 0x18], 0
test eax, eax
jbe 0x40bbae
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x40bb00
mov ecx, dword [esp + 0x20]
cmp dword [ecx + 0xc], 0
jne 0x40bb92
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x18]
push edx
push 0x2800
lea eax, [esp + 0x14e8]
push eax
push ecx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40bb9c
mov ecx, dword [esp + 0x24]
sub esi, dword [esp + 0x18]
mov eax, ecx
sub eax, esi
imul eax, eax, 0x64
xor edx, edx
div ecx
test eax, eax
jge 0x40bb4a
xor eax, eax
jmp 0x40bb54
cmp eax, 0x64
jle 0x40bb54
mov eax, 0x64
mov ecx, dword [edi + 0x44]
test ecx, ecx
je 0x40bb6d
mov edx, dword [edi + 0x4c]
push eax
mov eax, dword [edi + 0x48]
push 0
push 2
push edx
push eax
call ecx
add esp, 0x14
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x1c]
push ecx
push edx
lea eax, [esp + 0x14ec]
push eax
push ebp
call ebx
test eax, eax
je 0x40bba6
test esi, esi
ja 0x40bb00
jmp 0x40bbae
mov dword [esp + 0x10], 0xffffffff
jmp 0x40bbae
mov dword [esp + 0x10], 0xfffffffa
jmp 0x40bbae
mov dword [esp + 0x10], 0xfffffff9
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [esp + 0x14]
test esi, esi
ja 0x40ba47
mov dword [esp + 0x10], 0
jmp 0x40ba47