Function at 0x40e950
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 0x41107c
mov eax, dword fs:[0]
push eax
mov eax, 0x3cd4
call fcn.00410e50
mov eax, dword [0x41901c]
xor eax, esp
mov dword [esp + 0x3cd0], eax
push ebx
push ebp
push esi
mov eax, dword [0x41901c]
xor eax, esp
push eax
lea eax, [esp + 0x3ce4]
mov dword fs:[0], eax
push 0x3c
lea eax, [esp + 0x38]
mov ebx, ecx
push 0
push eax
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], 0
call sub.MSVCR90.dll_memset
mov ecx, 0x800
mov dword [esp + 0x54], ecx
mov dword [esp + 0x70], ecx
lea eax, [esp + 0x2ec]
lea edx, [esp + 0x4ec]
mov dword [esp + 0x5c], eax
mov ebp, 0x200
mov dword [esp + 0x50], edx
sub esp, 0xfffffff4
cmp dword [edi + 0x18], 8
lea edx, [esp + 0xce0]
lea esi, [esp + 0xe0]
mov dword [esp + 0x54], ebp
mov dword [esp + 0x5c], ebp
mov eax, dword [edi + 0x14]
mov dword [esp + 0x34], 0x3c
mov dword [esp + 0x60], edx
mov dword [esp + 0x58], esi
jb 0x40ea09
mov ecx, dword [edi + 4]
jmp 0x40ea0c
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 0x40ed7b
push 0
push 0
push 0
push 0
push 0x414648
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [esp + 0x2c], eax
or eax, eax
jne 0x40ea4b
mov dword [esp + 0x10], 0xfffffffe
jmp 0x40ed77
cmp dword [ebx + 0xc], 0
je 0x40ea5e
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ed70
mov esi, dword [esp + 0x50]
mov ecx, dword [esp + 0x58]
push 0
push 0
push 3
push ecx
mov ecx, dword [esp + 0x5c]
push esi
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
or ebp, ebp
jne 0x40ea99
mov dword [esp + 0x10], 0xfffffffe
jmp 0x40ed61
cmp dword [ebx + 0xc], 0
je 0x40eaac
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ed61
cmp dword [edi + 0x38], 0
push 0
push 0
push 0
push 0
push 0
je 0x40eb12
mov eax, dword [esp + 0x74]
push eax
push str.POST
push ebp
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov esi, eax
mov eax, str.Content_Type:_application_x_www_form_urlencoded__charsetUTF_8__r_n
mov dword [esp + 0x14], esi
lea edx, [eax + 2]
jmp 0x40eae0
mov cx, word [eax]
sub eax, 0xfffffffe
or cx, cx
jne 0x40eae0
push 0xa0000000
sub eax, edx
sar eax, 1
push eax
push str.Content_Type:_application_x_www_form_urlencoded__charsetUTF_8__r_n
push esi
call dword [sym.imp.WININET.dll_HttpAddRequestHeadersW]
test eax, eax
jne 0x40eb29
mov dword [esp + 0x10], 0xfffffffd
jmp 0x40ed52
mov ecx, dword [esp + 0x74]
push ecx
push 0x4146fc
push ebp
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [esp + 0x14], eax
mov esi, eax
test esi, esi
jne 0x40eb3a
mov dword [esp + 0x10], 0xfffffffd
jmp 0x40ed61
cmp dword [ebx + 0xc], 0
je 0x40eb4d
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ed52
mov eax, dword [edi + 0x38]
mov edx, dword [edi + 0x3c]
push edx
push eax
push 0
push 0
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestW]
or eax, eax
jne 0x40eb71
mov dword [esp + 0x10], 0xfffffffd
jmp 0x40ed52
cmp dword [ebx + 0xc], 0
je 0x40eb84
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ed52
mov ebp, dword [sym.imp.WININET.dll_HttpQueryInfoW]
push 0
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x38]
push edx
push 0x20000013
push esi
mov dword [esp + 0x38], 4
call ebp
or eax, eax
je 0x40ed4a
cmp dword [esp + 0x30], 0x190
jae 0x40ed4a
cmp dword [edi + 0x30], 0
je 0x40ed52
cmp dword [edi + 0x54], 0
je 0x40ec3b
cmp dword [edi + 0x18], 8
jb 0x40ebd7
mov eax, dword [edi + 4]
jmp 0x40ebda
lea eax, [edi + 4]
push eax
lea esi, [esp + 0xc8]
call fcn.0040f090
lea esi, [edi + 0x1c]
mov dword [esp + 0x3cec], 0
lea ebx, [esp + 0x70]
call fcn.00405d50
mov ecx, esi
push eax
mov byte [esp + 0x3cf0], 1
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, 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_]
mov ecx, esi
lea eax, [esp + 0xc4]
push eax
call dword [0x4131d8]
lea ecx, [esp + 0xc4]
jmp 0x40ecee
cmp dword [edi + 0x58], 0
je 0x40ed07
lea esi, [esp + 0xa8]
call fcn.00405cb0
mov ebx, 2
push 0x414704
mov ecx, esi
mov dword [esp + 0x3cf0], ebx
call dword [0x4131c0]
cmp dword [edi + 0x18], 8
jb 0x40ec75
mov eax, dword [edi + 4]
jmp 0x40ec78
lea eax, [edi + 4]
push eax
lea esi, [esp + 0x74]
call fcn.0040f090
push eax
mov byte [esp + 0x3cf0], 3
lea ecx, [esp + 0xac]
call dword [0x4131d8]
mov byte [esp + 0x3cec], bl
mov ecx, esi
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 ebx, [esp + 0x8c]
lea esi, [edi + 0x1c]
call fcn.00405d50
push eax
mov ecx, esi
mov byte [esp + 0x3cf0], 4
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, 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_]
mov ecx, esi
lea ebx, [esp + 0xa8]
push ebx
call dword [0x4131d8]
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 ebx, dword [esp + 0x20]
mov esi, dword [esp + 0x14]
push 0
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x24]
push eax
push 0x20000005
push esi
mov dword [esp + 0x38], 4
call ebp
test eax, eax
jne 0x40ed34
cmp dword [edi + 0x50], eax
je 0x40ed44
mov dword [esp + 0x1c], 0x2800
cmp dword [ebx + 0xc], 0
je 0x40eda2
mov dword [esp + 0x10], 0xffffffff
jmp 0x40ed52
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], 0xfffffffc
or esi, esi
je 0x40ed5d
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov ebp, dword [esp + 0x28]
test ebp, ebp
je 0x40ed6c
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 ebx, dword [esp + 0x3ce4]
mov dword fs:[0], ebx
pop ebp
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x3cd0]
xor ecx, esp
call fcn.0041045c
add esp, 0x3ce0
ret
cmp dword [edi + 0x34], 8
jb 0x40edad
mov eax, dword [edi + 0x20]
jmp 0x40edb0
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 ebx, eax
cmp ebx, 0xffffffff
jne 0x40edda
mov dword [esp + 0x10], 0xfffffffb
jmp 0x40ed52
mov ebp, dword [esp + 0x1c]
mov dword [esp + 0x18], 0
test ebp, ebp
ja 0x40ee02
cmp dword [edi + 0x50], 0
je 0x40eec2
mov ecx, dword [esp + 0x1c]
cmp dword [esp + 0x18], ecx
jne 0x40eec2
mov edx, dword [esp + 0x20]
cmp dword [edx + 0xc], 0
jne 0x40eeaa
lea eax, [esp + 0x18]
push eax
push 0x2800
lea ecx, [esp + 0x14e8]
push ecx
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
or eax, eax
je 0x40eeb4
mov esi, dword [esp + 0x18]
test esi, esi
je 0x40eebe
sub ebp, esi
mov ecx, dword [esp + 0x1c]
mov eax, ecx
sub eax, ebp
imul eax, eax, 0x64
xor edx, edx
div ecx
test eax, eax
jge 0x40ee56
xor eax, eax
jmp 0x40ee60
cmp eax, 0x64
jle 0x40ee60
mov eax, 0x64
mov ecx, dword [edi + 0x44]
or ecx, ecx
je 0x40ee7d
mov edx, dword [edi + 0x4c]
push eax
mov eax, dword [edi + 0x48]
push 0
push 2
push edx
push eax
call ecx
mov esi, dword [esp + 0x2c]
add esp, 0x14
push 0
lea ecx, [esp + 0x1c]
push ecx
push esi
lea edx, [esp + 0x14ec]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [esp + 0x14]
or eax, eax
jne 0x40ede6
mov dword [esp + 0x10], 0xfffffff9
jmp 0x40eec2
mov dword [esp + 0x10], 0xffffffff
jmp 0x40eec2
mov dword [esp + 0x10], 0xfffffffa
jmp 0x40eec2
mov esi, dword [esp + 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebp, ebp
ja 0x40ed52
mov dword [esp + 0x10], 0
jmp 0x40ed52