Function at 0x40d360
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 0x42a63c
mov eax, dword fs:[0]
push eax
mov eax, 0x30b0
call fcn.00429400
mov eax, dword [0x4340a0]
xor eax, esp
mov dword [esp + 0x30ac], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4340a0]
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 0x40d514
cmp eax, ebx
je 0x40d514
push 0x7ff
lea eax, [esp + 0x4c5]
push ebx
push eax
mov byte [esp + 0x4cc], bl
call fcn.0041e4d0
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.0041d890
lea edi, [esp + 0x4d8]
add esp, 0x18
sub edi, esi
lea ebp, [ebx + 4]
movsx edx, byte [esi]
push edx
call fcn.0041db6e
add esp, 4
test eax, eax
je 0x40d454
movsx eax, byte [esi]
push eax
call fcn.0041d39f
add esp, 4
mov byte [edi + esi], al
inc esi
sub ebp, 1
jne 0x40d435
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 0x40d475
sub eax, edx
push eax
lea ecx, [esp + 0x4c4]
push ecx
lea ecx, [esp + 0x54]
call fcn.00404390
push 7
push str.http:__
lea edx, [esp + 0x54]
push edx
mov byte [esp + 0x30d8], 2
call fcn.0040db40
cmp eax, 0xffffffff
jne 0x40d53e
mov esi, 0x10
cmp dword [esp + 0x64], esi
jb 0x40d4ca
mov eax, dword [esp + 0x50]
push eax
call fcn.0041c21c
add esp, 4
mov dword [esp + 0x64], ebp
mov dword [esp + 0x60], ebx
mov byte [esp + 0x50], bl
cmp dword [esp + 0x80], esi
jb 0x40d4ec
mov ecx, dword [esp + 0x6c]
push ecx
call fcn.0041c21c
add esp, 4
mov dword [esp + 0x80], ebp
mov dword [esp + 0x7c], ebx
mov byte [esp + 0x6c], bl
cmp dword [esp + 0x9c], esi
jb 0x40d514
mov edx, dword [esp + 0x88]
push edx
call fcn.0041c21c
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.0041c227
add esp, 0x30bc
ret
add eax, 7
push eax
push ebx
lea ecx, [esp + 0x54]
call fcn.00402c30
push 1
push 0x42e2f4
lea eax, [esp + 0x54]
push eax
call fcn.0040db40
mov edi, eax
cmp edi, 0xffffffff
jne 0x40d5c7
mov esi, 0x10
cmp dword [esp + 0x64], esi
jb 0x40d57c
mov ecx, dword [esp + 0x50]
push ecx
call fcn.0041c21c
add esp, 4
mov dword [esp + 0x64], ebp
mov dword [esp + 0x60], ebx
mov byte [esp + 0x50], bl
cmp dword [esp + 0x80], esi
jb 0x40d59e
mov edx, dword [esp + 0x6c]
push edx
call fcn.0041c21c
add esp, 4
mov dword [esp + 0x80], ebp
mov dword [esp + 0x7c], ebx
mov byte [esp + 0x6c], bl
cmp dword [esp + 0x9c], esi
jb 0x40d514
mov eax, dword [esp + 0x88]
push eax
jmp 0x40d50c
mov ecx, edi
lea esi, [esp + 0x30]
lea edx, [esp + 0x4c]
call fcn.0040c410
push 0xffffffffffffffff
push ebx
push eax
lea ecx, [esp + 0x90]
mov byte [esp + 0x30d8], 3
call fcn.00402ec0
mov esi, 0x10
mov byte [esp + 0x30cc], 2
cmp dword [esp + 0x48], esi
jb 0x40d60e
mov ecx, dword [esp + 0x34]
push ecx
call fcn.0041c21c
add esp, 4
push edi
push ebx
lea ecx, [esp + 0x54]
call fcn.00402c30
push 0xffffffffffffffff
push ebx
lea edx, [esp + 0x54]
push edx
lea ecx, [esp + 0x74]
call fcn.00402ec0
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 0x40d685
cmp dword [esp + 0x64], esi
jb 0x40d652
mov eax, dword [esp + 0x50]
push eax
call fcn.0041c21c
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 0x40d679
mov ecx, dword [esp + 0x6c]
push ecx
call fcn.0041c21c
add esp, 4
mov dword [esp + 0x80], edi
jmp 0x40d4f3
push 0x3ff
lea eax, [esp + 0xcc5]
push ebx
push eax
mov byte [esp + 0xccc], bl
call fcn.0041e4d0
push 0x3ff
lea ecx, [esp + 0xd1]
push ebx
push ecx
mov byte [esp + 0xd8], bl
call fcn.0041e4d0
mov eax, dword [esp + 0xa0]
add esp, 0x18
cmp dword [esp + 0x9c], esi
jae 0x40d6d3
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 0x40d721
push ebp
call dword [sym.imp.WININET.dll_InternetCloseHandle]
lea ecx, [esp + 0x4c]
call fcn.00402fa0
lea ecx, [esp + 0x68]
call fcn.00402fa0
lea ecx, [esp + 0x84]
call fcn.00402fa0
jmp 0x40d514
mov eax, dword [esp + 0x6c]
cmp dword [esp + 0x80], esi
jae 0x40d732
lea eax, [esp + 0x6c]
push 0x400000
push ebx
push ebx
push ebx
push ebx
push eax
push 0x42e700
push edi
call dword [sym.imp.WININET.dll_HttpOpenRequestA]
mov esi, eax
cmp esi, ebx
jne 0x40d75c
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebp
call esi
push edi
call esi
jmp 0x40d6fe
push ebx
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x40d77c
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebp
call ebx
push edi
call ebx
push esi
call ebx
jmp 0x40d6fe
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 0x40d76b
lea ecx, [esp + 0xa0]
push ecx
call fcn.0041d3e1
add esp, 4
cmp eax, 0xc8
je 0x40d811
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
push ebp
call esi
jmp 0x40d6fe
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 0x40d7fd
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 0x40d872
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 0x40d6fe
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 0x40d8f0
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x40d8f0
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 0x40d8f0
mov ecx, dword [esp + 0x20]
add ecx, eax
mov dword [esp + 0x20], ecx
cmp ecx, dword [esp + 0x1c]
jae 0x40d8f0
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 0x40d897
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.00402fa0
lea ecx, [esp + 0x68]
call fcn.00402fa0
lea ecx, [esp + 0x84]
call fcn.00402fa0
mov eax, esi
jmp 0x40d516