Function at 0x405180
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header

Disassembly:
mov eax, 0x4c80
call fcn.0040ce80
push ebx
push ebp
mov ebp, dword [esp + 0x4c8c]
push esi
lea ecx, [esp + 0xc]
push edi
mov eax, dword [ebp + 0xc]
push ecx
mov dword [esp + 0x24], eax
call fcn.0040c91f
lea edx, [esp + 0x14]
push edx
call fcn.0040c7bf
push eax
push str._Y_m_d_H_M_S
lea eax, [esp + 0x3c]
push 0x20
push eax
call fcn.0040dfea
mov al, byte [0xba81b2]
xor ebx, ebx
add esp, 0x18
cmp al, bl
mov eax, dword [esp + 0x4c98]
je 0x405214
mov edx, dword [eax + 0x24]
lea ecx, [eax + 0x179c]
push ecx
mov ecx, dword [eax + 0x20]
push edx
mov edx, dword [eax + 0x28]
push ecx
mov ecx, dword [eax + 0x1c]
push edx
add eax, 0x162c
push ecx
push eax
lea edx, [esp + 0x44]
lea eax, [ebp + 0x38]
push edx
push eax
lea ecx, [esp + 0xac]
push str.http:___s__s_FileX_MGet_s_CID_dUid_dPid_dNID_dCA_sSiteID777Type5
push ecx
call fcn.0040d799
add esp, 0x28
jmp 0x40524b
mov ecx, dword [eax + 0x24]
lea edx, [eax + 0x179c]
push edx
mov edx, dword [eax + 0x20]
push ecx
mov ecx, dword [eax + 0x28]
push edx
mov edx, dword [eax + 0x1c]
push ecx
add eax, 0x162c
push edx
push eax
lea eax, [esp + 0x44]
lea ecx, [esp + 0xa4]
push eax
push str.__s_FileX_MGet_s_CID_dUid_dPid_dNID_dCA_sSiteID777Type5
push ecx
call fcn.0040d799
add esp, 0x24
lea edx, [esp + 0x8c]
push edx
push str.DQ_Ret_Chk_Url_s
call sym.Sure_XLite.exe_xLogMsg
lea eax, [esp + 0x94]
lea ecx, [esp + 0x394]
push eax
push str.HEAD__s_HTTP_1.1
push ecx
call fcn.0040d799
mov edi, str._r_nAccept:___r_nReferer:_http:__www.Sure_X.net__r_nUser_Agent:_iNet_Gateway_r_nAccept_Encoding:_gzip__deflate
or ecx, 0xffffffff
xor eax, eax
add esp, 0x14
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x38c]
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 al, byte [0xba81b2]
mov ecx, edx
and ecx, 3
cmp al, bl
rep movsb byte es:[edi], byte [esi]
je 0x4052c7
lea eax, [ebp + 0x38]
lea ecx, [esp + 0x890]
push eax
push str._r_nHost:__s
push ecx
jmp 0x4052df
mov edx, dword [esp + 0x20]
push edx
call sub.WSOCK32.dll_inet_ntoa
push eax
lea eax, [esp + 0x894]
push str._r_nHost:__s
push eax
call fcn.0040d799
lea edi, [esp + 0x89c]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x38c]
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 + 0x38c]
and ecx, 3
push ebx
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 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]
lea edi, [esp + 0x390]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x390]
push ecx
mov ecx, dword [ebp + 0x1c]
push eax
push ecx
call sub.WSOCK32.dll_send
cmp eax, 0xffffffff
jne 0x405394
push str.DQ_RetChk_ERR___transmit_fail
call sym.Sure_XLite.exe_xLogMsg
mov edx, dword [ebp + 0x1c]
add esp, 4
push edx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x4c80
ret
mov al, byte [0xba85c4]
xor esi, esi
cmp al, bl
jne 0x4054c9
mov edi, 0xa
mov eax, dword [ebp + 0x1c]
lea ecx, [esp + 0x1c]
push ecx
push ebx
lea edx, [esp + 0x794]
push ebx
push edx
push 1
mov dword [esp + 0x7a0], 1
mov dword [esp + 0x7a4], eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], ebx
call sub.WSOCK32.dll_select
cmp eax, 0xffffffff
je 0x40543c
cmp eax, ebx
je 0x405451
mov edx, dword [ebp + 0x1c]
mov eax, 0x4000
sub eax, esi
push ebx
lea ecx, [esp + esi + 0xc94]
push eax
push ecx
push edx
call sub.WSOCK32.dll_recv
cmp eax, 0xffffffff
je 0x40545e
cmp eax, ebx
je 0x40545e
add esi, eax
lea eax, [esp + 0xc90]
push str._r_n_r_n
push eax
mov byte [esp + esi + 0xc98], bl
call fcn.0040de00
mov edx, eax
add esp, 8
cmp edx, ebx
jne 0x405488
cmp byte [0xba85c4], bl
jne 0x4054c9
jmp 0x4053a8
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.DQ_Ret_Chk_err_d
call sym.Sure_XLite.exe_xLogMsg
add esp, 8
jmp 0x40545e
push str.DQ_Ret_Chk_Timeout_on_Response
call sym.Sure_XLite.exe_xLogMsg
add esp, 4
call sub.WSOCK32.dll_WSAGetLastError
push eax
push str.DQ_RetChk_ERR___read_fail_d
call sym.Sure_XLite.exe_xLogMsg
mov ecx, dword [ebp + 0x1c]
add esp, 8
push ecx
call sub.WSOCK32.dll_closesocket
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x4c80
ret
mov edi, str._r_n_r_n
or ecx, 0xffffffff
xor eax, eax
lea esi, [esp + 0xc90]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0x38c]
mov eax, ecx
lea ecx, [esp + 0xc90]
sub edx, ecx
add eax, edx
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov byte [esp + eax + 0x38c], bl
lea eax, [esp + 0x38c]
push eax
call sym.Sure_XLite.exe__WS_RetCode_4
mov esi, eax
cmp esi, 0xc8
jne 0x4055b6
lea ecx, [esp + 0x18c]
lea edx, [esp + 0x38c]
push ecx
push str.Last_Modified:
push edx
call sym.Sure_XLite.exe__WS_HeadParse_12
lea eax, [esp + 0x18c]
push eax
call sym.Sure_XLite.exe__WS_BanTime_4
mov ecx, dword [esp + 0x4c9c]
lea edx, [esp + 0x4c]
push edx
push ecx
mov dword [ecx], eax
call sym.Sure_XLite.exe__WS_TimeBan_8
lea eax, [esp + 0x4c]
lea ecx, [esp + 0x18c]
push eax
push ecx
push str.DQ_Ret_Chk_BanTime_s____TimeBan_s
call sym.Sure_XLite.exe_xLogMsg
add esp, 0xc
lea edx, [esp + 0x18c]
lea eax, [esp + 0x38c]
push edx
push str.Content_Length:
push eax
call sym.Sure_XLite.exe__WS_HeadParse_12
lea ecx, [esp + 0x14]
lea edx, [esp + 0x18c]
push ecx
push str._I64d
push edx
call fcn.0040e94a
mov eax, dword [esp + 0x4cac]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
add esp, 0xc
mov dword [eax], ecx
mov dword [eax + 4], edx
lea eax, [esp + 0x18c]
lea ecx, [esp + 0x38c]
push eax
push str.ETag:
push ecx
call sym.Sure_XLite.exe__WS_HeadParse_12
lea edx, [esp + 0x18c]
push edx
call fcn.0040dfdf
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c80
ret
lea eax, [esp + 0x38c]
push eax
push str.Agent_Ret_Chk_Fail_Head_s
call sym.Sure_XLite.exe_xLogMsg
add esp, 8
mov eax, esi
neg eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c80
ret