Function at 0x4055e0
Capabilities:
Get socket status
Make an http request with a cookie
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
mov eax, 0x17b4
call fcn.0040ce80
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x17c8]
mov eax, edi
shl eax, 7
add eax, edi
shl eax, 4
add eax, edi
lea ecx, [edi + eax*4]
lea ebp, [edi + ecx*2]
shl ebp, 4
mov al, byte [ebp + 0x796a36]
test al, al
jne 0x405864
mov esi, dword [esp + 0x17d0]
mov edx, dword [ebp + 0x7969a8]
mov eax, dword [esp + 0x17cc]
push edx
mov ecx, dword [esi + 0x1c]
push eax
push ecx
lea edx, [esp + 0x5d0]
push str.XCID_d_ETAG_d__d.bin
push edx
call fcn.0040d799
mov ebx, dword [esi + 0x10]
xor eax, eax
mov ax, word [esi + 0x14]
add esp, 0x14
push eax
push ebx
call sub.WSOCK32.dll_inet_ntoa
push eax
lea ecx, [esp + 0x28]
push str._s:_d
push ecx
call fcn.0040d799
mov al, byte [0xba81b2]
add esp, 0x10
test al, al
je 0x405697
lea edx, [esp + 0x5c4]
lea eax, [esp + 0x20]
push edx
push eax
lea ecx, [esp + 0x1cc]
push str.http:___s_FileX_MGet__sSiteID777
push ecx
call fcn.0040d799
add esp, 0x10
jmp 0x4056e6
mov al, byte [ebp + 0x756190]
lea edx, [esp + 0x5c4]
test al, al
push edx
je 0x4056d1
lea eax, [esp + 0x1c8]
push str._FileX_MGet__sSiteID777Fliptrue
push eax
call fcn.0040d799
mov ecx, dword [ebp + 0x7969a8]
push ecx
push str.Request_Flip_on_Seg_d
call sym.Sure_XLite.exe_xLogMsg
add esp, 0x14
jmp 0x4056e6
lea eax, [esp + 0x1c8]
push str._FileX_MGet__sSiteID777
push eax
call fcn.0040d799
add esp, 0xc
lea ecx, [esp + 0x1c4]
lea edx, [esp + 0x7c4]
push ecx
push str.GET__s_HTTP_1.1
push edx
call fcn.0040d799
mov edi, str._r_nAccept:__
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x7d0]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x17d8]
mov ecx, edx
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x50]
push str._r_nETag:__d
push ecx
call fcn.0040d799
lea edi, [esp + 0x58]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x18
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x7c4]
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x7c4]
and ecx, 3
push ebx
rep movsb byte es:[edi], byte [esi]
mov edi, str._r_nUser_Agent:_Mozilla_4.0__compatible__MSIE_8.0__Windows_NT_5.1__Trident_4.0__GTB6__.NET_CLR_1.1.4322__.NET_CLR_2.0.50727__.NET_CLR_3.0.4506.2152__.NET_CLR_3.5.30729_
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call sub.WSOCK32.dll_inet_ntoa
push eax
lea eax, [esp + 0x44]
push str._r_nHost:__s
push eax
call fcn.0040d799
add esp, 0xc
or ecx, 0xffffffff
lea edi, [esp + 0x40]
lea edx, [esp + 0x7c4]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x7c8]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str._r_nConnection:_Keep_Alive_r_n_r_n
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x7c8]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x7c8]
push ecx
mov ecx, dword [ebp + 0x7969d8]
push eax
push ecx
call sub.WSOCK32.dll_send
cmp eax, 0xffffffff
je 0x405ad5
pop edi
mov byte [ebp + 0x796a36], 1
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x17b4
ret
lea eax, [esp + 0x18]
xor ebx, ebx
push eax
push ebx
lea ecx, [esp + 0xc8]
mov byte [ebp + 0x796a38], 1
mov edx, dword [ebp + 0x7969d8]
push ebx
push ecx
push 1
mov dword [esp + 0xd4], 1
mov dword [esp + 0xd8], edx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
call sub.WSOCK32.dll_select
cmp eax, 0xffffffff
jne 0x4058b9
call sub.WSOCK32.dll_WSAGetLastError
push eax
push edi
push str.Agent_SEG_Slot__d__Read_err_d
jmp 0x405acd
cmp eax, ebx
jne 0x405910
lea edx, [esp + 0x14]
push edx
call fcn.0040c91f
mov eax, dword [ebp + 0x7969b8]
mov ecx, dword [esp + 0x18]
push eax
push ecx
call fcn.0040d8fb
fcomp qword [0x4192d0]
add esp, 0xc
fnstsw ax
test ah, 1
je 0x4058f5
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x17b4
ret
push edi
push str.Agent_SEG_Slot__d__timeout
call sym.Sure_XLite.exe_xLogMsg
add esp, 8
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x17b4
ret
mov eax, dword [ebp + 0x7969b0]
mov edx, dword [ebp + 0x7969ac]
mov ecx, dword [ebp + 0x7969d8]
sub edx, eax
push ebx
lea eax, [eax + ebp + 0x756191]
push edx
push eax
push ecx
call sub.WSOCK32.dll_recv
mov esi, eax
cmp esi, 0xffffffff
jne 0x40594c
call sub.WSOCK32.dll_WSAGetLastError
push eax
push edi
push str.Agent_SEG_Slot__d__read_socket_err_d
jmp 0x405acd
cmp esi, ebx
jle 0x405ad5
lea edx, [ebp + 0x7969b8]
push edx
call fcn.0040c91f
mov ecx, dword [ebp + 0x7969b0]
add esp, 4
add ecx, esi
mov dword [ebp + 0x7969b0], ecx
mov byte [ebp + 0x796a38], 0
mov al, byte [ebp + 0x796a37]
test al, al
jne 0x405a9e
mov esi, dword [ebp + 0x7969b0]
lea ebx, [ebp + 0x756191]
push str._r_n_r_n
push ebx
mov byte [esi + ebp + 0x756191], 0
call fcn.0040de00
push str.HTTP
push ebx
mov dword [esp + 0x20], eax
call fcn.0040de00
add esp, 0x10
test eax, eax
je 0x405a9e
mov eax, dword [esp + 0x10]
test eax, eax
je 0x405a9e
push ebx
call sym.Sure_XLite.exe__WS_RetCode_4
cmp eax, 0xc8
jne 0x405ac6
lea eax, [esp + 0x3c4]
push eax
push str.Set_Cookie:
push ebx
call sym.Sure_XLite.exe__WS_HeadParse_12
lea ecx, [esp + 0x3c4]
push str.CRC
push ecx
call fcn.0040de00
add esp, 8
test eax, eax
je 0x405aab
add eax, 4
push eax
call fcn.0040dfdf
add esp, 4
lea edx, [esp + 0x3c4]
mov word [ebp + 0x796a34], ax
push edx
push str.Connection:
push ebx
call sym.Sure_XLite.exe__WS_HeadParse_12
lea eax, [esp + 0x3c4]
push str.close
push eax
call fcn.0040eb50
add esp, 8
test eax, eax
jne 0x405a54
mov byte [ebp + 0x796a3a], 1
jmp 0x405a5b
mov byte [ebp + 0x796a3a], 0
mov edi, str._r_n_r_n
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, ebx
mov eax, ecx
mov ecx, dword [esp + 0x10]
sub ecx, ebx
add eax, ecx
sub esi, eax
mov edx, esi
lea esi, [eax + ebp + 0x756191]
mov ecx, edx
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebp + 0x7969b0], edx
mov byte [ebp + 0x796a37], 1
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x17b4
ret
push edi
push str.Agent_Seg_Slot__d__No_CRC_Check
call sym.Sure_XLite.exe_xLogMsg
add esp, 8
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x17b4
ret
push eax
push edi
push str.Agent_SEG_Slot__d__Invalid_RetCode_d
call sym.Sure_XLite.exe_xLogMsg
add esp, 0xc
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x17b4
ret