Function at 0x404140
Capabilities:
Connect to http server
Create http request
Read data from internet
Receive data
Send data
Send http request
Send http request with host header

Disassembly:
push 0x38
mov eax, 0x434520
call fcn.0041f0ed
mov eax, dword [0x44f98c]
xor ebx, ebx
mov edi, 0x44f98c
mov ecx, edi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ebx
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x44], eax
push ebx
push ebx
push ebx
xor esi, esi
inc esi
push esi
push ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x2c], ebx
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebp - 0x28], eax
cmp eax, ebx
jne 0x404220
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x44f98c]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x24], eax
push esi
push str.hqd0__d
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 1
call fcn.004015b8
mov esi, dword [ebp - 0x24]
pop ecx
pop ecx
push esi
lea eax, [ebp - 0x10]
push eax
call fcn.004023cb
mov byte [ebp - 4], 2
push dword [eax]
call fcn.004017a8
mov eax, dword [ebp - 0x10]
pop ecx
add eax, 0xfffffff0
call fcn.00401603
lea eax, [esi - 0x10]
call fcn.00401603
mov esi, dword [ebp + 0x18]
call fcn.00401005
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
cmp dword [ebp - 0x14], ebx
je 0x4041f8
push dword [ebp - 0x14]
call esi
cmp dword [ebp - 0x18], ebx
je 0x404202
push dword [ebp - 0x18]
call esi
cmp dword [ebp - 0x28], ebx
je 0x40420c
push dword [ebp - 0x28]
call esi
mov eax, dword [ebp - 0x44]
add eax, 0xfffffff0
call fcn.00401603
mov eax, dword [ebp - 0x2c]
call fcn.0041f1c5
ret
mov ecx, dword [ebp + 0xc]
cmp ecx, ebx
je 0x40424e
lea edx, [ecx + 2]
mov dword [ebp - 0x24], edx
mov dx, word [ecx]
inc ecx
inc ecx
cmp dx, bx
jne 0x40422d
sub ecx, dword [ebp - 0x24]
sar ecx, 1
je 0x40424e
push ebx
push ebx
push 3
push ebx
push ebx
push 0x1bb
push dword [ebp + 0xc]
jmp 0x40425c
push ebx
push ebx
push 3
push ebx
push ebx
push 0x1bb
push dword [ebp + 8]
push eax
call dword [sym.imp.WININET.dll_InternetConnectW]
mov dword [ebp - 0x18], eax
cmp eax, ebx
jne 0x4042ac
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x44f98c]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x24], eax
push esi
push str.hqd1__d
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 3
call fcn.004015b8
mov esi, dword [ebp - 0x24]
pop ecx
pop ecx
push esi
lea eax, [ebp - 0x10]
push eax
call fcn.004023cb
mov byte [ebp - 4], 4
jmp 0x4041c5
push ebx
push 0x4a83000
push ebx
push ebx
push ebx
push dword [ebp + 0x10]
push 0x438f14
push dword [ebp - 0x18]
call dword [sym.imp.WININET.dll_HttpOpenRequestW]
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x40430f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x44f98c]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x24], eax
push esi
push str.hqd2__d
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 5
call fcn.004015b8
mov esi, dword [ebp - 0x24]
pop ecx
pop ecx
push esi
lea eax, [ebp - 0x10]
push eax
call fcn.004023cb
mov byte [ebp - 4], 6
jmp 0x4041c5
push 4
pop ebx
push ebx
lea ecx, [ebp - 0x30]
push ecx
push 0x41
mov dword [ebp - 0x30], esi
mov esi, dword [sym.imp.WININET.dll_InternetSetOptionA]
push eax
call esi
push ebx
lea eax, [ebp - 0x34]
push eax
push 2
push dword [ebp - 0x14]
mov dword [ebp - 0x34], 0x3e8
call esi
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x20]
push eax
push 0x1f
push dword [ebp - 0x14]
mov dword [ebp - 0x38], ebx
call dword [sym.imp.WININET.dll_InternetQueryOptionW]
or dword [ebp - 0x20], 0x3380
push ebx
lea eax, [ebp - 0x20]
push eax
push 0x1f
push dword [ebp - 0x14]
call dword [sym.imp.WININET.dll_InternetSetOptionW]
mov eax, dword [0x44f98c]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp + 0x14]
mov byte [ebp - 4], 7
mov eax, dword [ecx + 0x18]
mov eax, dword [eax]
mov dword [ebp - 0x3c], eax
mov eax, dword [ecx]
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
mov esi, dword [ecx + 0x18]
mov ecx, dword [ecx]
je 0x404399
cmp dword [ebp - 0x40], ecx
je 0x40439e
call fcn.0041d8de
cmp dword [ebp - 0x3c], esi
je 0x40440e
push str.host
lea esi, [ebp - 0x40]
call fcn.00404563
push eax
call fcn.004025b0
test eax, eax
je 0x4043fe
call fcn.00404563
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0x10]
call fcn.00402dfb
push 0x439000
lea eax, [ebp - 0x10]
push eax
call fcn.00402592
call fcn.00404563
add eax, ebx
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0x10]
call fcn.00402dfb
push 0x439004
lea eax, [ebp - 0x10]
push eax
call fcn.00402592
lea esi, [ebp - 0x40]
call fcn.00403267
mov ecx, dword [ebp + 0x14]
jmp 0x404389
push str.Host:
lea eax, [ebp - 0x10]
push eax
call fcn.00402592
push dword [ebp + 8]
lea eax, [ebp - 0x10]
push eax
call fcn.00402592
mov eax, dword [ebp - 0x10]
mov eax, dword [eax - 0xc]
push 0
push 0
push eax
lea esi, [ebp - 0x10]
call fcn.00402768
push eax
push dword [ebp - 0x14]
call dword [sym.imp.WININET.dll_HttpSendRequestW]
test eax, eax
jne 0x4044b3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x44f98c]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x24], eax
push esi
push str.hqd3__d
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 8
call fcn.004015b8
mov esi, dword [ebp - 0x24]
pop ecx
pop ecx
push esi
lea eax, [ebp - 0x3c]
push eax
call fcn.004023cb
mov byte [ebp - 4], 9
push dword [eax]
call fcn.004017a8
mov eax, dword [ebp - 0x3c]
pop ecx
add eax, 0xfffffff0
call fcn.00401603
lea eax, [esi - 0x10]
call fcn.00401603
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
call fcn.00401603
xor ebx, ebx
jmp 0x4041e0
and dword [ebp - 0x1c], 0
mov ebx, 0xa000
push ebx
call fcn.00419894
pop ecx
mov dword [ebp - 0x24], eax
test eax, eax
jne 0x40450c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [0x44f98c]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x24], eax
push esi
push str.hqd4__d
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 0xa
call fcn.004015b8
mov esi, dword [ebp - 0x24]
pop ecx
pop ecx
push esi
lea eax, [ebp - 0x3c]
push eax
call fcn.004023cb
mov byte [ebp - 4], 0xb
jmp 0x404486
mov edi, dword [sym.imp.WININET.dll_InternetReadFile]
lea ecx, [ebp - 0x1c]
push ecx
push ebx
push eax
jmp 0x404538
cmp dword [ebp - 0x1c], 0
je 0x404541
mov esi, dword [ebp + 0x18]
push 0
push dword [ebp - 0x1c]
push dword [ebp - 0x24]
call fcn.0040101e
lea eax, [ebp - 0x1c]
push eax
push ebx
push dword [ebp - 0x24]
push dword [ebp - 0x14]
call edi
test eax, eax
jne 0x40451a
push dword [ebp - 0x24]
call fcn.0041cb10
mov eax, dword [ebp - 0x10]
pop ecx
add eax, 0xfffffff0
mov dword [ebp - 0x2c], 1
call fcn.00401603
xor ebx, ebx
jmp 0x4041e8