Function at 0x140055120
Capabilities:
Connect socket

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r12
push r13
push r14
sub rsp, 0x90
mov rax, qword [rcx]
mov r12d, r9d
movzx ebp, r8w
mov r14, rdx
mov rbx, rcx
call qword [rax + 0x1e8]
test eax, eax
je 0x14005559c
xor esi, esi
mov r13d, 1
mov edi, esi
xor eax, eax
lock cmpxchg dword [rbx + 0x1c0], r13d
je 0x140055195
mov eax, edi
and eax, 0xfff
cmp eax, 0xfff
jne 0x140055186
call qword [sym.imp.KERNEL32.dll_SwitchToThread]
inc edi
jmp 0x140055161
mov eax, edi
and eax, 0x3f
cmp al, 0x3f
jne 0x140055191
pause
inc edi
jmp 0x140055161
nop
mov eax, dword [rbx + 0xac]
cmp eax, 3
jne 0x140055584
mov dword [rbx + 0xac], esi
mov rcx, rbx
mov dword [rbx + 0x1c0], esi
mov rax, qword [rbx]
call qword [rax + 0x1f0]
lea rax, [rsp + 0x70]
mov dword [rbx + 0x50], r13d
mov qword [rsp + 0x28], rax
lea r8, [rsp + 0x30]
mov rax, qword [rsp + 0xe0]
movzx r9d, bp
mov rdx, r14
mov qword [rsp + 0x20], rax
mov rcx, rbx
mov qword [rbx + 0x54], 5
mov dword [rbx + 0x5c], r13d
mov word [rsp + 0x30], si
mov word [rsp + 0x70], si
call fcn.140054060
test eax, eax
je 0x140055540
movzx eax, word [rsp + 0x70]
mov edi, 0x1c
mov r14d, reloc.WS2_32.dll_recv
cmp ax, 2
je 0x1400552c1
cmp ax, 0x17
je 0x1400552c1
movzx ebp, word [rsp + 0xe8]
test bp, bp
je 0x140055340
cmp ax, 2
je 0x1400552dd
cmp ax, 0x17
je 0x1400552dd
mov rax, qword gs:[0x58]
mov ecx, dword [0x1403abf78]
mov edx, 4
mov qword [rsp + 0xc0], r15
movzx r15d, word [rsp + 0x30]
mov r14, qword [rax + rcx*8]
add r14, rdx
mov eax, dword [r14]
cmp dword [0x1403aa24c], eax
jg 0x1400555c5
mov eax, dword [r14]
cmp dword [0x1403aa26c], eax
jg 0x140055615
cmp r15w, 2
lea rcx, [0x1403aa250]
mov r15, qword [rsp + 0xc0]
lea rax, [0x1403aa230]
cmovne rax, rcx
mov r14d, reloc.WS2_32.dll_recv
jmp 0x1400552e2
movzx ebp, word [rsp + 0xe8]
test bp, bp
jne 0x14005523f
cmp ax, 2
lea rdx, [rsp + 0x70]
jmp 0x140055315
lea rax, [rsp + 0x70]
movups xmm0, xmmword [rax]
movzx ecx, bp
movsd xmm1, qword [rax + 0x10]
mov eax, dword [rax + 0x18]
movups xmmword [rsp + 0x50], xmm0
mov dword [rsp + 0x68], eax
movsd qword [rsp + 0x60], xmm1
call qword [sym.imp.WS2_32.dll_htons]
cmp word [rsp + 0x50], 2
lea rdx, [rsp + 0x50]
mov word [rsp + 0x52], ax
mov rcx, qword [rbx + 0x60]
mov r8d, edi
cmove r8d, r14d
call qword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x140055340
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [rbx + 0xa4], 4
jmp 0x140055550
call fcn.140057bb0
xor ecx, ecx
mov qword [rbx + 0x70], rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, qword [rbx]
mov rcx, rbx
mov rdx, qword [rbx + 0x60]
call qword [rax + 0x178]
cmp eax, 2
je 0x140055524
mov rcx, qword [rbx + 0x60]
test r12d, r12d
je 0x140055447
mov rdx, qword [rbx + 0x68]
mov r8d, gethostbyname
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
je 0x140055512
cmp word [rsp + 0x30], 2
lea rdx, [rsp + 0x30]
mov rcx, qword [rbx + 0x60]
cmove edi, r14d
mov r8d, edi
call qword [sym.imp.WS2_32.dll_connect]
test eax, eax
je 0x1400553ca
cmp eax, 0xffffffff
jne 0x140055512
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x140055512
mov eax, r13d
test eax, eax
je 0x140055512
lea rax, [rbx + 0xa0]
mov r9, rbx
mov qword [rsp + 0x28], rax
lea r8, [0x140055810]
xor edx, edx
mov dword [rsp + 0x20], esi
xor ecx, ecx
call fcn.1402344e0
mov r8d, dword [0x1403a2044]
lea rdx, section..text
mov qword [rbx + 0x98], rax
xor r9d, r9d
lea rax, [rbx + 0x38]
mov qword [rbx + 0x30], rsi
mov rcx, rbx
mov qword [rsp + 0x20], rax
call fcn.140058dc0
cmp qword [rbx + 0x98], rsi
je 0x1400554f9
mov rcx, qword [rbx + 0x40]
mov esi, r13d
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, r13d
jmp 0x14005559e
mov edx, r13d
call fcn.1400585e0
test eax, eax
jne 0x1400555ba
cmp word [rsp + 0x30], 2
lea rdx, [rsp + 0x30]
mov rcx, qword [rbx + 0x60]
cmove edi, r14d
mov r8d, edi
call qword [sym.imp.WS2_32.dll_connect]
mov edi, eax
test eax, eax
je 0x14005549d
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x2733
jne 0x140055512
cmp edi, 0xffffffff
jne 0x14005550a
mov edx, dword [rbx + 0x7c]
mov rcx, qword [rbx + 0x60]
call fcn.140058740
mov edi, eax
test edi, edi
jne 0x14005550a
mov rdx, qword [rbx + 0x68]
mov r8d, 0x23
mov rcx, qword [rbx + 0x60]
call qword [sym.imp.WS2_32.dll_WSAEventSelect]
cmp eax, 0xffffffff
je 0x140055512
mov dword [rbx + 0xa8], r13d
xor ecx, ecx
mov dword [rbx + 0xac], r13d
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x180]
cmp eax, 2
jne 0x1400553ca
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, 0x4c7
test eax, eax
cmove eax, ecx
mov ecx, eax
jmp 0x14005550c
mov dword [rbx + 0xa4], 8
mov ecx, 0x65f
jmp 0x140055552
mov ecx, edi
call qword [sym.imp.WS2_32.dll_WSASetLastError]
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [rbx + 0xa4], reloc.WS2_32.dll_inet_addr
jmp 0x140055550
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, 0x4c7
mov dword [rbx + 0xa4], 5
test eax, eax
cmove eax, ecx
jmp 0x140055550
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [rbx + 0xa4], 3
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [rbx + 0x50], esi
mov qword [rbx + 0x54], 5
mov dword [rbx + 0x5c], r13d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, qword [rbx]
mov rcx, rbx
mov edi, eax
call qword [rdx + reloc.WS2_32.dll_htonl]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, esi
jmp 0x14005559e
mov ecx, 0x139f
mov dword [rbx + 0xa4], r13d
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [rbx + 0x1c0], esi
xor eax, eax
lea r11, [rsp + 0x90]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsp, r11
pop r14
pop r13
pop r12
pop rdi
pop rsi
ret
mov ecx, 0x80004005
call fcn.1400569a0
int3
lea rcx, [0x1403aa24c]
call fcn.14022dc94
cmp dword [0x1403aa24c], 0xffffffff
jne 0x14005528b
mov eax, 2
lea rcx, [0x1403aa24c]
mov word [0x1403aa230], ax
xorps xmm0, xmm0
xor eax, eax
mov qword [0x1403aa242], rax
mov word [0x1403aa24a], ax
movups xmmword [0x1403aa232], xmm0
call fcn.14022dc28
jmp 0x14005528b
lea rcx, [0x1403aa26c]
call fcn.14022dc94
cmp dword [0x1403aa26c], 0xffffffff
jne 0x14005529a
mov eax, reloc.WS2_32.dll_socket
lea rcx, [0x1403aa26c]
mov word [0x1403aa250], ax
xorps xmm0, xmm0
xor eax, eax
mov qword [0x1403aa262], rax
mov word [0x1403aa26a], ax
movups xmmword [0x1403aa252], xmm0
call fcn.14022dc28
jmp 0x14005529a