Function at 0x404ea8
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Send http request with host header
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x82c
mov eax, dword [0x646384]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x10]
cmp dword [esi + 0x10], 0x200
jb 0x404ef1
cmp dword [esi + 0x14], 0x10
jb 0x404ed4
mov esi, dword [esi]
push 2
call fcn.005166b3
push esi
push str.ERROR:_url_size_limit_exceeded:__s_n
push eax
call fcn.00405996
add esp, 0x10
xor eax, eax
jmp 0x40500c
cmp dword [edi + 0x10], 0xc8
jb 0x404f11
cmp dword [edi + 0x14], 0x10
jb 0x404f02
mov edi, dword [edi]
push 2
call fcn.005166b3
push edi
push str.ERROR:_origin_size_limit_exceeded:__s_n
jmp 0x404ee1
push ebx
push 0x10
pop ebx
mov eax, esi
cmp dword [esi + 0x14], ebx
jb 0x404f1e
mov eax, dword [esi]
lea ecx, [ebp - 0x804]
push ecx
lea ecx, [ebp - 0x820]
push ecx
lea ecx, [ebp - 0x604]
push ecx
push str.ws:____:__:_d__s
push eax
call fcn.004059d7
add esp, 0x14
cmp eax, 3
je 0x404f7e
mov eax, esi
cmp dword [esi + 0x14], ebx
jb 0x404f4f
mov eax, dword [esi]
lea ecx, [ebp - 0x804]
push ecx
lea ecx, [ebp - 0x604]
push ecx
push str.ws:____:____s
push eax
call fcn.004059d7
add esp, 0x10
cmp eax, 2
jne 0x40501a
mov dword [ebp - 0x820], 0x50
mov ebx, dword [ebp - 0x820]
lea ecx, [ebp - 0x604]
and dword [ebp - 0x80c], 0
lea edx, [ecx + 1]
mov dword [ebp - 0x808], 0xf
mov byte [ebp - 0x81c], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404fa5
sub ecx, edx
lea eax, [ebp - 0x604]
push ecx
push eax
lea ecx, [ebp - 0x81c]
call fcn.004040db
lea eax, [ebp - 0x81c]
push ebx
push eax
call fcn.00405464
pop ecx
pop ecx
lea ecx, [ebp - 0x81c]
mov ebx, eax
call fcn.004048fa
cmp ebx, 0xffffffff
jne 0x4050a1
mov esi, dword [ebp - 0x820]
push 2
call fcn.005166b3
push esi
lea ecx, [ebp - 0x604]
push ecx
push str.Unable_to_connect_to__s:_d_n
push eax
call fcn.00405996
add esp, 0x14
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.004553ba
leave
ret
mov eax, esi
cmp dword [esi + 0x14], ebx
jb 0x405023
mov eax, dword [esi]
lea ecx, [ebp - 0x820]
push ecx
lea ecx, [ebp - 0x604]
push ecx
push str.ws:____:__:_d
push eax
call fcn.004059d7
add esp, 0x10
cmp eax, 2
jne 0x405050
mov byte [ebp - 0x804], 0
jmp 0x404f7e
mov eax, esi
cmp dword [esi + 0x14], ebx
jb 0x405059
mov eax, dword [esi]
lea ecx, [ebp - 0x604]
push ecx
push str.ws:____:__
push eax
call fcn.004059d7
add esp, 0xc
cmp eax, 1
jne 0x40507f
mov dword [ebp - 0x820], 0x50
jmp 0x405044
cmp dword [esi + 0x14], ebx
jb 0x405086
mov esi, dword [esi]
push 2
call fcn.005166b3
push esi
push str.ERROR:_Could_not_parse_WebSocket_url:__s_n
push eax
call fcn.00405996
add esp, 0x10
jmp 0x405009
lea eax, [ebp - 0x804]
push eax
push str.GET___s_HTTP_1.1_r_n
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0x10
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00516560
pop ecx
push eax
lea eax, [ebp - 0x404]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_send]
cmp dword [ebp - 0x820], 0x50
lea eax, [ebp - 0x604]
jne 0x40510a
push eax
push str.Host:__s_r_n
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0x10
jmp 0x40512a
push dword [ebp - 0x820]
push eax
push str.Host:__s:_d_r_n
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0x14
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00516560
pop ecx
push eax
lea eax, [ebp - 0x404]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_send]
push str.Upgrade:_websocket_r_n
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0xc
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00516560
pop ecx
push eax
lea eax, [ebp - 0x404]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_send]
push str.Connection:_Upgrade_r_n
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0xc
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00516560
pop ecx
push eax
lea eax, [ebp - 0x404]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_send]
cmp dword [edi + 0x10], 0
je 0x405200
cmp dword [edi + 0x14], 0x10
jb 0x4051c4
mov edi, dword [edi]
push edi
push str.Origin:__s_r_n
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0x10
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00516560
mov edi, dword [sym.imp.WS2_32.dll_send]
pop ecx
push eax
lea eax, [ebp - 0x404]
push eax
push ebx
call edi
jmp 0x405206
mov edi, dword [sym.imp.WS2_32.dll_send]
push str.Sec_WebSocket_Key:_x3JJHMbDL1EzLkh9GBhXDw_r_n
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0xc
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00516560
pop ecx
push eax
lea eax, [ebp - 0x404]
push eax
push ebx
call edi
push str.Sec_WebSocket_Version:_13_r_n
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0xc
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00516560
pop ecx
push eax
lea eax, [ebp - 0x404]
push eax
push ebx
call edi
push 0x59aba8
lea eax, [ebp - 0x404]
push 0x400
push eax
call fcn.0040458c
add esp, 0xc
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.00516560
pop ecx
push eax
lea eax, [ebp - 0x404]
push eax
push ebx
call edi
xor edi, edi
cmp edi, 2
jl 0x4052c2
cmp edi, 0x3ff
jge 0x4052e1
cmp byte [ebp + edi - 0x406], 0xd
je 0x4052e1
cmp byte [ebp + edi - 0x405], 0xa
je 0x4052e1
push 0
push 1
lea eax, [ebp - 0x404]
add eax, edi
push eax
push ebx
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x405009
inc edi
jmp 0x4052a1
cmp edi, 0x400
jae 0x405445
mov byte [ebp + edi - 0x404], 0
cmp edi, 0x3ff
jne 0x405317
cmp dword [esi + 0x14], 0x10
jb 0x405305
mov esi, dword [esi]
push 2
call fcn.005166b3
push esi
push str.ERROR:_Got_invalid_status_line_connecting_to:__s_n
jmp 0x405093
lea eax, [ebp - 0x828]
push eax
lea eax, [ebp - 0x404]
push str.HTTP_1.1__d
push eax
call fcn.004059d7
xor edi, edi
add esp, 0xc
inc edi
cmp eax, edi
jne 0x405424
cmp dword [ebp - 0x828], 0x65
jne 0x405424
xor esi, esi
cmp esi, 2
jl 0x40536d
cmp esi, 0x3ff
jge 0x40538b
cmp byte [ebp + esi - 0x406], 0xd
je 0x40538b
cmp byte [ebp + esi - 0x405], 0xa
je 0x40538b
push 0
push edi
lea eax, [ebp - 0x404]
add eax, esi
push eax
push ebx
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
je 0x405009
inc esi
jmp 0x40534c
cmp byte [ebp - 0x404], 0xd
jne 0x40534a
cmp byte [ebp - 0x403], 0xa
jne 0x40534a
push 4
lea eax, [ebp - 0x82c]
mov dword [ebp - 0x82c], edi
push eax
push edi
push 6
push ebx
call dword [sym.imp.WS2_32.dll_setsockopt]
lea eax, [ebp - 0x824]
mov dword [ebp - 0x824], edi
push eax
push 0x8004667e
push ebx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push 0x34
call fcn.004550ff
pop ecx
mov ecx, eax
mov dword [ebp - 0x824], ecx
test ecx, ecx
je 0x40541b
mov al, byte [ebp + 0xc]
xor edx, edx
mov dword [ecx], 0x59a964
mov dword [ecx + 4], edx
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], edx
mov dword [ecx + 0x10], edx
mov dword [ecx + 0x14], edx
mov dword [ecx + 0x18], edx
mov dword [ecx + 0x1c], edx
mov dword [ecx + 0x20], edx
mov dword [ecx + 0x24], edx
mov dword [ecx + 0x28], ebx
mov dword [ecx + 0x2c], 3
mov byte [ecx + 0x30], al
mov byte [ecx + 0x31], dl
jmp 0x40541d
xor ecx, ecx
mov eax, ecx
jmp 0x40500b
cmp dword [esi + 0x14], 0x10
jb 0x40542c
mov esi, dword [esi]
push 2
call fcn.005166b3
lea ecx, [ebp - 0x404]
push ecx
push esi
push str.ERROR:_Got_bad_status_connecting_to__s:__s
jmp 0x405000
call fcn.004555ff
int3