Function at 0x40cbe8
Capabilities:
Connect to http server
Create http request
Read data from internet
Receive data
Reference http user-agent string
Send data
Send http request
Send http request with host header

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x209
push 0
push 0
dec ecx
jne 0x40cbf1
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x14], edx
mov esi, eax
mov ebx, dword [ebp + 0xc]
xor eax, eax
push ebp
push 0x40cffb
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x15], 0
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xc]
push eax
push 0
push 0
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 4]
xor edx, edx
mov eax, esi
call fcn.0040c2b8
test al, al
je 0x40cfb5
push dword [ebp - 8]
push dword [ebp - 0xc]
push 0x40d01c
push dword [ebp - 0x14]
lea eax, [ebp - 8]
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
xor eax, eax
mov dword [ebp - 0x2c], eax
xor eax, eax
mov dword [ebp - 0x1c], eax
xor eax, eax
mov dword [ebp - 0x20], eax
xor eax, eax
mov dword [ebp - 0x24], eax
xor eax, eax
mov dword [ebp - 0x28], eax
xor eax, eax
push ebp
push 0x40cfae
push dword fs:[eax]
mov dword fs:[eax], esp
push 0
push 0
push 0
push 1
push 0
call sub.wininet.dll_InternetOpenW
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x40cca2
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x40cfb5
push 0
push 0
push 3
push 0
push 0
movzx eax, word [ebp - 0x18]
push eax
mov eax, dword [ebp - 4]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 0x20]
push eax
call sub.wininet.dll_InternetConnectW
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x20], 0
jne 0x40ccd6
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x40cfb5
push 0
push 0x80000000
push 0
mov eax, esi
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0x40d020
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 0x40d034
mov eax, dword [ebp - 0x24]
push eax
call sub.wininet.dll_HttpOpenRequestW
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x40cd16
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x40cfb5
xor ecx, ecx
mov dl, 1
mov eax, dword [sym.imp.rtl120.bpl__Classes_TStringStream_]
call sub.rtl120.bpl__Classes_TStringStream__bctr_qqrx20System_UnicodeString
mov dword [ebp - 0x1c], eax
push 0x40d048
push dword [ebp - 4]
push 0x40d064
lea eax, [ebp - 0x1034]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov edx, dword [ebp - 0x1034]
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
mov edx, 0x40d078
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
mov edx, 0x40d15c
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
mov edx, 0x40d184
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
mov edx, 0x40d1c4
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
mov edx, 0x40d234
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
mov edx, 0x40d274
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
mov edx, 0x40d2a8
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
test edi, edi
jne 0x40cdb9
test ebx, ebx
je 0x40ce42
call sub.rtl120.bpl__Sysutils_TEncoding_GetUTF8_qqrv
push eax
push 1
push edi
push 0x40d2e8
push ebx
lea eax, [ebp - 0x1038]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov ecx, dword [ebp - 0x1038]
mov dl, 1
mov eax, dword [sym.imp.rtl120.bpl__Classes_TStringStream_]
call sub.rtl120.bpl__Classes_TStringStream__bctr_qqrx20System_UnicodeStringp18Sysutils_TEncodingo
mov esi, eax
mov eax, esi
mov edx, dword [eax]
call dword [edx]
mov edx, eax
lea ecx, [ebp - 0x103c]
mov eax, dword [esi + 4]
call fcn.004086d0
mov edx, dword [ebp - 0x103c]
lea eax, [ebp - 0x10]
call sub.rtl120.bpl__System__UStrFromLStr_qqrr20System_UnicodeStringx27System__AnsiStringT_us_i0__
push 0x40d2f8
push dword [ebp - 0x10]
push 0x40d064
lea eax, [ebp - 0x1040]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov edx, dword [ebp - 0x1040]
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
mov eax, esi
call sub.rtl120.bpl__System_TObject_Free_qqrv
mov edx, 0x40d064
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_WriteString_qqrx20System_UnicodeString
push 0x20000000
lea edx, [ebp - 0x1044]
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_GetDataString_qqrv
mov eax, dword [ebp - 0x1044]
call sub.rtl120.bpl__System__UStrLen_qqrx20System_UnicodeString
push eax
lea edx, [ebp - 0x1048]
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__Classes_TStringStream_GetDataString_qqrv
mov eax, dword [ebp - 0x1048]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 0x28]
push eax
call sub.wininet.dll_HttpAddRequestHeadersW
push 0
push 0
push 0
push 0
mov eax, dword [ebp - 0x28]
push eax
call sub.wininet.dll_HttpSendRequestW
cmp eax, 1
sbb eax, eax
inc eax
mov byte [ebp - 0x15], al
cmp dword [ebp + 8], 0
je 0x40cf57
mov dl, 1
mov eax, dword [sym.imp.rtl120.bpl__Classes_TMemoryStream_]
call sub.rtl120.bpl__System_TObject__bctr_qqrv
mov dword [ebp - 0x2c], eax
jmp 0x40cedd
cmp dword [ebp - 0x30], 0
je 0x40cefa
lea edx, [ebp - 0x1030]
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
mov ebx, dword [eax]
call dword [ebx + 0x10]
lea eax, [ebp - 0x30]
push eax
push 0x1000
lea eax, [ebp - 0x1030]
push eax
mov eax, dword [ebp - 0x28]
push eax
call sub.wininet.dll_InternetReadFile
test eax, eax
jne 0x40cec6
mov word [ebp - 0x1030], 0
lea edx, [ebp - 0x1030]
mov ecx, 1
mov eax, dword [ebp - 0x2c]
mov ebx, dword [eax]
call dword [ebx + 0x10]
mov dl, 1
mov eax, dword [sym.imp.rtl120.bpl__Sysutils_TUTF8Encoding_]
call sub.rtl120.bpl__Sysutils_TUTF8Encoding__bctr_qqrv
mov esi, eax
mov eax, dword [ebp - 0x2c]
mov edx, dword [eax]
call dword [edx]
push eax
lea eax, [ebp - 0x104c]
push eax
mov eax, dword [ebp - 0x2c]
mov edx, dword [eax + 4]
xor ecx, ecx
mov eax, esi
call sub.rtl120.bpl__Sysutils_TEncoding_GetString_qqrx25System__DynamicArray_tuc_ii
mov edx, dword [ebp - 0x104c]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov eax, esi
call sub.rtl120.bpl__System_TObject_Free_qqrv
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40cfb5
cmp dword [ebp - 0x2c], 0
je 0x40cf72
lea eax, [ebp - 0x2c]
call sub.rtl120.bpl__Sysutils_FreeAndNil_qqrpv
cmp dword [ebp - 0x1c], 0
je 0x40cf80
lea eax, [ebp - 0x1c]
call sub.rtl120.bpl__Sysutils_FreeAndNil_qqrpv
cmp dword [ebp - 0x28], 0
je 0x40cf8f
mov eax, dword [ebp - 0x28]
push eax
call sub.wininet.dll_InternetCloseHandle
cmp dword [ebp - 0x24], 0
je 0x40cf9e
mov eax, dword [ebp - 0x24]
push eax
call sub.wininet.dll_InternetCloseHandle
cmp dword [ebp - 0x20], 0
je 0x40cfad
mov eax, dword [ebp - 0x20]
push eax
call sub.wininet.dll_InternetCloseHandle
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40d002
lea eax, [ebp - 0x104c]
mov edx, 4
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 0x103c]
call sub.rtl120.bpl__System__LStrClr_qqrpv
lea eax, [ebp - 0x1038]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 0x10]
mov edx, 4
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret