Function at 0x5a15f4
Capabilities:
Check http status code
Connect to http server
Create http request
Read data from internet
Receive data
Send data
Send http request

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x99
push 0
push 0
dec ecx
jne 0x5a15fd
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
mov esi, ecx
mov byte [ebp - 0x21], dl
mov edi, eax
mov eax, dword [ebp + 8]
test eax, eax
je 0x5a161c
xor edx, edx
mov dword [eax], edx
xor eax, eax
push ebp
push 0x5a1eda
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 0x22], 0
xor eax, eax
mov dword [ebp - 0x3c], eax
xor eax, eax
mov dword [ebp - 0x40], eax
xor eax, eax
mov dword [ebp - 0x44], eax
mov dword [edi + 0x44], 0xffffffff
xor eax, eax
push ebp
push 0x5a1e7d
push dword fs:[eax]
mov dword fs:[eax], esp
movzx eax, byte [edi + 0x60]
sub al, 1
jb 0x5a1662
je 0x5a167d
dec al
je 0x5a1698
jmp 0x5a16dc
push 0
push 0
push 0
push 0
mov eax, dword [edi + 0x58]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.wininet.dll_InternetOpenW
mov dword [ebp - 0x3c], eax
jmp 0x5a16f3
push 0
push 0
push 0
push 1
mov eax, dword [edi + 0x58]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
call sub.wininet.dll_InternetOpenW
mov dword [ebp - 0x3c], eax
jmp 0x5a16f3
push dword [edi + 0x64]
push 0x5a1efc
lea edx, [ebp - 0x450]
mov eax, dword [edi + 0x70]
call sub.rtl120.bpl__Sysutils_IntToStr_qqri
push dword [ebp - 0x450]
lea eax, [ebp - 0x20]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
push 0
push 0
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
push 3
push 0
call sub.wininet.dll_InternetOpenW
mov dword [ebp - 0x3c], eax
jmp 0x5a16f3
mov eax, dword [ebp + 8]
mov edx, 0x5a1f0c
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
cmp dword [ebp - 0x3c], 0
jne 0x5a1761
call sub.kernel32.dll_GetLastError
mov ebx, eax
lea eax, [ebp - 0x454]
push eax
mov dword [ebp - 0x464], ebx
mov byte [ebp - 0x460], 0
lea edx, [ebp - 0x468]
mov eax, ebx
call fcn.005a11c0
mov eax, dword [ebp - 0x468]
mov dword [ebp - 0x45c], eax
mov byte [ebp - 0x458], 0x11
lea edx, [ebp - 0x464]
mov ecx, 1
mov eax, 0x5a1f48
call sub.rtl120.bpl__Sysutils_Format_qqrx20System_UnicodeStringpx14System_TVarRecxi
mov edx, dword [ebp - 0x454]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
mov dword [ebp - 0x48], 0xffffffff
push 4
lea eax, [ebp - 0x48]
push eax
push 0x4d
mov eax, dword [ebp - 0x3c]
push eax
call sub.wininet.dll_InternetSetOptionW
cmp byte [edi + 0xd], 0
je 0x5a1796
mov eax, dword [ebp + 8]
mov edx, 0x5a1f94
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
lea eax, [ebp - 8]
call sub.rtl120.bpl__System__UStrClr_qqrpv
push eax
lea eax, [ebp - 0x10]
call sub.rtl120.bpl__System__UStrClr_qqrpv
push eax
lea eax, [ebp - 0x14]
call sub.rtl120.bpl__System__UStrClr_qqrpv
push eax
lea eax, [ebp - 0x18]
call sub.rtl120.bpl__System__UStrClr_qqrpv
push eax
lea eax, [ebp - 0x1c]
call sub.rtl120.bpl__System__UStrClr_qqrpv
push eax
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__UStrClr_qqrpv
mov ecx, eax
mov edx, dword [edi + 0x5c]
mov eax, edi
call fcn.005a1414
lea edx, [ebp - 0xc]
mov eax, dword [ebp - 8]
call fcn.005a10b0
cmp dword [ebp - 0xc], 0
jne 0x5a1808
lea eax, [ebp - 0x46c]
mov ecx, dword [ebp - 8]
mov edx, 0x5a1fe0
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x46c]
call fcn.005a1028
jmp 0x5a1833
push 0x5a201c
push dword [ebp - 0xc]
push 0x5a2048
push dword [ebp - 8]
lea eax, [ebp - 0x470]
mov edx, 4
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 0x470]
call fcn.005a1028
push 0
push 0
push 3
push 0
push 0
push 0x50
mov eax, dword [ebp - 8]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 0x3c]
push eax
call sub.wininet.dll_InternetConnectW
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
jne 0x5a18c2
call sub.kernel32.dll_GetLastError
mov ebx, eax
lea eax, [ebp - 0x474]
push eax
mov dword [ebp - 0x464], ebx
mov byte [ebp - 0x460], 0
lea edx, [ebp - 0x478]
mov eax, ebx
call fcn.005a11c0
mov eax, dword [ebp - 0x478]
mov dword [ebp - 0x45c], eax
mov byte [ebp - 0x458], 0x11
lea edx, [ebp - 0x464]
mov ecx, 1
mov eax, 0x5a205c
call sub.rtl120.bpl__Sysutils_Format_qqrx20System_UnicodeStringpx14System_TVarRecxi
mov edx, dword [ebp - 0x474]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
movzx eax, byte [edi + 0x60]
sub al, 2
je 0x5a18cf
jmp 0x5a19c1
cmp dword [edi + 0x68], 0
je 0x5a1948
mov eax, dword [edi + 0x68]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ebx, eax
mov eax, ebx
call sub.rtl120.bpl__System__PWCharLen_qqrpb
inc eax
push eax
push ebx
push 0x2b
mov eax, dword [ebp - 0x40]
push eax
call sub.wininet.dll_InternetSetOptionW
test eax, eax
jne 0x5a1948
push 0x5a20b0
call sub.kernel32.dll_GetLastError
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x480]
call sub.rtl120.bpl__Sysutils_IntToStr_qqrj
push dword [ebp - 0x480]
call sub.kernel32.dll_GetLastError
lea edx, [ebp - 0x484]
call sub.rtl120.bpl__Sysutils_SysErrorMessage_qqrui
push dword [ebp - 0x484]
lea eax, [ebp - 0x47c]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 0x47c]
call fcn.005a1028
cmp dword [edi + 0x6c], 0
je 0x5a19c1
mov eax, dword [edi + 0x6c]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
mov ebx, eax
mov eax, ebx
call sub.rtl120.bpl__System__PWCharLen_qqrpb
inc eax
push eax
push ebx
push 0x2c
mov eax, dword [ebp - 0x40]
push eax
call sub.wininet.dll_InternetSetOptionW
test eax, eax
jne 0x5a19c1
push 0x5a2100
call sub.kernel32.dll_GetLastError
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x48c]
call sub.rtl120.bpl__Sysutils_IntToStr_qqrj
push dword [ebp - 0x48c]
call sub.kernel32.dll_GetLastError
lea edx, [ebp - 0x490]
call sub.rtl120.bpl__Sysutils_SysErrorMessage_qqrui
push dword [ebp - 0x490]
lea eax, [ebp - 0x488]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
mov eax, dword [ebp - 0x488]
call fcn.005a1028
cmp byte [edi + 0xd], 0
je 0x5a19de
mov eax, dword [ebp + 8]
mov edx, 0x5a1f94
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
mov ebx, 0x84000103
movzx eax, byte [ebp - 0x21]
sub al, 1
jb 0x5a19f7
jne 0x5a1a01
mov eax, 0x5a2144
mov dword [ebp - 0x28], eax
jmp 0x5a1a2d
mov eax, 0x5a214c
mov dword [ebp - 0x28], eax
jmp 0x5a1a2d
lea edx, [ebp - 0x494]
movzx eax, byte [ebp - 0x21]
call sub.rtl120.bpl__Sysutils_IntToStr_qqri
mov ecx, dword [ebp - 0x494]
mov eax, dword [ebp + 8]
mov edx, 0x5a2164
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
push 0
push ebx
push 0
push 0
push 0
lea eax, [ebp - 0x498]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
mov eax, dword [ebp - 0x498]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [ebp - 0x40]
push eax
call sub.wininet.dll_HttpOpenRequestW
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
jne 0x5a1ad1
call sub.kernel32.dll_GetLastError
mov ebx, eax
lea eax, [ebp - 0x49c]
push eax
mov dword [ebp - 0x464], ebx
mov byte [ebp - 0x460], 0
lea edx, [ebp - 0x4a0]
mov eax, ebx
call fcn.005a11c0
mov eax, dword [ebp - 0x4a0]
mov dword [ebp - 0x45c], eax
mov byte [ebp - 0x458], 0x11
lea edx, [ebp - 0x464]
mov ecx, 1
mov eax, 0x5a2194
call sub.rtl120.bpl__Sysutils_Format_qqrx20System_UnicodeStringpx14System_TVarRecxi
mov edx, dword [ebp - 0x49c]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
cmp byte [edi + 0xd], 0
je 0x5a1aee
mov eax, dword [ebp + 8]
mov edx, 0x5a1f94
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
cmp dword [edi + 0x48], 0
je 0x5a1b84
push 0xa0000000
mov eax, dword [edi + 0x48]
call sub.rtl120.bpl__System__UStrLen_qqrx20System_UnicodeString
push eax
mov eax, dword [edi + 0x48]
call sub.rtl120.bpl__System__UStrToPWChar_qqrx20System_UnicodeString
push eax
mov eax, dword [ebp - 0x44]
push eax
call sub.wininet.dll_HttpAddRequestHeadersW
test eax, eax
jne 0x5a1b84
call sub.kernel32.dll_GetLastError
mov ebx, eax
lea eax, [ebp - 0x4a4]
push eax
mov dword [ebp - 0x464], ebx
mov byte [ebp - 0x460], 0
lea edx, [ebp - 0x4a8]
mov eax, ebx
call fcn.005a11c0
mov eax, dword [ebp - 0x4a8]
mov dword [ebp - 0x45c], eax
mov byte [ebp - 0x458], 0x11
lea edx, [ebp - 0x464]
mov ecx, 1
mov eax, 0x5a21e8
call sub.rtl120.bpl__Sysutils_Format_qqrx20System_UnicodeStringpx14System_TVarRecxi
mov edx, dword [ebp - 0x4a4]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
mov eax, esi
call sub.rtl120.bpl__System__UStrLen_qqrx20System_UnicodeString
push eax
lea eax, [ebp - 0x4ac]
mov edx, esi
mov ecx, 0
call sub.rtl120.bpl__System__LStrFromUStr_qqrr27System__AnsiStringT_us_i0__x20System_UnicodeStringus
mov eax, dword [ebp - 0x4ac]
push eax
push 0
push 0
mov eax, dword [ebp - 0x44]
push eax
call sub.wininet.dll_HttpSendRequestW
test eax, eax
jne 0x5a1c1e
call sub.kernel32.dll_GetLastError
mov ebx, eax
lea eax, [ebp - 0x4b0]
push eax
mov dword [ebp - 0x464], ebx
mov byte [ebp - 0x460], 0
lea edx, [ebp - 0x4b4]
mov eax, ebx
call fcn.005a11c0
mov eax, dword [ebp - 0x4b4]
mov dword [ebp - 0x45c], eax
mov byte [ebp - 0x458], 0x11
lea edx, [ebp - 0x464]
mov ecx, 1
mov eax, 0x5a2248
call sub.rtl120.bpl__Sysutils_Format_qqrx20System_UnicodeStringpx14System_TVarRecxi
mov edx, dword [ebp - 0x4b0]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
cmp byte [edi + 0xd], 0
je 0x5a1c3b
mov eax, dword [ebp + 8]
mov edx, 0x5a1f94
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
xor eax, eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x38], 4
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x2c]
push eax
push 0x20000013
mov eax, dword [ebp - 0x44]
push eax
call sub.wininet.dll_HttpQueryInfoW
test eax, eax
jne 0x5a1ccd
call sub.kernel32.dll_GetLastError
mov ebx, eax
lea eax, [ebp - 0x4b8]
push eax
mov dword [ebp - 0x464], ebx
mov byte [ebp - 0x460], 0
lea edx, [ebp - 0x4bc]
mov eax, ebx
call fcn.005a11c0
mov eax, dword [ebp - 0x4bc]
mov dword [ebp - 0x45c], eax
mov byte [ebp - 0x458], 0x11
lea edx, [ebp - 0x464]
mov ecx, 1
mov eax, 0x5a229c
call sub.rtl120.bpl__Sysutils_Format_qqrx20System_UnicodeStringpx14System_TVarRecxi
mov edx, dword [ebp - 0x4b8]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
mov eax, dword [ebp - 0x2c]
mov dword [edi + 0x44], eax
cmp dword [ebp - 0x2c], 0xc8
je 0x5a1d0b
mov eax, dword [ebp - 0x2c]
xor edx, edx
push edx
push eax
lea eax, [ebp - 0x4c0]
call sub.rtl120.bpl__Sysutils_IntToStr_qqrj
mov ecx, dword [ebp - 0x4c0]
mov eax, dword [ebp + 8]
mov edx, 0x5a22ec
call sub.rtl120.bpl__System__UStrCat3_qqrr20System_UnicodeStringx20System_UnicodeStringt2
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
mov dword [ebp - 0x38], 0x400
lea eax, [ebp - 0x44c]
mov edx, dword [ebp - 0x38]
call fcn.00402518
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 - 0x4c], eax
xor eax, eax
push ebp
push 0x5a1e3b
push dword fs:[eax]
mov dword fs:[eax], esp
cmp byte [edi + 0xd], 0
je 0x5a1d61
mov eax, dword [ebp + 8]
mov edx, 0x5a1f94
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x38]
push eax
lea eax, [ebp - 0x44c]
push eax
mov eax, dword [ebp - 0x44]
push eax
call sub.wininet.dll_InternetReadFile
test eax, eax
jne 0x5a1dea
call sub.kernel32.dll_GetLastError
mov ebx, eax
lea eax, [ebp - 0x4c4]
push eax
mov dword [ebp - 0x464], ebx
mov byte [ebp - 0x460], 0
lea edx, [ebp - 0x4c8]
mov eax, ebx
call fcn.005a11c0
mov eax, dword [ebp - 0x4c8]
mov dword [ebp - 0x45c], eax
mov byte [ebp - 0x458], 0x11
lea edx, [ebp - 0x464]
mov ecx, 1
mov eax, 0x5a2324
call sub.rtl120.bpl__Sysutils_Format_qqrx20System_UnicodeStringpx14System_TVarRecxi
mov edx, dword [ebp - 0x4c4]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x5a1e84
lea edx, [ebp - 0x44c]
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x4c]
call sub.rtl120.bpl__Classes_TStream_WriteBuffer_qqrpxvi
cmp dword [ebp - 0x30], 0
jne 0x5a1d3f
lea edx, [ebp - 0x4cc]
mov eax, dword [ebp - 0x4c]
call sub.rtl120.bpl__Classes_TStringStream_GetDataString_qqrv
mov edx, dword [ebp - 0x4cc]
mov eax, dword [ebp + 8]
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
mov byte [ebp - 0x22], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5a1e42
mov eax, dword [ebp - 0x4c]
call sub.rtl120.bpl__System_TObject_Free_qqrv
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5a1ee1
lea eax, [ebp - 0x4cc]
mov edx, 8
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 0x4ac]
call sub.rtl120.bpl__System__LStrClr_qqrpv
lea eax, [ebp - 0x4a8]
mov edx, 0x11
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 0x454]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
lea eax, [ebp - 0x20]
mov edx, 8
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret