Function at 0x140017090
Capabilities:
Connect socket
Create thread
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket
Send http request
Set socket configuration

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0xb00]
sub rsp, 0xc00
mov rax, qword [0x14005b040]
xor rax, rsp
mov qword [rbp + 0xaf0], rax
xor eax, eax
mov word [rsp + 0x30], r8w
mov ebx, 1
mov qword [rbp - 0x78], rdx
movzx edi, r8w
mov qword [rbp - 0x60], rcx
mov esi, 2
mov dword [rbp - 0x68], eax
mov edx, ebx
mov dword [rbp - 0x7c], eax
mov ecx, esi
mov qword [rsp + 0x48], rax
xor r8d, r8d
mov qword [rsp + 0x40], rax
mov dword [rsp + 0x34], ebx
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x50], 0xffffffffffffffff
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x70], rax
mov dword [rsp + 0x38], eax
call qword [sym.imp.WS2_32.dll_socket]
lea r8, [rbp - 0x80]
mov dword [rbp - 0x80], ebx
mov rcx, rax
mov edx, 0x8004667e
mov r14, rax
call qword [sym.imp.WS2_32.dll_ioctlsocket]
lea r9, str._dhcpsrv.ws
mov edx, 0x100
lea r8, [0x140050414]
lea rcx, [rbp + 0x5e0]
call fcn.1400110e0
lea r9, [rbp + 0x5e0]
mov edx, 0x401
lea r8, str.GET__s_HTTP_1.1_r_nSec_WebSocket_Key:_JsQucMh_KejofesQ90J4Q_r_nUpgrade:_websocket_r_n_r_n
lea rcx, [rbp + 0x6e0]
call fcn.1400110e0
mov r12, qword [rbp - 0x78]
mov r15d, esi
mov dword [rbp - 0x80], eax
jmp 0x140017195
movzx edi, word [rsp + 0x30]
mov rcx, r12
call fcn.140011200
mov rsi, rax
test rax, rax
je 0x140017220
mov rax, qword [rax + 0x18]
mov rcx, qword [rax]
test rcx, rcx
je 0x140017220
movzx eax, byte [rcx + 2]
movzx r13d, byte [rcx + 3]
shl r13d, 8
or r13d, eax
movzx eax, byte [rcx + 1]
shl r13d, 8
or r13d, eax
movzx eax, byte [rcx]
shl r13d, 8
movzx ecx, di
or r13d, eax
mov qword [rbp - 0x70], 0
mov eax, 2
mov dword [rbp - 0x7c], r13d
mov word [rbp - 0x78], ax
call qword [sym.imp.WS2_32.dll_htons]
mov word [rbp - 0x76], ax
mov r8d, reloc.WS2_32.dll_recv
mov rax, qword [rsi + 0x18]
lea rdx, [rbp - 0x78]
mov rcx, qword [rax]
mov eax, dword [rcx]
mov rcx, r14
mov dword [rbp - 0x74], eax
call qword [sym.imp.WS2_32.dll_connect]
mov edi, eax
cmp eax, 0xfffffffe
jne 0x140017233
jmp 0x140017225
mov edi, 0xfffffffe
mov eax, r15d
dec r15d
test eax, eax
jg 0x140017190
mov r13, qword [rbp - 0x60]
mov r12d, dword [rbp - 0x68]
test rsi, rsi
je 0x140017259
mov rax, qword [rsi + 0x18]
mov rcx, qword [rax]
test rcx, rcx
je 0x140017251
call fcn.1400272e4
mov rcx, rsi
call fcn.1400272e4
test edi, edi
jne 0x1400172b3
mov esi, dword [rbp - 0x7c]
lea r8, [0x14005e860]
xorps xmm0, xmm0
mov qword [r13 + 0x728], r14
movups xmmword [rbp - 0x60], xmm0
mov r9d, 0x20
mov dword [rbp - 0x5c], esi
lea rdx, [rbp - 0x5c]
mov ecx, 2
call qword [sym.imp.WS2_32.dll_inet_ntop]
mov rcx, qword [r13 + 0x6d8]
lea rdx, str.connected_to__s_n
mov r8, rax
call fcn.140019c40
mov r12d, ebx
mov r15d, dword [rbp - 0x80]
mov ecx, ebx
xor ebx, ebx
jmp 0x1400173b0
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, dword [rbp - 0x7c]
cmp eax, 0x2733
je 0x1400172a6
xorps xmm0, xmm0
lea r8, [0x14005e860]
movups xmmword [rbp - 0x60], xmm0
mov r9d, 0x20
mov dword [rbp - 0x5c], esi
lea rdx, [rbp - 0x5c]
mov ecx, 2
call qword [sym.imp.WS2_32.dll_inet_ntop]
mov rbx, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
movzx r9d, word [rsp + 0x30]
lea rdx, str.can_not_connect_to__s_port__d__rc_d__errno_d__n
mov rcx, qword [r13 + 0x6d8]
mov r8, rbx
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], edi
call fcn.140019c40
mov rcx, r14
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x50]
cmp rax, 0xffffffffffffffff
je 0x140017338
mov rcx, rax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140017362
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x50]
mov dword [rsp + 0x68], 1
cmp rax, 0xffffffffffffffff
je 0x14001737e
mov rcx, rax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140017af9
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140017af9
mov r15d, dword [rbp - 0x80]
mov ecx, 1
nop dword [rax + rax]
cmp dword [r13 + 0x730], 0
jne 0x140017a5f
mov qword [rbp - 0x78], 0
mov dword [rbp - 0x50], 0
mov qword [rbp + 0x3d8], r14
mov dword [rbp + 0x3d0], ecx
mov qword [rbp + 0x1c8], r14
mov dword [rbp + 0x1c0], ecx
test r12d, r12d
je 0x1400173fb
cmp r12d, 1
jne 0x140017402
mov eax, r15d
sub eax, ebx
test eax, eax
jle 0x140017402
mov qword [rbp - 0x48], r14
mov dword [rbp - 0x50], ecx
cmp r12d, 3
je 0x140017414
mov dword [rbp - 0x78], 5
jmp 0x14001760f
cmp qword [rsp + 0x40], 0
jne 0x140017428
mov dword [rbp - 0x78], 0x2710
jmp 0x14001760f
xor ecx, ecx
call fcn.14002db90
mov rcx, qword [rsp + 0x40]
sub rcx, rax
add rcx, 8
test rcx, rcx
jle 0x140017458
xor ecx, ecx
call fcn.14002db90
mov ecx, dword [rsp + 0x40]
sub ecx, eax
add ecx, 8
mov dword [rbp - 0x78], ecx
jmp 0x14001760f
xor ecx, ecx
call fcn.14002db90
cmp dword [rsp + 0x34], 0
mov qword [rsp + 0x40], rax
je 0x140017a4c
mov ecx, dword [rsp + 0x6c]
xor edi, edi
mov dword [rsp + 0x34], edi
cmp ecx, 2
jne 0x140017529
mov rcx, qword [r13 + 0x838]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [r13 + 0x840]
test rcx, rcx
je 0x1400174a5
call fcn.1400272e4
mov rax, qword [rsp + 0x70]
mov rcx, qword [r13 + 0x838]
mov qword [r13 + 0x840], rax
mov eax, dword [rsp + 0x78]
mov dword [r13 + 0x848], eax
mov dword [rsp + 0x78], edi
mov qword [rsp + 0x70], rdi
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov rcx, qword [r13 + 0x6d8]
lea rdx, str.SyncServer_download_finished_n
call fcn.140019c40
mov rcx, qword [rsp + 0x50]
mov dword [rsp + 0x68], 1
cmp rcx, 0xffffffffffffffff
je 0x1400174fe
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140017523
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x60], rdi
mov ecx, edi
mov dword [rsp + 0x6c], ecx
cmp dword [rsp + 0x38], edi
je 0x140017600
cmp ecx, 1
ja 0x140017600
mov rcx, qword [r13 + 0x6d8]
lea rdx, str.trigger_download_n
mov dword [rsp + 0x38], edi
call fcn.140019c40
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x14001759e
mov rax, qword [rsp + 0x50]
mov dword [rsp + 0x68], 1
cmp rax, 0xffffffffffffffff
je 0x14001757e
mov rcx, rax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x14001759e
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x60], rdi
mov rcx, qword [rsp + 0x70]
movzx eax, word [rsp + 0x30]
mov dword [rsp + 0x58], esi
mov word [rsp + 0x5c], ax
mov dword [rsp + 0x68], edi
mov qword [rsp + 0x50], 0xffffffffffffffff
mov dword [rsp + 0x6c], 3
test rcx, rcx
je 0x1400175d0
call fcn.1400272e4
lea rax, [rbp - 0x68]
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x28], rax
lea r9, [rsp + 0x50]
lea r8, [0x140017080]
mov dword [rsp + 0x20], edi
xor edx, edx
mov dword [rsp + 0x78], edi
xor ecx, ecx
call fcn.14002dfa0
mov qword [rsp + 0x60], rax
mov rcx, r14
call fcn.140016b20
mov dword [rbp - 0x78], 8
call fcn.1400316d0
mov r9d, eax
lea ecx, [r14 + 1]
mov eax, 0x10624dd3
imul r9d
sar edx, 6
mov r8d, edx
shr r8d, 0x1f
add edx, r8d
lea r8, [rbp - 0x50]
imul edx, edx, 0x3e8
sub r9d, edx
lea rdx, [rbp + 0x3d0]
imul eax, r9d, 0x3e8
lea r9, [rbp + 0x1c0]
mov dword [rbp - 0x74], eax
lea rax, [rbp - 0x78]
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
lea rdx, [rbp + 0x1c0]
mov rcx, r14
mov edi, eax
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
jne 0x14001797f
cmp edi, 1
jne 0x140017903
test r12d, r12d
jne 0x1400176ab
lea rdx, [rbp - 0x50]
mov rcx, r14
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x1400176ab
mov r15d, dword [rbp - 0x80]
mov ecx, edi
mov r12d, ecx
jmp 0x1400173b0
lea rdx, [rbp - 0x50]
mov rcx, r14
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
mov rcx, r14
test eax, eax
je 0x140017704
mov r15d, dword [rbp - 0x80]
lea rdx, [rbp + 0x6e0]
mov r8d, r15d
movsxd rax, ebx
sub r8d, ebx
add rdx, rax
xor r9d, r9d
call qword [sym.imp.WS2_32.dll_send]
mov edi, eax
test eax, eax
jle 0x14001794f
add ebx, eax
mov ecx, 1
cmp ebx, r15d
jne 0x1400173b0
mov r12d, 2
jmp 0x1400173b0
lea rdx, [rbp + 0x3d0]
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
mov r15d, dword [rbp - 0x80]
test eax, eax
je 0x1400173a6
movsxd rax, ebx
lea rdx, [rbp + 0x6e0]
mov r8d, 0x3ff
add rdx, rax
sub r8d, ebx
xor r9d, r9d
mov rcx, r14
call qword [sym.imp.WS2_32.dll_recv]
mov edi, eax
test eax, eax
jle 0x14001795b
add ebx, eax
movsxd rax, ebx
cmp rax, 0x401
jae 0x140017b34
mov byte [rbp + rax + 0x6e0], 0
mov edx, ebx
lea rcx, [rbp + 0x6e0]
cmp r12d, 2
jne 0x14001788f
xor r9d, r9d
mov qword [rsp + 0x20], 0
xor r8d, r8d
call fcn.140016bd0
test eax, eax
je 0x1400173a6
mov rcx, qword [r13 + 0x6d8]
lea r8, [r13 + 0x734]
lea rdx, str.websocket_connection_to__s_established_n
call fcn.140019c40
xor r15d, r15d
mov qword [r13 + 0x728], r14
xor ecx, ecx
mov ebx, r15d
mov r12d, 3
call fcn.14002db90
mov rcx, qword [r13 + 0x6d8]
lea rdx, str.trigger_download_n
mov qword [rsp + 0x40], rax
call fcn.140019c40
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140017828
mov rax, qword [rsp + 0x50]
mov dword [rsp + 0x68], 1
cmp rax, 0xffffffffffffffff
je 0x140017808
mov rcx, rax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140017828
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x60], r15
mov rcx, qword [rsp + 0x70]
movzx eax, word [rsp + 0x30]
mov dword [rsp + 0x58], esi
mov word [rsp + 0x5c], ax
mov dword [rsp + 0x68], r15d
mov qword [rsp + 0x50], 0xffffffffffffffff
mov dword [rsp + 0x6c], r12d
test rcx, rcx
je 0x140017858
call fcn.1400272e4
lea rax, [rbp - 0x7c]
mov qword [rsp + 0x70], r15
mov qword [rsp + 0x28], rax
lea r9, [rsp + 0x50]
lea r8, [0x140017080]
mov dword [rsp + 0x20], r15d
xor edx, edx
mov dword [rsp + 0x78], r15d
xor ecx, ecx
call fcn.14002dfa0
mov qword [rsp + 0x60], rax
jmp 0x1400173a2
lea r8, [rsp + 0x48]
call fcn.1400168f0
test eax, eax
jle 0x1400173a6
mov rbx, qword [rsp + 0x48]
test rbx, rbx
je 0x1400178f6
lea rdx, str.PONG
mov rcx, rbx
call fcn.140027214
test eax, eax
jne 0x1400178c4
inc dword [rsp + 0x34]
jmp 0x1400178e5
lea rdx, str.UPDATE
mov rcx, rbx
call fcn.140027214
mov ecx, dword [rsp + 0x38]
test eax, eax
mov eax, 1
cmove ecx, eax
mov dword [rsp + 0x38], ecx
mov rcx, rbx
call fcn.1400272e4
mov qword [rsp + 0x48], 0
xor ebx, ebx
mov byte [rbp + 0x6e0], bl
jmp 0x1400173a6
test edi, edi
jne 0x14001792a
mov r15d, dword [rbp - 0x80]
cmp r12d, 3
je 0x1400173a6
test r12d, r12d
je 0x1400173a6
lea rdx, str.no_response_from_SyncServer_n
jmp 0x140017a53
js 0x140017a5f
mov eax, dword [rsp + 0x34]
mov r15, qword [rsp + 0x40]
mov dword [rsp + 0x34], eax
mov eax, dword [rsp + 0x38]
mov dword [rsp + 0x38], eax
mov qword [rsp + 0x40], r15
jmp 0x1400173a2
lea rdx, str.connection_aborted_by_SyncServer_during_sending_n
jmp 0x140017a53
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, qword [r13 + 0x6d8]
lea rdx, str.connection_aborted_by_server___d____d__n
mov r9d, eax
mov r8d, edi
call fcn.140019c40
jmp 0x140017a5f
mov rcx, qword [r13 + 0x6d8]
lea r8, [r13 + 0x734]
lea rdx, str.SyncServer_connection_error__s_n
call fcn.140019c40
mov rcx, r14
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x50]
mov edi, 1
mov dword [rsp + 0x68], edi
cmp rax, 0xffffffffffffffff
je 0x1400179c4
mov rcx, rax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x1400179f4
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x50]
xor ebx, ebx
mov ecx, ebx
mov qword [rsp + 0x60], rbx
jmp 0x1400179f6
xor ebx, ebx
mov qword [rsp + 0x68], rdi
cmp rax, 0xffffffffffffffff
je 0x140017a0f
mov rcx, rax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140017a2f
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x60], rbx
mov rcx, qword [rsp + 0x70]
mov dword [rsp + 0x6c], ebx
test rcx, rcx
je 0x140017a42
call fcn.1400272e4
mov eax, 0xffffffff
jmp 0x140017b0a
lea rdx, str.no_response_to_PING:_connection_will_be_aborted_n
mov rcx, qword [r13 + 0x6d8]
call fcn.140019c40
mov rcx, r14
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x50]
mov esi, 1
mov dword [rsp + 0x68], esi
cmp rax, 0xffffffffffffffff
je 0x140017a8a
mov rcx, rax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140017aba
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [rsp + 0x50]
xor ebx, ebx
mov ecx, ebx
mov qword [rsp + 0x60], rbx
jmp 0x140017abc
xor ebx, ebx
mov qword [rsp + 0x68], rsi
cmp rax, 0xffffffffffffffff
je 0x140017ad5
mov rcx, rax
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140017af5
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x60], rbx
mov dword [rsp + 0x6c], ebx
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x140017b08
call fcn.1400272e4
mov eax, edi
mov rcx, qword [rbp + 0xaf0]
xor rcx, rsp
call fcn.140020e70
mov rbx, qword [rsp + 0xc58]
add rsp, 0xc00
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
call fcn.140020f98
int3