Function at 0x40d340
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 0x42a66c
mov eax, dword fs:[0]
push eax
mov eax, 0x30b0
call fcn.00429430
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 0x40d4f4
cmp eax, ebx
je 0x40d4f4
push 0x7ff
lea eax, [esp + 0x4c5]
push ebx
push eax
mov byte [esp + 0x4cc], bl
call fcn.0041e500
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.0041d8c0
lea edi, [esp + 0x4d8]
add esp, 0x18
sub edi, esi
lea ebp, [ebx + 4]
movsx edx, byte [esi]
push edx
call fcn.0041db9e
add esp, 4
test eax, eax
je 0x40d434
movsx eax, byte [esi]
push eax
call fcn.0041d3cf
add esp, 4
mov byte [edi + esi], al
inc esi
sub ebp, 1
jne 0x40d415
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 0x40d455
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.0040db20
cmp eax, 0xffffffff
jne 0x40d51e
mov esi, 0x10
cmp dword [esp + 0x64], esi
jb 0x40d4aa
mov eax, dword [esp + 0x50]
push eax
call fcn.0041c24c
add esp, 4
mov dword [esp + 0x64], ebp
mov dword [esp + 0x60], ebx
mov byte [esp + 0x50], bl
cmp dword [esp + 0x80], esi
jb 0x40d4cc
mov ecx, dword [esp + 0x6c]
push ecx
call fcn.0041c24c
add esp, 4
mov dword [esp + 0x80], ebp
mov dword [esp + 0x7c], ebx
mov byte [esp + 0x6c], bl
cmp dword [esp + 0x9c], esi
jb 0x40d4f4
mov edx, dword [esp + 0x88]
push edx
call fcn.0041c24c
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.0041c257
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.0040db20
mov edi, eax
cmp edi, 0xffffffff
jne 0x40d5a7
mov esi, 0x10
cmp dword [esp + 0x64], esi
jb 0x40d55c
mov ecx, dword [esp + 0x50]
push ecx
call fcn.0041c24c
add esp, 4
mov dword [esp + 0x64], ebp
mov dword [esp + 0x60], ebx
mov byte [esp + 0x50], bl
cmp dword [esp + 0x80], esi
jb 0x40d57e
mov edx, dword [esp + 0x6c]
push edx
call fcn.0041c24c
add esp, 4
mov dword [esp + 0x80], ebp
mov dword [esp + 0x7c], ebx
mov byte [esp + 0x6c], bl
cmp dword [esp + 0x9c], esi
jb 0x40d4f4
mov eax, dword [esp + 0x88]
push eax
jmp 0x40d4ec
mov ecx, edi
lea esi, [esp + 0x30]
lea edx, [esp + 0x4c]
call fcn.0040c3f0
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 0x40d5ee
mov ecx, dword [esp + 0x34]
push ecx
call fcn.0041c24c
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 0x40d665
cmp dword [esp + 0x64], esi
jb 0x40d632
mov eax, dword [esp + 0x50]
push eax
call fcn.0041c24c
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 0x40d659
mov ecx, dword [esp + 0x6c]
push ecx
call fcn.0041c24c
add esp, 4
mov dword [esp + 0x80], edi
jmp 0x40d4d3
push 0x3ff
lea eax, [esp + 0xcc5]
push ebx
push eax
mov byte [esp + 0xccc], bl
call fcn.0041e500
push 0x3ff
lea ecx, [esp + 0xd1]
push ebx
push ecx
mov byte [esp + 0xd8], bl
call fcn.0041e500
mov eax, dword [esp + 0xa0]
add esp, 0x18
cmp dword [esp + 0x9c], esi
jae 0x40d6b3
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 0x40d701
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 0x40d4f4
mov eax, dword [esp + 0x6c]
cmp dword [esp + 0x80], esi
jae 0x40d712
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 0x40d73c
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebp
call esi
push edi
call esi
jmp 0x40d6de
push ebx
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.WININET.dll_HttpSendRequestA]
test eax, eax
jne 0x40d75c
mov ebx, dword [sym.imp.WININET.dll_InternetCloseHandle]
push ebp
call ebx
push edi
call ebx
push esi
call ebx
jmp 0x40d6de
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 0x40d74b
lea ecx, [esp + 0xa0]
push ecx
call fcn.0041d411
add esp, 4
cmp eax, 0xc8
je 0x40d7f1
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push edi
call esi
push ebp
call esi
jmp 0x40d6de
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 0x40d7dd
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 0x40d852
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 0x40d6de
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 0x40d8d0
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x40d8d0
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 0x40d8d0
mov ecx, dword [esp + 0x20]
add ecx, eax
mov dword [esp + 0x20], ecx
cmp ecx, dword [esp + 0x1c]
jae 0x40d8d0
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 0x40d877
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 0x40d4f6