Function at 0x140040830
Capabilities:
Set socket configuration

Disassembly:
mov qword [rsp + 0x10], rbx
mov dword [rsp + 0x18], r8d
mov dword [rsp + 8], ecx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x50
mov rax, qword gs:[0x58]
or r13d, 0xffffffff
mov r14d, 0x22c8
mov r12d, 1
movzx edi, dx
mov ecx, r12d
mov rsi, qword [rax]
lea edx, [r13 + 7]
mov eax, r12d
mov qword [rsp + 0x38], rsi
mov ebx, dword [r14 + rsi]
test ebx, ebx
cmovne eax, ebx
xor r8d, r8d
mov dword [r14 + rsi], eax
call fcn.140045ad0
movsxd rbp, eax
mov dword [r14 + rsi], ebx
test eax, eax
js 0x140040b06
mov r15d, 0x100
test di, di
je 0x140040a98
xor eax, eax
lea r8d, [r13 + 0x11]
mov qword [rsp + 0x40], rax
lea rdx, [rsp + 0x40]
mov qword [rsp + 0x48], rax
xor r14d, r14d
mov eax, 2
mov qword [rsp + 0x30], r14
mov word [rsp + 0x40], ax
mov ecx, ebp
mov eax, dword [rsp + 0x90]
mov dword [rsp + 0x44], eax
mov word [rsp + 0x42], di
call fcn.14003fd90
test eax, eax
je 0x140040b03
mov eax, 0x2f80
mov rax, qword [rax + rsi]
test rax, rax
jne 0x140040907
call fcn.1401760e4
cmp dword [rax], 0x2740
jne 0x140040ad4
lea rcx, [rsp + 0x30]
call fcn.14005a580
test eax, eax
jne 0x140040b21
mov r10, qword [rsp + 0x30]
mov ebx, r14d
mov esi, dword [r10]
test esi, esi
je 0x14004097b
movzx eax, r15w
lea r8, [r10 + 4]
movzx r9d, di
imul r9d, eax
movzx eax, di
shr ax, 8
add r9w, ax
nop
movzx edx, word [r8 + 8]
mov ecx, edx
movzx eax, r15w
imul ecx, eax
shr dx, 8
add cx, dx
cmp cx, r9w
jne 0x140040971
cmp dword [r8], 2
je 0x14004097b
inc ebx
add r8, 0x18
cmp ebx, esi
jb 0x140040950
mov rcx, r10
call fcn.14017610c
cmp ebx, esi
jae 0x140040993
lea rdx, str.failed_bind____d:_have_listen_on_the_port
jmp 0x140040adb
cmp dword [rsp + 0xa0], r14d
jne 0x140040a98
mov rax, qword [0x14027dfc8]
mov dword [rsp + 0xa8], r12d
test rax, rax
je 0x1400409d9
lea r9, [rsp + 0xa8]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 4
mov ecx, ebp
call rax
jmp 0x140040a8c
cmp qword [0x14027e030], r14
je 0x140040a23
mov rax, qword [rsp + 0x38]
mov ecx, 0x22cc
cmp dword [rcx + rax], r14d
jne 0x140040a23
lea rcx, [0x14027dfa0]
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x14027e020]
lea rcx, [0x14027dfa0]
mov rsi, rbp
mov rbx, qword [rax + rbp*8]
call sub.KERNEL32.dll_LeaveCriticalSection
test dword [rbx + 0x68], 0x10000000
jne 0x140040a26
jmp 0x140040a29
mov rsi, rbp
mov r12d, r14d
lea rcx, [0x14027dfa0]
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x14027e020]
lea rcx, [0x14027dfa0]
mov rbx, qword [rax + rsi*8]
call sub.KERNEL32.dll_LeaveCriticalSection
cmp qword [rbx + 0x40], r14
je 0x140040a5f
cmp dword [rbx + 0xc], 2
jne 0x140040a5f
cmp word [rbx + 0x6c], r14w
jne 0x140040a8f
movsxd rcx, dword [rbx + 0x70]
lea r9, [rsp + 0xa8]
mov r8d, 4
mov dword [rsp + 0x20], 4
mov edx, 0xffff
call qword [sym.imp.WS2_32.dll_setsockopt]
movsxd rcx, eax
call fcn.140171070
mov r14d, eax
test r14d, r14d
jne 0x140040b33
xor eax, eax
lea rdx, [rsp + 0x40]
mov qword [rsp + 0x40], rax
mov r8d, reloc.WS2_32.dll_recv
mov qword [rsp + 0x48], rax
mov ecx, ebp
mov eax, 2
mov word [rsp + 0x42], di
mov word [rsp + 0x40], ax
mov eax, dword [rsp + 0x90]
mov dword [rsp + 0x44], eax
call fcn.14003fd90
test eax, eax
je 0x140040b03
lea rdx, str.failed_bind____d:__m
movzx ecx, di
movzx eax, r15w
imul ecx, eax
shr di, 8
add cx, di
movzx r8d, cx
mov ecx, 0x4b0003
call fcn.14002d250
mov ecx, ebp
call fcn.1400472f0
jmp 0x140040b06
mov r13d, ebp
mov eax, r13d
mov rbx, qword [rsp + 0x98]
add rsp, 0x50
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
lea rdx, str.failed_getting_tcp_table
mov ecx, 0x4b0000
call fcn.14002d720
int3
lea r8, str.SO_REUSEADDR
mov ecx, 0x4b0003
lea rdx, str.failed_setsockopt__s_:__m
call fcn.14002d250
lea rdx, str.failed_SO_REUSEADDR:__m
mov ecx, 0x4b0000
call fcn.14002d720
int3