Function at 0x40cd10
Capabilities:
Check http status code
Connect to http server
Create http request
Download and write a file
Get http content length
Read data from internet
Receive and write data from server to client
Receive data
Resolve function by parsing pe exports
Send data
Send http request
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x42883c
mov eax, dword fs:[0]
push eax
mov eax, 0x30b0
call fcn.00427360
mov eax, dword [0x431040]
xor eax, esp
mov dword [esp + 0x30ac], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x431040]
xor eax, esp
push eax
lea eax, [esp + 0x30c4]
mov dword fs:[0], eax
mov eax, dword [esp + 0x30d4]
mov esi, ecx
xor ebx, ebx
mov dword [esp + 0x14], eax
cmp esi, ebx
je 0x40cec4
cmp eax, ebx
je 0x40cec4
push 0x7ff
lea eax, [esp + 0x4c5]
push ebx
push eax
mov byte [esp + 0x4cc], bl
call fcn.0041c570
mov eax, 0xf
mov dword [esp + 0xa8], eax
mov dword [esp + 0xa4], ebx
mov byte [esp + 0x94], bl
mov dword [esp + 0x30d8], ebx
mov dword [esp + 0x8c], eax
mov dword [esp + 0x88], ebx
mov byte [esp + 0x78], bl
push 0x7ff
lea ecx, [esp + 0x4d0]
push esi
push ecx
mov byte [esp + 0x30e4], 1
call fcn.0041b930
lea edi, [esp + 0x4d8]
add esp, 0x18
sub edi, esi
lea ebp, [ebx + 4]
movsx edx, byte [esi]
push edx
call fcn.0041bc0e
add esp, 4
test eax, eax
je 0x40ce04
movsx eax, byte [esi]
push eax
call fcn.0041b441
add esp, 4
mov byte [edi + esi], al
inc esi
sub ebp, 1
jne 0x40cde5
mov ebp, 0xf
lea eax, [esp + 0x4c0]
mov dword [esp + 0x64], ebp
mov dword [esp + 0x60], ebx
mov byte [esp + 0x50], bl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40ce25
sub eax, edx
push eax
lea ecx, [esp + 0x4c4]
push ecx
lea ecx, [esp + 0x54]
call fcn.00403d40
push 7
push str.http:__
lea edx, [esp + 0x54]
push edx
mov byte [esp + 0x30d8], 2
call fcn.0040d530
cmp eax, 0xffffffff
jne 0x40ceee
mov esi, 0x10
cmp dword [esp + 0x64], esi
jb 0x40ce7a
mov eax, dword [esp + 0x50]
push eax
call fcn.0041a2be
add esp, 4
mov dword [esp + 0x64], ebp
mov dword [esp + 0x60], ebx
mov byte [esp + 0x50], bl
cmp dword [esp + 0x80], esi
jb 0x40ce9c
mov ecx, dword [esp + 0x6c]
push ecx
call fcn.0041a2be
add esp, 4
mov dword [esp + 0x80], ebp
mov dword [esp + 0x7c], ebx
mov byte [esp + 0x6c], bl
cmp dword [esp + 0x9c], esi
jb 0x40cec4
mov edx, dword [esp + 0x88]
push edx
call fcn.0041a2be
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x30c4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x30ac]
xor ecx, esp
call fcn.0041a2c9
add esp, 0x30bc
ret
add eax, 7
push eax
push ebx
lea ecx, [esp + 0x54]
call fcn.00402600
push 1
push 0x42c1c0
lea eax, [esp + 0x54]
push eax
call fcn.0040d530
mov edi, eax
cmp edi, 0xffffffff
jne 0x40cf77
mov esi, 0x10
cmp dword [esp + 0x64], esi
jb 0x40cf2c
mov ecx, dword [esp + 0x50]
push ecx
call fcn.0041a2be
add esp, 4
mov dword [esp + 0x64], ebp
mov dword [esp + 0x60], ebx
mov byte [esp + 0x50], bl
cmp dword [esp + 0x80], esi
jb 0x40cf4e
mov edx, dword [esp + 0x6c]
push edx
call fcn.0041a2be
add esp, 4
mov dword [esp + 0x80], ebp
mov dword [esp + 0x7c], ebx
mov byte [esp + 0x6c], bl
cmp dword [esp + 0x9c], esi
jb 0x40cec4
mov eax, dword [esp + 0x88]
push eax
jmp 0x40cebc
mov ecx, edi
lea esi, [esp + 0x30]
lea edx, [esp + 0x4c]
call fcn.0040bdc0
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [esp + 0x90]
mov byte [esp + 0x30d8], 3
call fcn.00402890
mov esi, 0x10
mov byte [esp + 0x30cc], 2
cmp dword [esp + 0x48], esi
jb 0x40cfbe
mov ecx, dword [esp + 0x34]
push ecx
call fcn.0041a2be
add esp, 4
push edi
push ebx
lea ecx, [esp + 0x54]
call fcn.00402600
push 0xffffffffffffffff
push ebx
lea edx, [esp + 0x54]
push edx
lea ecx, [esp + 0x74]
call fcn.00402890
push ebx
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ebp, eax
mov dword [esp + 0x24], ebp
cmp ebp, ebx
jne 0x40d035
cmp dword [esp + 0x64], esi
jb 0x40d002
mov eax, dword [esp + 0x50]
push eax
call fcn.0041a2be
add esp, 4
mov edi, 0xf
mov dword [esp + 0x64], edi
mov dword [esp + 0x60], ebx
mov byte [esp + 0x50], bl
cmp dword [esp + 0x80], esi
jb 0x40d029
mov ecx, dword [esp + 0x6c]
push ecx
call fcn.0041a2be
add esp, 4
mov dword [esp + 0x80], edi
jmp 0x40cea3
push 0x3ff
lea eax, [esp + 0xcc5]
push ebx
push eax
mov byte [esp + 0xccc], bl
call fcn.0041c570
push 0x3ff
lea ecx, [esp + 0xd1]
push ebx
push ecx
mov byte [esp + 0xd8], bl
call fcn.0041c570
mov eax, dword [esp + 0xa0]
add esp, 0x18
cmp dword [esp + 0x9c], esi
jae 0x40d083
lea eax, [esp + 0x88]
push ebx
push ebx
push 3
lea edx, [esp + 0xcc]
push edx
lea ecx, [esp + 0xcd0]
push ecx
push 0x50
push eax
push ebp
call dword [sym.imp.WININET.dll_InternetConnectA]
mov edi, eax
cmp edi, ebx
jne 0x40d0d1
push ebp
call dword [sym.imp.WININET.dll_InternetCloseHandle]
lea ecx, [esp + 0x4c]
call fcn.00402970
lea ecx, [esp + 0x68]
call fcn.00402970
lea ecx, [esp + 0x84]
call fcn.00402970
jmp 0x40cec4
mov eax, dword [esp + 0x6c]
cmp dword [esp + 0x80], esi
jae 0x40d0e2
lea eax, [esp + 0x6c]
push 0x400000
push ebx
push ebx
push ebx
push ebx
push eax
push 0x42c5b4
push edi
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov esi, eax
cmp esi, ebx
jne 0x40d10c
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebp
call esi
push edi
call esi
jmp 0x40d0ae
push ebx
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x40d12c
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebp
call ebx
push edi
call ebx
push esi
call ebx
jmp 0x40d0ae
push ebx
lea edx, [esp + 0x30]
push edx
lea eax, [esp + 0xa8]
push eax
push 0x13
push esi
mov byte [esp + 0xb4], bl
mov dword [esp + 0xb5], ebx
mov dword [esp + 0xb9], ebx
mov dword [esp + 0xbd], ebx
mov dword [esp + 0xc1], ebx
mov dword [esp + 0xc5], ebx
mov dword [esp + 0xc9], ebx
mov dword [esp + 0xcd], ebx
mov word [esp + 0xd1], bx
mov byte [esp + 0xd3], bl
mov dword [esp + 0x40], 0x20
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x40d11b
lea ecx, [esp + 0xa0]
push ecx
call fcn.0041b483
add esp, 4
cmp eax, 0xc8
je 0x40d1c1
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
push ebp
call esi
jmp 0x40d0ae
push ebx
lea edx, [esp + 0x2c]
push edx
lea eax, [esp + 0x24]
push eax
push 0x20000005
push esi
mov dword [esp + 0x30], ebx
mov dword [esp + 0x3c], 4
call dword [sym.imp.WININET.dll_HttpQueryInfoA]
test eax, eax
je 0x40d1ad
mov ecx, dword [esp + 0x14]
push ebx
push 0x80
push 2
push ebx
push 1
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x40d222
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
mov edx, dword [esp + 0x24]
push edx
call esi
jmp 0x40d0ae
lea eax, [esp + 0x18]
push eax
push 0x2000
lea ecx, [esp + 0x10c8]
push ecx
push esi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x30], ebx
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
je 0x40d2a0
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x40d2a0
push ebx
lea edx, [esp + 0x18]
push edx
push eax
lea eax, [esp + 0x10cc]
push eax
push ebp
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x14], eax
jne 0x40d2a0
mov ecx, dword [esp + 0x20]
add ecx, eax
mov dword [esp + 0x20], ecx
cmp ecx, dword [esp + 0x1c]
jae 0x40d2a0
lea ecx, [esp + 0x18]
push ecx
push 0x2000
lea edx, [esp + 0x10c8]
push edx
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
test eax, eax
jne 0x40d247
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
mov eax, dword [esp + 0x24]
push eax
call esi
mov edx, dword [esp + 0x20]
xor ecx, ecx
cmp edx, dword [esp + 0x1c]
sete cl
mov esi, ecx
lea ecx, [esp + 0x4c]
call fcn.00402970
lea ecx, [esp + 0x68]
call fcn.00402970
lea ecx, [esp + 0x84]
call fcn.00402970
mov eax, esi
jmp 0x40cec6