Function at 0x140040a30
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.140045cd0
movsxd rbp, eax
mov dword [r14 + rsi], ebx
test eax, eax
js 0x140040d06
mov r15d, 0x100
test di, di
je 0x140040c98
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.14003ff90
test eax, eax
je 0x140040d03
mov eax, 0x2f80
mov rax, qword [rax + rsi]
test rax, rax
jne 0x140040b07
call fcn.1401762d4
cmp dword [rax], 0x2740
jne 0x140040cd4
lea rcx, [rsp + 0x30]
call fcn.14005a780
test eax, eax
jne 0x140040d21
mov r10, qword [rsp + 0x30]
mov ebx, r14d
mov esi, dword [r10]
test esi, esi
je 0x140040b7b
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 0x140040b71
cmp dword [r8], 2
je 0x140040b7b
inc ebx
add r8, 0x18
cmp ebx, esi
jb 0x140040b50
mov rcx, r10
call fcn.1401762fc
cmp ebx, esi
jae 0x140040b93
lea rdx, str.failed_bind____d:_have_listen_on_the_port
jmp 0x140040cdb
cmp dword [rsp + 0xa0], r14d
jne 0x140040c98
mov rax, qword [0x14027dfc8]
mov dword [rsp + 0xa8], r12d
test rax, rax
je 0x140040bd9
lea r9, [rsp + 0xa8]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 4
mov ecx, ebp
call rax
jmp 0x140040c8c
cmp qword [0x14027e030], r14
je 0x140040c23
mov rax, qword [rsp + 0x38]
mov ecx, 0x22cc
cmp dword [rcx + rax], r14d
jne 0x140040c23
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 0x140040c26
jmp 0x140040c29
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 0x140040c5f
cmp dword [rbx + 0xc], 2
jne 0x140040c5f
cmp word [rbx + 0x6c], r14w
jne 0x140040c8f
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.140171260
mov r14d, eax
test r14d, r14d
jne 0x140040d33
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.14003ff90
test eax, eax
je 0x140040d03
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.14002d450
mov ecx, ebp
call fcn.1400474f0
jmp 0x140040d06
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.14002d920
int3
lea r8, str.SO_REUSEADDR
mov ecx, 0x4b0003
lea rdx, str.failed_setsockopt__s_:__m
call fcn.14002d450
lea rdx, str.failed_SO_REUSEADDR:__m
mov ecx, 0x4b0000
call fcn.14002d920
int3