Function at 0x5982bdf8
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Initialize winsock library
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push ecx
mov ecx, 0x61
push 0
push 0
dec ecx
jne 0x5982be01
push ecx
xchg dword [ebp - 4], ecx
push ebx
push esi
push edi
test dl, dl
je 0x5982be1b
add esp, 0xfffffff0
call sub.rtl120.bpl__System__ClassCreate_qqrp17System_TMetaClasso
mov edi, ecx
mov byte [ebp - 0xd], dl
mov ebx, eax
xor eax, eax
push ebp
push 0x5982c59e
push dword fs:[eax]
mov dword fs:[eax], esp
xor edx, edx
mov eax, ebx
call sub.rtl120.bpl__System_TObject__bctr_qqrv
lea eax, [ebp - 0x1bc]
push eax
push 0x101
call sub.wsock32.dll_WSAStartup
lea eax, [ebx + 4]
mov edx, edi
call sub.rtl120.bpl__System__UStrFromLStr_qqrr20System_UnicodeStringx27System__AnsiStringT_us_i0__
push 0
push 1
push 2
call sub.wsock32.dll_socket
mov esi, eax
mov dword [ebx + 0x50], esi
inc esi
je 0x5982c50c
mov eax, edi
call sub.rtl120.bpl__System__LStrToPChar_qqrx27System__AnsiStringT_us_i0__
push eax
call sub.wsock32.dll_inet_addr
mov esi, eax
cmp esi, 0xffffffff
jne 0x5982be97
mov eax, edi
call sub.rtl120.bpl__System__LStrToPChar_qqrx27System__AnsiStringT_us_i0__
push eax
call sub.wsock32.dll_gethostbyname
test eax, eax
je 0x5982be97
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov esi, dword [eax]
cmp esi, 0xffffffff
je 0x5982c4dc
cmp word [ebp + 0x18], 0
jne 0x5982bed5
cmp byte [ebp + 0x14], 0
je 0x5982beb5
mov word [ebp + 0x18], 0x1d1
jmp 0x5982bed5
cmp byte [ebp + 0x10], 0
je 0x5982becf
cmp dword [ebp + 0xc], 0
jne 0x5982bec7
cmp dword [ebp + 8], 0
je 0x5982becf
mov word [ebp + 0x18], 0x24b
jmp 0x5982bed5
mov word [ebp + 0x18], 0x19
mov word [ebp - 0x2c], 2
movzx eax, word [ebp + 0x18]
push eax
call sub.wsock32.dll_htons
mov word [ebp - 0x2a], ax
mov dword [ebp - 0x28], esi
mov esi, 0x10000
mov dword [ebx + 0x74], esi
push 4
push 0x1000
push esi
push 0
call sub.kernel32.dll_VirtualAlloc
mov dword [ebx + 0x78], eax
mov dword [ebp - 0x14], 1
lea eax, [ebp - 0x14]
push eax
push 0x8004667e
mov eax, dword [ebx + 0x50]
push eax
call sub.wsock32.dll_ioctlsocket
push 0x10
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebx + 0x50]
push eax
call sub.wsock32.dll_connect
mov dword [ebp - 0x2c0], 1
mov eax, dword [ebx + 0x50]
mov dword [ebp - 0x2bc], eax
mov eax, dword [sym.madExcept_.bpl__Madexcept_SmtpTimeout]
mov dword [ebp - 0x1c], eax
xor eax, eax
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x1c]
push eax
push 0
lea eax, [ebp - 0x2c0]
push eax
push 0
push 0
call sub.wsock32.dll_select
test eax, eax
jle 0x5982c4ca
xor eax, eax
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x14]
push eax
push 0x8004667e
mov eax, dword [ebx + 0x50]
push eax
call sub.wsock32.dll_ioctlsocket
cmp byte [ebp + 0x14], 0
je 0x5982bf98
mov eax, ebx
call fcn.5982c894
test al, al
je 0x5982c4b8
cmp dword [sym.madExcept_.bpl__Madexcept_SmtpComputerName], 0
je 0x5982bfb1
lea eax, [ebp - 0xc]
mov edx, dword [sym.madExcept_.bpl__Madexcept_SmtpComputerName]
call sub.rtl120.bpl__System__LStrLAsg_qqrpvpxv
jmp 0x5982bfcf
lea eax, [ebp - 0x2c4]
call fcn.59819cf8
mov edx, dword [ebp - 0x2c4]
lea eax, [ebp - 0xc]
mov ecx, 0
call sub.rtl120.bpl__System__LStrFromUStr_qqrr27System__AnsiStringT_us_i0__x20System_UnicodeStringus
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
mov ecx, eax
mov edx, 0x5982c5d8
mov eax, ebx
call fcn.5982d2a0
test al, al
je 0x5982c454
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
push eax
lea eax, [ebp - 0x2c8]
mov ecx, dword [ebp - 0xc]
mov edx, 0x5982c5e8
call sub.rtl120.bpl__System__LStrCat3_qqrv
mov edx, dword [ebp - 0x2c8]
mov ecx, 0x5982c5fc
mov eax, ebx
call fcn.5982d11c
test al, al
jne 0x5982c055
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
push eax
lea eax, [ebp - 0x2cc]
mov ecx, dword [ebp - 0xc]
mov edx, 0x5982c60c
call sub.rtl120.bpl__System__LStrCat3_qqrv
mov edx, dword [ebp - 0x2cc]
mov ecx, 0x5982c5fc
mov eax, ebx
call fcn.5982d11c
test al, al
je 0x5982c454
mov byte [ebx + 0x88], 1
cmp byte [ebp + 0x14], 0
jne 0x5982c0a2
push 0x7fffffff
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_PosTextA]
mov esi, dword [esi]
mov ecx, 1
mov edx, dword [ebp - 4]
mov eax, 0x5982c620
call esi
test eax, eax
jne 0x5982c0a6
push 0x7fffffff
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_PosTextA]
mov esi, dword [esi]
mov ecx, 1
mov edx, dword [ebp - 4]
mov eax, 0x5982c63c
call esi
test eax, eax
jne 0x5982c0a6
xor eax, eax
jmp 0x5982c0a8
mov al, 1
mov byte [ebx + 0x8a], al
cmp byte [ebx + 0x8a], 0
je 0x5982c103
cmp byte [ebp + 0x10], 0
jne 0x5982c107
cmp dword [ebp + 0xc], 0
je 0x5982c103
push 0x7fffffff
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_PosTextA]
mov esi, dword [esi]
mov ecx, 1
mov edx, dword [ebp - 4]
mov eax, 0x5982c658
call esi
test eax, eax
jne 0x5982c103
push 0x7fffffff
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_PosTextA]
mov esi, dword [esi]
mov ecx, 1
mov edx, dword [ebp - 4]
mov eax, 0x5982c670
call esi
test eax, eax
je 0x5982c107
xor eax, eax
jmp 0x5982c109
mov al, 1
mov byte [ebx + 0x8b], al
cmp byte [ebx + 0x8b], 0
je 0x5982c1b5
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
push eax
mov ecx, 0x5982c5d8
mov edx, 0x5982c688
mov eax, ebx
call fcn.5982d11c
test al, al
je 0x5982c3cf
mov eax, ebx
call fcn.5982c894
test al, al
je 0x5982c3cf
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
push eax
lea eax, [ebp - 0x2d0]
mov ecx, dword [ebp - 0xc]
mov edx, 0x5982c5e8
call sub.rtl120.bpl__System__LStrCat3_qqrv
mov edx, dword [ebp - 0x2d0]
mov ecx, 0x5982c5fc
mov eax, ebx
call fcn.5982d11c
test al, al
jne 0x5982c1b5
lea eax, [ebp - 8]
call sub.rtl120.bpl__System__LStrClr_qqrpv
push eax
lea eax, [ebp - 0x2d4]
mov ecx, dword [ebp - 0xc]
mov edx, 0x5982c60c
call sub.rtl120.bpl__System__LStrCat3_qqrv
mov edx, dword [ebp - 0x2d4]
mov ecx, 0x5982c5fc
mov eax, ebx
call fcn.5982d11c
test al, al
je 0x5982c3cf
mov byte [ebx + 0x8c], 1
mov byte [ebx + 0x8e], 1
push 0
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_ReplaceStrA]
mov esi, dword [esi]
lea eax, [ebp - 4]
mov ecx, 0x5982c6a0
mov edx, 0x5982c6b0
call esi
push 0
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_ReplaceStrA]
mov esi, dword [esi]
lea eax, [ebp - 4]
mov ecx, 0x5982c6a0
mov edx, 0x5982c6c0
call esi
push 0x7fffffff
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_PosTextA]
mov esi, dword [esi]
mov ecx, 1
mov edx, dword [ebp - 4]
mov eax, 0x5982c6d0
call esi
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jle 0x5982c50c
mov ecx, dword [ebp - 0x14]
inc ecx
lea eax, [ebp - 4]
mov edx, 1
call sub.rtl120.bpl__System__LStrDelete_qqrv
push 0x7fffffff
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_PosStrA]
mov esi, dword [esi]
mov ecx, 1
mov edx, dword [ebp - 4]
mov eax, 0x5982c6e8
call esi
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jle 0x5982c264
lea eax, [ebp - 4]
mov ecx, 0x7fffffff
mov edx, dword [ebp - 0x14]
call sub.rtl120.bpl__System__LStrDelete_qqrv
push 0x7fffffff
lea eax, [ebp - 0x2d8]
mov ecx, 0x5982c6a0
mov edx, dword [ebp - 4]
call sub.rtl120.bpl__System__LStrCat3_qqrv
mov edx, dword [ebp - 0x2d8]
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_PosTextA]
mov esi, dword [esi]
mov ecx, 1
mov eax, 0x5982c6f8
call esi
test eax, eax
jle 0x5982c50c
mov byte [ebx + 0x8d], 1
cmp dword [ebp + 0xc], 0
jne 0x5982c2b5
cmp dword [ebp + 8], 0
je 0x5982c353
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
push eax
mov ecx, 0x5982c70c
mov edx, 0x5982c71c
mov eax, ebx
call fcn.5982d11c
test al, al
je 0x5982c34f
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
push eax
lea edx, [ebp - 0x2e0]
mov eax, dword [ebp + 0xc]
call sub.madBasic_.bpl__Madstrings_EncodeUtf8_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x2e0]
lea edx, [ebp - 0x2dc]
call sub.madBasic_.bpl__Madcrypt_Encode_qqrx27System__AnsiStringT_us_i0__
mov edx, dword [ebp - 0x2dc]
mov ecx, 0x5982c70c
mov eax, ebx
call fcn.5982d11c
test al, al
je 0x5982c34f
lea eax, [ebp - 4]
call sub.rtl120.bpl__System__LStrClr_qqrpv
push eax
lea edx, [ebp - 0x2e8]
mov eax, dword [ebp + 8]
call sub.madBasic_.bpl__Madstrings_EncodeUtf8_qqrx20System_UnicodeString
mov eax, dword [ebp - 0x2e8]
lea edx, [ebp - 0x2e4]
call sub.madBasic_.bpl__Madcrypt_Encode_qqrx27System__AnsiStringT_us_i0__
mov edx, dword [ebp - 0x2e4]
mov ecx, 0x5982c734
mov eax, ebx
call fcn.5982d11c
test al, al
jne 0x5982c353
xor eax, eax
jmp 0x5982c355
mov al, 1
mov byte [ebx + 0x8e], al
cmp byte [ebx + 0x8e], 0
jne 0x5982c50c
push 0x5982c744
lea eax, [ebp - 0x2f4]
push eax
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_SubStrA]
mov esi, dword [esi]
mov cl, 0xa
mov edx, 1
mov eax, dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x2f4]
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_RetTrimStrA]
mov esi, dword [esi]
lea edx, [ebp - 0x2f0]
call esi
mov edx, dword [ebp - 0x2f0]
lea eax, [ebp - 0x2ec]
call sub.rtl120.bpl__System__UStrFromLStr_qqrr20System_UnicodeStringx27System__AnsiStringT_us_i0__
push dword [ebp - 0x2ec]
push 0x5982c780
lea eax, [ebx + 0x94]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp 0x5982c50c
cmp byte [ebx + 0x89], 0
jne 0x5982c3ed
lea eax, [ebx + 0x94]
mov edx, 0x5982c790
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
jmp 0x5982c50c
push 0x5982c7b4
lea eax, [ebp - 0x300]
push eax
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_SubStrA]
mov esi, dword [esi]
mov cl, 0xa
mov edx, 1
mov eax, dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x300]
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_RetTrimStrA]
mov esi, dword [esi]
lea edx, [ebp - 0x2fc]
call esi
mov edx, dword [ebp - 0x2fc]
lea eax, [ebp - 0x2f8]
call sub.rtl120.bpl__System__UStrFromLStr_qqrr20System_UnicodeStringx27System__AnsiStringT_us_i0__
push dword [ebp - 0x2f8]
push 0x5982c780
lea eax, [ebx + 0x94]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp 0x5982c50c
push 0x5982c7e4
lea eax, [ebp - 0x30c]
push eax
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_SubStrA]
mov esi, dword [esi]
mov cl, 0xa
mov edx, 1
mov eax, dword [ebp - 4]
call esi
mov eax, dword [ebp - 0x30c]
mov esi, dword [sym.imp.madBasic_.bpl__Madstrings_RetTrimStrA]
mov esi, dword [esi]
lea edx, [ebp - 0x308]
call esi
mov edx, dword [ebp - 0x308]
lea eax, [ebp - 0x304]
call sub.rtl120.bpl__System__UStrFromLStr_qqrr20System_UnicodeStringx27System__AnsiStringT_us_i0__
push dword [ebp - 0x304]
push 0x5982c780
lea eax, [ebx + 0x94]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
jmp 0x5982c50c
lea eax, [ebx + 0x94]
mov edx, 0x5982c80c
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
jmp 0x5982c50c
lea eax, [ebx + 0x94]
mov edx, 0x5982c830
call sub.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
jmp 0x5982c50c
push 0x5982c86c
call sub.wsock32.dll_WSAGetLastError
lea edx, [ebp - 0x310]
call sub.madBasic_.bpl__Madstrings_ErrorCodeToStrW_qqrui
push dword [ebp - 0x310]
push 0x5982c780
lea eax, [ebx + 0x94]
mov edx, 3
call sub.rtl120.bpl__System__UStrCatN_qqrv
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5982c5a8
lea eax, [ebp - 0x310]
call sub.rtl120.bpl__System__UStrClr_qqrpv
lea eax, [ebp - 0x30c]
mov edx, 2
call sub.rtl120.bpl__System__LStrArrayClr_qqrpvi
lea eax, [ebp - 0x304]
call sub.rtl120.bpl__System__UStrClr_qqrpv
lea eax, [ebp - 0x300]
mov edx, 2
call sub.rtl120.bpl__System__LStrArrayClr_qqrpvi
lea eax, [ebp - 0x2f8]
call sub.rtl120.bpl__System__UStrClr_qqrpv
lea eax, [ebp - 0x2f4]
mov edx, 2
call sub.rtl120.bpl__System__LStrArrayClr_qqrpvi
lea eax, [ebp - 0x2ec]
call sub.rtl120.bpl__System__UStrClr_qqrpv
lea eax, [ebp - 0x2e8]
mov edx, 9
call sub.rtl120.bpl__System__LStrArrayClr_qqrpvi
lea eax, [ebp - 0x2c4]
call sub.rtl120.bpl__System__UStrClr_qqrpv
lea eax, [ebp - 0xc]
mov edx, 3
call sub.rtl120.bpl__System__LStrArrayClr_qqrpvi
ret