Function at 0x4666bc
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
Send data
Send http request
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffbc
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ecx
mov edi, edx
mov esi, eax
xor eax, eax
push ebp
push 0x466e4e
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 0xc], eax
lea eax, [esi + 0x48]
call fcn.00404ad8
mov dword [esi + 0x54], 0x3e7
mov dword [esi + 0x58], 0x3e7
mov dword [esi + 0x50], 0xffffffff
cmp dword [esi + 0x40], 0
je 0x46672c
mov edx, dword [esi + 0x40]
mov eax, dword [esi + 0x10]
call fcn.0045be5c
lea eax, [esi + 0x40]
call fcn.00404ad8
mov edx, edi
mov eax, dword [esi + 0x10]
call fcn.0045be5c
test al, al
je 0x466e1d
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 8]
mov edx, dword [esi + 0x10]
mov edx, dword [edx + 0x1c]
call fcn.00404ef4
jne 0x466765
mov eax, dword [esi + 0x10]
mov ax, word [eax + 0xc]
mov edx, dword [esi + 0x10]
cmp ax, word [edx + 0xe]
je 0x466852
mov eax, esi
call fcn.00467234
push 0
push 0
push 0
push 0
mov eax, dword [esi + 0x2c]
call fcn.00404fa8
push eax
call sub.wininet.dll_InternetOpenA
mov dword [esi + 0x18], eax
cmp dword [esi + 0x18], 0
jne 0x466797
mov dword [esi + 0x58], 0x37a
jmp 0x466d89
push 0x465834
mov eax, dword [esi + 0x18]
push eax
call sub.wininet.dll_InternetSetStatusCallback
cmp byte [esi + 0x78], 0
je 0x4667f8
mov eax, 0x465834
test eax, eax
jns 0x4667b9
call fcn.00403c14
push eax
push 0
push 3
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0x14]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0x10]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x10]
mov ax, word [eax + 0xc]
push eax
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 8]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x18]
push eax
call sub.wininet.dll_InternetConnectA
mov dword [esi + 0x1c], eax
jmp 0x466840
mov eax, 0x465834
test eax, eax
jns 0x466806
call fcn.00403c14
push eax
push 0
push 3
mov eax, dword [esi + 0x80]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x7c]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x10]
mov ax, word [eax + 0xc]
push eax
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 8]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x18]
push eax
call sub.wininet.dll_InternetConnectA
mov dword [esi + 0x1c], eax
cmp dword [esi + 0x1c], 0
jne 0x466852
mov dword [esi + 0x58], 0x384
jmp 0x466d89
imul eax, dword [esi + 0x4c], 0x3e8
jno 0x466860
call fcn.00403c1c
test eax, eax
jns 0x466869
call fcn.00403c14
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
push 2
mov eax, dword [esi + 0x1c]
push eax
call sub.wininet.dll_InternetQueryOptionA
push 4
lea eax, [ebp - 0x14]
push eax
push 2
mov eax, dword [esi + 0x1c]
push eax
call sub.wininet.dll_InternetSetOptionA
push 4
lea eax, [ebp - 0x14]
push eax
push 6
mov eax, dword [esi + 0x1c]
push eax
call sub.wininet.dll_InternetSetOptionA
cmp byte [esi + 0x14], 0
je 0x4668b6
lea eax, [ebp - 0x10]
mov edx, 0x466e6c
call fcn.00404b70
jmp 0x4668d8
cmp dword [ebp - 8], 0
jne 0x4668cb
lea eax, [ebp - 0x10]
mov edx, 0x466e7c
call fcn.00404b70
jmp 0x4668d8
lea eax, [ebp - 0x10]
mov edx, 0x466e6c
call fcn.00404b70
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 4]
mov edx, 0x466e88
call fcn.00404ef4
jne 0x4668f3
mov dword [ebp - 0x2c], 0x80f000
jmp 0x4668f8
xor eax, eax
mov dword [ebp - 0x2c], eax
or dword [ebp - 0x2c], 0x80000000
cmp dword [esi + 8], 0
je 0x46690c
or dword [ebp - 0x2c], 0x80000
cmp byte [esi + 0x24], 0
jne 0x466919
or dword [ebp - 0x2c], 0x4000000
cmp byte [esi + 4], 0
je 0x466926
or dword [ebp - 0x2c], 0x400000
cmp byte [esi + 5], 0
jne 0x466933
or dword [ebp - 0x2c], 0x200000
mov eax, dword [esi + 0x84]
mov dword [ebp - 0x30], eax
sub dword [ebp - 0x30], 1
jno 0x466947
call fcn.00403c1c
mov eax, 0x465834
test eax, eax
jns 0x466955
call fcn.00403c14
push eax
mov eax, dword [ebp - 0x2c]
push eax
lea eax, [esi + 0x28]
push eax
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0x20]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x30]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0x18]
call fcn.00404fa8
push eax
mov eax, dword [ebp - 0x10]
call fcn.00404fa8
push eax
mov eax, dword [esi + 0x1c]
push eax
call sub.wininet.dll_HttpOpenRequestA
mov dword [esi + 0x20], eax
cmp dword [esi + 0x20], 0
jne 0x4669a6
mov dword [esi + 0x58], 0x38e
jmp 0x466a55
lea edx, [ebp - 0x34]
mov eax, dword [esi + 0x20]
call fcn.0046581c
mov edx, dword [ebp - 0x34]
mov eax, dword [0x495ef8]
call fcn.0046565c
test eax, eax
jne 0x4669dc
lea edx, [ebp - 0x38]
mov eax, dword [esi + 0x20]
call fcn.0046581c
mov edx, dword [ebp - 0x38]
mov ecx, esi
mov eax, dword [0x495ef8]
call fcn.00465530
mov edx, dword [esi + 0x20]
mov eax, esi
call fcn.004675f4
mov eax, dword [ebp - 0x10]
mov edx, 0x466e7c
call fcn.00404ef4
jne 0x466a0e
push 0
push 0
push 0
push 0
mov eax, dword [esi + 0x20]
push eax
call sub.wininet.dll_HttpSendRequestA
cmp eax, 1
sbb ebx, ebx
inc ebx
jmp 0x466a3c
mov eax, dword [ebp - 8]
call fcn.00404da8
test eax, eax
jns 0x466a1f
call fcn.00403c14
push eax
mov eax, dword [ebp - 8]
call fcn.00404fa8
push eax
push 0
push 0
mov eax, dword [esi + 0x20]
push eax
call sub.wininet.dll_HttpSendRequestA
cmp eax, 1
sbb ebx, ebx
inc ebx
cmp dword [ebp - 0x30], 1
jl 0x466a55
test bl, bl
jne 0x466a4d
push 0x64
call sub.kernel32.dll_Sleep_1
test bl, bl
je 0x46693c
test bl, bl
jne 0x466a65
mov dword [esi + 0x58], 0x398
jmp 0x466d89
mov edx, dword [esi + 0x20]
mov eax, esi
call fcn.00467344
cmp dword [esi + 8], 0
je 0x466a89
lea edx, [ebp - 0x3c]
mov eax, esi
call fcn.00467330
mov edx, dword [ebp - 0x3c]
mov eax, esi
call fcn.0046743c
xor eax, eax
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
push 0x20000013
mov eax, dword [esi + 0x20]
push eax
call sub.wininet.dll_HttpQueryInfoA
cmp eax, 1
sbb ebx, ebx
inc ebx
test bl, bl
jne 0x466aed
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x7a
jne 0x466aed
mov dword [ebp - 0x18], 4
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
push 0x20000013
mov eax, dword [esi + 0x20]
push eax
call sub.wininet.dll_HttpQueryInfoA
cmp eax, 1
sbb ebx, ebx
inc ebx
mov eax, dword [ebp - 0x14]
test eax, eax
jns 0x466af9
call fcn.00403c14
mov dword [esi + 0x54], eax
test bl, bl
je 0x466b12
cmp dword [ebp - 0x14], 0xc8
jb 0x466b12
cmp dword [ebp - 0x14], 0x12b
jbe 0x466b1e
mov dword [esi + 0x58], 0x3a2
jmp 0x466d89
xor eax, eax
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
push 0x20000005
mov eax, dword [esi + 0x20]
push eax
call sub.wininet.dll_HttpQueryInfoA
cmp eax, 1
sbb ebx, ebx
inc ebx
test bl, bl
jne 0x466b8b
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x7a
jne 0x466b8b
mov dword [ebp - 0x18], 4
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
push 0x20000005
mov eax, dword [esi + 0x20]
push eax
call sub.wininet.dll_HttpQueryInfoA
mov eax, dword [ebp - 0x14]
test eax, eax
jns 0x466b88
call fcn.00403c14
mov dword [esi + 0x50], eax
mov dword [ebp - 0x18], 0x1000
mov eax, dword [ebp - 0x18]
push eax
lea eax, [ebp - 4]
mov ecx, 1
mov edx, dword [0x466688]
call fcn.00405f7c
add esp, 4
cmp dword [ebp + 0xc], 0
je 0x466be4
push 0
push 0x20
push 2
push 0
push 0
push 0x40000000
mov eax, dword [ebp + 0xc]
call fcn.00404fa8
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0xffffffff
jne 0x466be4
mov dword [esi + 0x58], 0x3ac
jmp 0x466d89
lea eax, [esi + 0x48]
call fcn.00404ad8
xor eax, eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 4]
call fcn.00405da0
mov edx, eax
xor eax, eax
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x466c09
cmp eax, dword [ecx - 4]
jb 0x466c0e
call fcn.00403c14
lea eax, [ecx + eax]
xor ecx, ecx
call fcn.004035a4
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 4]
push eax
mov eax, dword [esi + 0x20]
push eax
call sub.wininet.dll_InternetReadFile
cmp eax, 1
sbb ebx, ebx
inc ebx
test bl, bl
jne 0x466c43
mov dword [esi + 0x58], 0x3b6
jmp 0x466d35
cmp dword [ebp - 0x1c], 0
jne 0x466c55
mov dword [esi + 0x58], 0x3b7
jmp 0x466d35
lea eax, [ebp - 0x40]
push eax
mov ecx, dword [ebp - 0x1c]
mov edx, 1
mov eax, dword [ebp - 4]
call fcn.00405008
mov edx, dword [ebp - 0x40]
lea eax, [esi + 0x48]
call fcn.00404db0
cmp dword [ebp + 0xc], 0
je 0x466ce3
push 0
lea eax, [ebp - 0x24]
push eax
mov eax, dword [ebp - 0x1c]
push eax
xor eax, eax
mov edx, dword [ebp - 4]
test edx, edx
je 0x466c92
cmp eax, dword [edx - 4]
jb 0x466c97
call fcn.00403c14
lea eax, [edx + eax]
push eax
mov eax, dword [ebp - 0x20]
push eax
call sub.kernel32.dll_WriteFile_1
mov eax, dword [ebp - 0x24]
add dword [ebp - 0x28], eax
jae 0x466cb1
call fcn.00403c1c
cmp dword [esi + 0x5c], 0
je 0x466cc3
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x24]
call dword [esi + 0x5c]
cmp word [esi + 0x62], 0
je 0x466bf1
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x24]
mov eax, dword [esi + 0x64]
call dword [esi + 0x60]
jmp 0x466bf1
cmp dword [esi + 0x5c], 0
je 0x466d05
mov eax, dword [esi + 0x48]
call fcn.00404da8
mov edx, eax
test edx, edx
jns 0x466cfc
call fcn.00403c14
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x1c]
call dword [esi + 0x5c]
cmp word [esi + 0x62], 0
je 0x466bf1
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [esi + 0x48]
call fcn.00404da8
mov ecx, eax
test ecx, ecx
jns 0x466d27
call fcn.00403c14
mov edx, dword [ebp - 0x1c]
mov eax, dword [esi + 0x64]
call dword [esi + 0x60]
jmp 0x466bf1
cmp dword [ebp + 0xc], 0
je 0x466d44
mov eax, dword [ebp - 0x20]
push eax
call sub.kernel32.dll_CloseHandle_1
cmp dword [ebp - 0x14], 0
jbe 0x466d74
cmp dword [ebp + 0xc], 0
jne 0x466d65
mov eax, dword [esi + 0x48]
call fcn.00404da8
test eax, eax
jle 0x466d7b
mov dword [ebp - 0xc], 0xffffffff
jmp 0x466d7b
cmp dword [ebp - 0x28], 0
jbe 0x466d7b
mov dword [ebp - 0xc], 0xffffffff
jmp 0x466d7b
mov dword [ebp - 0xc], 0xffffffff
cmp dword [esi + 0x58], 0x3b7
jne 0x466d89
xor eax, eax
mov dword [esi + 0x58], eax
mov eax, dword [ebp - 4]
call fcn.00405da0
test eax, eax
jle 0x466dbc
mov eax, dword [ebp - 4]
call fcn.00405da0
mov edx, eax
xor eax, eax
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x466dad
cmp eax, dword [ecx - 4]
jb 0x466db2
call fcn.00403c14
lea eax, [ecx + eax]
xor ecx, ecx
call fcn.004035a4
push 0
lea eax, [ebp - 4]
mov ecx, 1
mov edx, dword [0x466688]
call fcn.00405f7c
add esp, 4
lea edx, [ebp - 0x44]
mov eax, dword [esi + 0x20]
call fcn.0046581c
mov edx, dword [ebp - 0x44]
mov eax, dword [0x495ef8]
call fcn.004656c8
mov eax, dword [esi + 0x20]
push eax
call sub.wininet.dll_InternetCloseHandle
cmp dword [ebp - 0xc], 0
je 0x466e1d
cmp dword [esi + 0x68], 0
je 0x466e0a
lea edx, [esi + 0x48]
mov eax, dword [esi + 0x48]
call dword [esi + 0x68]
cmp word [esi + 0x72], 0
je 0x466e1d
lea ecx, [esi + 0x48]
mov edx, dword [esi + 0x48]
mov eax, dword [esi + 0x74]
call dword [esi + 0x70]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x466e55
lea eax, [ebp - 0x44]
mov edx, 5
call fcn.00404afc
lea eax, [ebp - 0x10]
call fcn.00404ad8
lea eax, [ebp - 4]
mov edx, dword [0x466688]
call fcn.00405f88
ret