Function at 0x40f580
Capabilities:
Check http status code
Connect to http server
Create http request
Read data from internet
Receive data
Send data
Send http request

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4bbb41
mov eax, dword fs:[0]
push eax
sub esp, 0xe8
mov eax, dword [0x4e27e0]
xor eax, ebp
mov dword [ebp - 0x18], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, ecx
xor ebx, ebx
mov dword [ebp - 0xd8], edi
mov dword [ebp - 0xe8], ebx
mov dword [ebp - 4], ebx
cmp dword [ebp + 0x20], 8
mov eax, dword [ebp + 0xc]
jae 0x40f5d0
lea eax, [ebp + 0xc]
push 7
push str.http:__
push eax
call fcn.0049ec74
add esp, 0xc
test eax, eax
jne 0x40f61c
lea eax, [ebp + 8]
push eax
or ecx, 0xffffffff
mov edx, 7
lea esi, [ebp - 0x34]
call fcn.00408580
push 0xffffffffffffffff
push ebx
lea ecx, [ebp + 8]
mov byte [ebp - 4], 1
call fcn.004030c0
mov byte [ebp - 4], bl
cmp dword [ebp - 0x1c], 8
jb 0x40f61c
mov ecx, dword [ebp - 0x30]
push ecx
call fcn.0047cc0e
add esp, 4
mov ebx, 1
push 0x4c867c
lea eax, [ebx + 7]
lea edx, [ebp + 8]
call fcn.00408820
mov ebx, eax
xor edx, edx
cmp ebx, 0xffffffff
jne 0x40f671
mov dword [edi + 0x18], 7
mov dword [edi + 0x14], edx
push 0xc
mov eax, str.server_error
mov esi, edi
mov word [edi + 4], dx
call fcn.004033f0
cmp dword [ebp + 0x20], 8
jb 0x40fa36
mov eax, dword [ebp + 0xc]
push eax
call fcn.0047cc0e
add esp, 4
jmp 0x40fa36
lea ecx, [ebp + 8]
push ecx
mov ecx, ebx
lea esi, [ebp - 0xd4]
call fcn.00408580
lea edx, [ebp + 8]
push edx
or ecx, 0xffffffff
mov edx, ebx
lea esi, [ebp - 0xb8]
mov byte [ebp - 4], 2
call fcn.00408580
mov byte [ebp - 4], 3
xor eax, eax
mov word [ebp - 0x7c], ax
mov edi, 7
xor ebx, ebx
push 0xc
mov eax, str.server_error
lea esi, [ebp - 0x80]
mov dword [ebp - 0x68], edi
mov dword [ebp - 0x6c], ebx
call fcn.004033f0
mov byte [ebp - 4], 4
xor ecx, ecx
push 0x32
mov eax, str.Mozilla_4.0__compatible__MSIE_4.0__Windows_NT_4.0_
lea esi, [ebp - 0x9c]
mov dword [ebp - 0xe4], ebx
mov dword [ebp - 0xec], ebx
mov dword [ebp - 0xe0], ebx
mov dword [ebp - 0x84], edi
mov dword [ebp - 0x88], ebx
mov word [ebp - 0x98], cx
call fcn.004033f0
lea edi, [ebp - 0x34]
mov byte [ebp - 4], 6
call fcn.0040feb0
push 0xffffffffffffffff
push ebx
mov ecx, esi
mov byte [ebp - 4], 7
call fcn.004030c0
mov edi, 8
mov byte [ebp - 4], 6
cmp dword [ebp - 0x1c], edi
jb 0x40f731
mov edx, dword [ebp - 0x30]
push edx
call fcn.0047cc0e
add esp, 4
mov eax, dword [ebp - 0x98]
cmp dword [ebp - 0x84], edi
jae 0x40f745
lea eax, [ebp - 0x98]
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.WININET.dll_InternetOpenW]
mov esi, eax
mov dword [ebp - 0xe4], esi
cmp esi, ebx
jne 0x40f842
mov esi, dword [ebp - 0xd8]
xor eax, eax
mov edi, 7
mov dword [esi + 0x18], edi
mov dword [esi + 0x14], ebx
push 0xffffffffffffffff
mov word [esi + 4], ax
push ebx
lea eax, [ebp - 0x80]
mov ecx, esi
call fcn.004030c0
cmp dword [ebp - 0x84], 8
jb 0x40f79c
mov ecx, dword [ebp - 0x98]
push ecx
call fcn.0047cc0e
add esp, 4
xor edx, edx
cmp dword [ebp - 0x68], 8
mov dword [ebp - 0x84], edi
mov dword [ebp - 0x88], ebx
mov word [ebp - 0x98], dx
jb 0x40f7c3
mov eax, dword [ebp - 0x7c]
push eax
call fcn.0047cc0e
add esp, 4
xor ecx, ecx
cmp dword [ebp - 0xa0], 8
mov dword [ebp - 0x68], edi
mov dword [ebp - 0x6c], ebx
mov word [ebp - 0x7c], cx
jb 0x40f7e7
mov edx, dword [ebp - 0xb4]
push edx
call fcn.0047cc0e
add esp, 4
xor eax, eax
cmp dword [ebp - 0xbc], 8
mov dword [ebp - 0xa0], edi
mov dword [ebp - 0xa4], ebx
mov word [ebp - 0xb4], ax
jb 0x40f814
mov ecx, dword [ebp - 0xd0]
push ecx
call fcn.0047cc0e
add esp, 4
xor edx, edx
cmp dword [ebp + 0x20], 8
mov dword [ebp - 0xbc], edi
mov dword [ebp - 0xc0], ebx
mov word [ebp - 0xd0], dx
jb 0x40f83b
mov eax, dword [ebp + 0xc]
push eax
call fcn.0047cc0e
add esp, 4
mov eax, esi
jmp 0x40fa38
mov eax, dword [ebp - 0xd0]
cmp dword [ebp - 0xbc], edi
jae 0x40f856
lea eax, [ebp - 0xd0]
push ebx
push ebx
push 3
push 0x4c868c
push 0x4c868c
push 0x50
push eax
push esi
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0xec], eax
cmp eax, ebx
jne 0x40f969
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov esi, dword [ebp - 0xd8]
xor ecx, ecx
mov edi, 7
mov dword [esi + 0x18], edi
mov dword [esi + 0x14], ebx
push 0xffffffffffffffff
mov word [esi + 4], cx
push ebx
lea eax, [ebp - 0x80]
mov ecx, esi
call fcn.004030c0
cmp dword [ebp - 0x84], 8
jb 0x40f8bf
mov edx, dword [ebp - 0x98]
push edx
call fcn.0047cc0e
add esp, 4
xor eax, eax
cmp dword [ebp - 0x68], 8
mov dword [ebp - 0x84], edi
mov dword [ebp - 0x88], ebx
mov word [ebp - 0x98], ax
jb 0x40f8e6
mov ecx, dword [ebp - 0x7c]
push ecx
call fcn.0047cc0e
add esp, 4
xor edx, edx
cmp dword [ebp - 0xa0], 8
mov dword [ebp - 0x68], edi
mov dword [ebp - 0x6c], ebx
mov word [ebp - 0x7c], dx
jb 0x40f90a
mov eax, dword [ebp - 0xb4]
push eax
call fcn.0047cc0e
add esp, 4
xor ecx, ecx
cmp dword [ebp - 0xbc], 8
mov dword [ebp - 0xa0], edi
mov dword [ebp - 0xa4], ebx
mov word [ebp - 0xb4], cx
jb 0x40f937
mov edx, dword [ebp - 0xd0]
push edx
call fcn.0047cc0e
add esp, 4
xor eax, eax
cmp dword [ebp + 0x20], 8
mov dword [ebp - 0xbc], edi
mov dword [ebp - 0xc0], ebx
mov word [ebp - 0xd0], ax
jb 0x40f83b
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.0047cc0e
add esp, 4
mov eax, esi
jmp 0x40fa38
mov edi, dword [ebp - 0xec]
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionW]
push 4
lea edx, [ebp - 0xe8]
push edx
push 2
push edi
mov dword [ebp - 0xe8], 0x7530
call esi
push 4
lea eax, [ebp - 0xe8]
push eax
push 5
push edi
call esi
push 4
lea ecx, [ebp - 0xe8]
push ecx
push 6
push edi
call esi
cmp dword [ebp - 0xa0], 8
mov eax, dword [ebp - 0xb4]
jae 0x40f9be
lea eax, [ebp - 0xb4]
push ebx
push SysReAllocStringLen
push ebx
push ebx
push str.HTTP_1.1
push eax
push 0x4cc274
push edi
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [ebp - 0xe0], eax
cmp eax, ebx
jne 0x40fa54
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push edi
call esi
mov edx, dword [ebp - 0xe4]
push edx
call esi
mov edi, dword [ebp - 0xd8]
lea eax, [ebp - 0x80]
push eax
mov esi, edi
call fcn.00402cf0
lea esi, [ebp - 0x9c]
call fcn.004092a0
lea esi, [ebp - 0x80]
call fcn.004092a0
lea esi, [ebp - 0xb8]
call fcn.004092a0
lea esi, [ebp - 0xd4]
call fcn.004092a0
lea esi, [ebp + 8]
call fcn.004092a0
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.0049bee5
mov esp, ebp
pop ebp
ret
xor esi, esi
cmp esi, 3
jge 0x40fc94
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
je 0x40fc88
mov esi, dword [ebp - 0xe0]
xor eax, eax
push ebx
lea edx, [ebp - 0xf0]
push edx
mov dword [ebp - 0x3e], eax
mov dword [ebp - 0x3a], eax
mov dword [ebp - 0x36], eax
mov dword [ebp - 0x32], eax
mov dword [ebp - 0x2e], eax
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x1e], eax
mov word [ebp - 0x1a], ax
lea eax, [ebp - 0x40]
push eax
push 0x13
xor ecx, ecx
push esi
mov word [ebp - 0x40], cx
mov dword [ebp - 0xf0], 0x14
call dword [sym.imp.WININET.dll_HttpQueryInfoW]
test eax, eax
je 0x40fb8d
cmp dword [ebp - 0xf0], ebx
jbe 0x40fb8d
lea ecx, [ebp - 0x40]
push ecx
call fcn.0049e108
add esp, 4
cmp eax, 0xc8
je 0x40faf4
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
jmp 0x40f9e9
lea ecx, [ebp - 0x80]
push ecx
mov eax, 0x4c7eec
call fcn.0040ae50
mov esi, dword [ebp - 0xe0]
lea edx, [ebp - 0xf0]
push edx
push 1
lea eax, [ebp - 0xd9]
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40fb87
cmp dword [ebp - 0xf0], 1
jne 0x40fb87
movsx cx, byte [ebp - 0xd9]
or edx, 0xffffffff
sub edx, dword [ebp - 0x6c]
movzx esi, cx
cmp edx, 1
ja 0x40fb47
call fcn.004b6f2a
mov edi, dword [ebp - 0x6c]
inc edi
lea eax, [ebp - 0x80]
call fcn.00403390
cmp al, bl
je 0x40fb02
mov eax, dword [ebp - 0x7c]
mov ecx, 8
cmp dword [ebp - 0x68], ecx
jae 0x40fb67
lea eax, [ebp - 0x7c]
mov edx, dword [ebp - 0x6c]
mov word [eax + edx*2], si
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x6c], edi
cmp dword [ebp - 0x68], ecx
jae 0x40fb7c
lea eax, [ebp - 0x7c]
xor ecx, ecx
mov word [eax + edi*2], cx
jmp 0x40fb02
mov edi, dword [ebp - 0xec]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
mov edx, dword [ebp - 0xe4]
push edx
call esi
mov esi, dword [ebp - 0xd8]
xor eax, eax
mov edi, 7
mov dword [esi + 0x18], edi
mov dword [esi + 0x14], ebx
push 0xffffffffffffffff
mov word [esi + 4], ax
push ebx
lea eax, [ebp - 0x80]
mov ecx, esi
call fcn.004030c0
cmp dword [ebp - 0x84], 8
jb 0x40fbde
mov ecx, dword [ebp - 0x98]
push ecx
call fcn.0047cc0e
add esp, 4
xor edx, edx
cmp dword [ebp - 0x68], 8
mov dword [ebp - 0x84], edi
mov dword [ebp - 0x88], ebx
mov word [ebp - 0x98], dx
jb 0x40fc05
mov eax, dword [ebp - 0x7c]
push eax
call fcn.0047cc0e
add esp, 4
xor ecx, ecx
cmp dword [ebp - 0xa0], 8
mov dword [ebp - 0x68], edi
mov dword [ebp - 0x6c], ebx
mov word [ebp - 0x7c], cx
jb 0x40fc29
mov edx, dword [ebp - 0xb4]
push edx
call fcn.0047cc0e
add esp, 4
xor eax, eax
cmp dword [ebp - 0xbc], 8
mov dword [ebp - 0xa0], edi
mov dword [ebp - 0xa4], ebx
mov word [ebp - 0xb4], ax
jb 0x40fc56
mov ecx, dword [ebp - 0xd0]
push ecx
call fcn.0047cc0e
add esp, 4
xor edx, edx
cmp dword [ebp + 0x20], 8
mov dword [ebp - 0xbc], edi
mov dword [ebp - 0xc0], ebx
mov word [ebp - 0xd0], dx
jb 0x40f83b
mov eax, dword [ebp + 0xc]
push eax
call fcn.0047cc0e
add esp, 4
mov eax, esi
jmp 0x40fa38
mov eax, dword [ebp - 0xe0]
inc esi
jmp 0x40fa56
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0xa
lea ecx, [ebp - 0x64]
mov esi, eax
push ecx
push esi
call fcn.0049cb9d
add esp, 0xc
sub esi, 2
je 0x40fd97
sub esi, 0x2efb
je 0x40fd97
mov ecx, dword [ebp - 0xd8]
mov eax, str.permanent_connect_error
call fcn.004034a0
mov esi, 8
cmp dword [ebp - 0x84], esi
jb 0x40fcec
mov edx, dword [ebp - 0x98]
push edx
call fcn.0047cc0e
add esp, 4
xor eax, eax
mov edi, 7
mov dword [ebp - 0x84], edi
mov dword [ebp - 0x88], ebx
mov word [ebp - 0x98], ax
cmp dword [ebp - 0x68], esi
jb 0x40fd17
mov ecx, dword [ebp - 0x7c]
push ecx
call fcn.0047cc0e
add esp, 4
xor edx, edx
mov dword [ebp - 0x68], edi
mov dword [ebp - 0x6c], ebx
mov word [ebp - 0x7c], dx
cmp dword [ebp - 0xa0], esi
jb 0x40fd3a
mov eax, dword [ebp - 0xb4]
push eax
call fcn.0047cc0e
add esp, 4
xor ecx, ecx
mov dword [ebp - 0xa0], edi
mov dword [ebp - 0xa4], ebx
mov word [ebp - 0xb4], cx
cmp dword [ebp - 0xbc], esi
jb 0x40fd66
mov edx, dword [ebp - 0xd0]
push edx
call fcn.0047cc0e
add esp, 4
xor eax, eax
mov dword [ebp - 0xbc], edi
mov dword [ebp - 0xc0], ebx
mov word [ebp - 0xd0], ax
cmp dword [ebp + 0x20], esi
jb 0x40fd8c
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.0047cc0e
add esp, 4
mov eax, dword [ebp - 0xd8]
jmp 0x40fa38
mov esi, dword [ebp - 0xd8]
mov edi, 7
xor edx, edx
mov dword [esi + 0x18], edi
mov dword [esi + 0x14], ebx
push 0x12
mov eax, str.temp_connect_error
mov word [esi + 4], dx
call fcn.004033f0
cmp dword [ebp - 0x84], 8
jb 0x40fdd2
mov eax, dword [ebp - 0x98]
push eax
call fcn.0047cc0e
add esp, 4
xor ecx, ecx
cmp dword [ebp - 0x68], 8
mov dword [ebp - 0x84], edi
mov dword [ebp - 0x88], ebx
mov word [ebp - 0x98], cx
jb 0x40fdf9
mov edx, dword [ebp - 0x7c]
push edx
call fcn.0047cc0e
add esp, 4
xor eax, eax
cmp dword [ebp - 0xa0], 8
mov dword [ebp - 0x68], edi
mov dword [ebp - 0x6c], ebx
mov word [ebp - 0x7c], ax
jb 0x40fe1d
mov ecx, dword [ebp - 0xb4]
push ecx
call fcn.0047cc0e
add esp, 4
xor edx, edx
cmp dword [ebp - 0xbc], 8
mov dword [ebp - 0xa0], edi
mov dword [ebp - 0xa4], ebx
mov word [ebp - 0xb4], dx
jb 0x40fe4a
mov eax, dword [ebp - 0xd0]
push eax
call fcn.0047cc0e
add esp, 4
xor ecx, ecx
cmp dword [ebp + 0x20], 8
mov dword [ebp - 0xbc], edi
mov dword [ebp - 0xc0], ebx
mov word [ebp - 0xd0], cx
jb 0x40f83b
mov edx, dword [ebp + 0xc]
push edx
call fcn.0047cc0e
add esp, 4
mov eax, esi
jmp 0x40fa38