Function at 0x140042230
Capabilities:
Resolve function by parsing pe exports
Set socket configuration

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
sub rsp, 0x40
mov r14d, edx
lea r12, [rsp + 0x78]
mov rbp, rcx
lea r8, [fcn.14004b630]
lea rcx, [r12 - 8]
lea rdx, [rsp + 0x90]
call fcn.140028eb0
mov qword [rsp + 0x90], rax
xor r13d, r13d
mov rax, qword [0x14027e030]
test rax, rax
je 0x14004239c
mov rcx, rax
call fcn.1401760ac
cmp dword [0x1402794e0], r13d
mov edi, r13d
mov qword [0x14027e030], r13
jle 0x1400422ec
mov esi, r13d
nop dword [rax]
mov rbx, qword [0x1402794d8]
add rbx, rsi
mov rcx, qword [rbx]
test rcx, rcx
je 0x1400422ba
call fcn.1401760ac
mov qword [rbx], r13
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x1400422cc
call fcn.1401760ac
mov qword [rbx + 0x30], r13
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x1400422de
call fcn.1401760ac
mov qword [rbx + 8], r13
inc edi
add rsi, 0x38
cmp edi, dword [0x1402794e0]
jl 0x1400422a0
mov rcx, qword [0x1402794d8]
test rcx, rcx
je 0x140042304
call fcn.1401760ac
mov qword [0x1402794d8], r13
mov ecx, dword [0x140263d24]
mov qword [0x1402794e0], r13
test ecx, ecx
js 0x140042324
call fcn.140047290
mov dword [0x140263d24], 0xffffffff
mov edx, dword [0x1402794c8]
mov ebx, r13d
mov rcx, qword [0x1402794c0]
test edx, edx
jle 0x140042371
mov rdi, r13
nop dword [rax + rax]
mov rax, qword [rdi + rcx + 8]
lea rsi, [rdi + rcx]
test rax, rax
je 0x140042367
mov rcx, rax
call fcn.1401760ac
mov qword [rsi + 8], r13
mov edx, dword [0x1402794c8]
mov rcx, qword [0x1402794c0]
inc ebx
add rdi, 0x18
cmp ebx, edx
jl 0x140042340
test rcx, rcx
je 0x140042382
call fcn.1401760ac
mov qword [0x1402794c0], r13
lea rcx, [0x1402794d0]
mov qword [0x1402794c8], r13
call fcn.14004b630
mov rax, qword [0x14027e030]
test rbp, rbp
jne 0x1400423b2
xor eax, eax
add rsp, 0x40
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
mov qword [rsp + 0x88], r15
mov r15d, 2
mov qword [0x1402794c0], r13
mov qword [0x1402794c8], r13
test r14d, r14d
jne 0x1400425c2
test rax, rax
je 0x140042465
mov rax, qword gs:[0x58]
mov edx, 0x22cc
mov rcx, qword [rax]
cmp dword [rdx + rcx], r13d
jne 0x140042465
mov r9d, 0x75
lea r8d, [r15 + 0x72]
mov ecx, r9d
mov edx, r15d
call fcn.14003f940
lea r8d, [r15 + 0xf]
mov edx, r15d
mov ecx, r15d
call fcn.1400489a0
movsxd rdi, eax
test eax, eax
js 0x14004247c
lea rcx, [0x14027dfa0]
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x14027e020]
lea rcx, [0x14027dfa0]
mov rbx, qword [rax + rdi*8]
call sub.KERNEL32.dll_LeaveCriticalSection
mov rax, qword [rbx + 0x60]
test rax, rax
jne 0x14004245f
lea edx, [rax + 1]
mov ecx, 0xb0
call fcn.1401760a4
mov qword [rbx + 0x60], rax
mov byte [rax + 0x64], 0x75
jmp 0x140042478
mov r8d, reloc.WS2_32.dll_recvfrom
mov edx, r15d
mov ecx, r15d
call fcn.1400489a0
mov edi, eax
test edi, edi
jns 0x1400424a2
lea rdx, str.failed_socket__:__m
mov ecx, 0x4b0003
call fcn.14002d1f0
mov edi, eax
test eax, eax
jns 0x1400424a2
mov dword [0x140263d24], 0xffffffff
jmp 0x140042adf
lea rcx, [0x14027dfa0]
mov dword [rsp + 0x80], 1
call sub.KERNEL32.dll_EnterCriticalSection
movsxd rax, edi
lea rcx, [0x14027dfa0]
lea rbx, [rax*8]
mov rax, qword [0x14027e020]
mov rsi, qword [rbx + rax]
call sub.KERNEL32.dll_LeaveCriticalSection
test byte [rsi + 0x68], 1
je 0x140042548
lea rcx, [0x14027dfa0]
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x14027e020]
lea rcx, [0x14027dfa0]
mov rbx, qword [rbx + rax]
call sub.KERNEL32.dll_LeaveCriticalSection
movsxd rcx, dword [rbx + 0x70]
lea r8, [rsp + 0x80]
mov edx, 0x8004667e
call qword [sym.imp.WS2_32.dll_ioctlsocket]
movsxd rcx, eax
call fcn.140171010
test eax, eax
je 0x140042548
lea rdx, str.failed_ioctl_FIOBIO_:__m
mov ecx, 0x4b0003
call fcn.14002d1f0
test eax, eax
je 0x14004254f
mov ecx, edi
call fcn.140047290
or edi, 0xffffffff
jmp 0x14004254f
or dword [rsi + 0x68], 0x80
mov dword [0x140263d24], edi
test edi, edi
js 0x140042adf
lea rcx, [0x14027dfa0]
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x14027e020]
lea rcx, [0x14027dfa0]
movsxd rdx, edi
mov rbx, qword [rax + rdx*8]
call sub.KERNEL32.dll_LeaveCriticalSection
or dword [rbx + 0x68], 0x10000000
lea rdx, [rsp + 0x30]
mov ecx, dword [0x140263d24]
xor eax, eax
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0xc9140002
lea r8d, [rax + 0x10]
mov dword [rsp + 0x34], 0x100007f
call fcn.14003fd30
test eax, eax
jne 0x140042af1
mov rdx, rbp
lea rcx, [0x14027e030]
call fcn.14002a020
mov rdx, qword [0x14027e030]
mov rcx, qword [rsp + 0x90]
call fcn.14004b830
mov ecx, r13d
mov rbp, qword [rax]
mov eax, r13d
mov qword [0x1402794d8], r13
mov dword [0x1402794e0], eax
mov dword [0x1402794e4], ecx
mov rbx, qword [rbp]
test rbx, rbx
je 0x140042ac3
lea rsi, str.reject
lea r14, str.reuse
lea r15, str.mcast
inc eax
cmp eax, ecx
jle 0x14004263f
mov edx, eax
lea rcx, [0x1402794d8]
call fcn.140042c40
mov eax, dword [0x1402794e0]
jmp 0x140042645
mov dword [0x1402794e0], eax
dec eax
lea r8, [fcn.14004b630]
movsxd rcx, eax
lea rdx, [rsp + 0x80]
imul rdi, rcx, 0x38
lea rcx, [r12 - 8]
add rdi, qword [0x1402794d8]
call fcn.140028eb0
mov qword [rsp + 0x80], rax
mov rdx, rbx
xor eax, eax
mov rcx, rdi
mov qword [rdi], rax
mov qword [rdi + 8], rax
mov qword [rdi + 0x10], rax
mov qword [rdi + 0x18], rax
mov qword [rdi + 0x20], rax
mov qword [rdi + 0x28], rax
mov qword [rdi + 0x30], rax
call fcn.14002a020
movsx ecx, byte [rbx]
mov r9d, 0x3e
xor r8d, r8d
mov dword [rsp + 0x20], 0x3c
mov r10, rbx
lea edx, [r9 - 0x3b]
call fcn.14003f940
test eax, eax
jne 0x1400426e7
movsx ecx, byte [rbx + 1]
mov r9d, 0x3e
inc rbx
mov dword [rsp + 0x20], 0x3c
xor r8d, r8d
lea edx, [r9 - 0x3b]
call fcn.14003f940
test eax, eax
je 0x1400426c2
mov r8, rbx
lea rcx, [rdi + 8]
sub r8, r10
mov rdx, r10
call fcn.14002a490
movsx r10d, byte [rbx]
mov edx, 2
mov ecx, r10d
lea r9d, [rdx + 0x3a]
lea r8d, [rdx + 0x3c]
call fcn.14003f940
test eax, eax
je 0x140042c27
cmp r10b, r9b
lea rdx, [rbx + 1]
mov eax, r13d
lea r8, [0x1401a679c]
sete al
xor r9d, r9d
mov dword [rdi + 0x10], eax
mov rcx, qword [rsp + 0x80]
call fcn.14004b7c0
mov rbx, qword [rax]
mov rcx, qword [rbx]
test rcx, rcx
je 0x14004275b
or rax, 0xffffffffffffffff
inc rax
cmp byte [rcx + rax], r13b
jne 0x140042750
jmp 0x14004275e
mov rax, r13
cmp eax, 1
jne 0x14004279b
movsx eax, byte [rcx]
mov edx, 4
mov ecx, eax
mov dword [rsp + 0x28], reloc.WS2_32.dll_WSASetLastError
mov byte [rdi + 0x22], al
add rbx, 8
mov dword [rsp + 0x20], WSASetLastError
lea r9d, [rdx + 0x71]
lea r8d, [rdx + 0x70]
call fcn.14003f940
test eax, eax
je 0x140042b09
jmp 0x14004279f
mov byte [rdi + 0x22], reloc.WS2_32.dll_WSACleanup
mov r8, qword [rbx]
test r8, r8
je 0x140042b1f
nop dword [rax + rax]
mov rcx, r13
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [r8 + rcx]
inc rcx
cmp al, byte [rsi + rcx - 1]
jne 0x1400427da
cmp rcx, 7
jne 0x1400427c0
or dword [rdi + 0x24], 2
jmp 0x14004284d
mov rcx, r13
nop dword [rax]
movzx eax, byte [r8 + rcx]
inc rcx
cmp al, byte [r14 + rcx - 1]
jne 0x1400427fb
cmp rcx, 6
jne 0x1400427e0
or dword [rdi + 0x24], 4
jmp 0x14004284d
mov rax, r13
nop
movzx ecx, byte [r8 + rax]
inc rax
cmp cl, byte [r15 + rax - 1]
jne 0x14004281b
cmp rax, 6
jne 0x140042800
or dword [rdi + 0x24], 8
jmp 0x14004284d
lea rdx, [0x1401ab8cc]
mov rcx, r8
call fcn.140029ec0
test eax, eax
je 0x140042841
mov rcx, qword [rbx]
lea rdx, [0x1401ab8d0]
call fcn.140029ec0
test eax, eax
jne 0x140042863
mov rdx, qword [rbx]
lea rcx, [rdi + 0x30]
call fcn.14002a020
mov r8, qword [rbx + 8]
add rbx, 8
test r8, r8
je 0x140042b1f
jmp 0x1400427b0
mov rcx, qword [rbx]
test rcx, rcx
je 0x140042b1f
movzx eax, byte [rdi + 0x22]
cmp al, 0x70
jne 0x1400428d8
cmp qword [rdi + 0x30], r13
je 0x140042b61
call fcn.14016d8b0
mov edx, eax
mov eax, 0x100
movzx ecx, dx
imul ecx, eax
shr dx, 8
add cx, dx
mov word [rdi + 0x18], cx
mov word [rdi + 0x1a], cx
je 0x140042b4b
mov rcx, qword [rbx + 8]
call fcn.14016d8b0
mov edx, eax
mov eax, 0x100
movzx ecx, dx
imul ecx, eax
shr dx, 8
add cx, dx
mov word [rdi + 0x20], cx
je 0x140042b35
add rbx, 0x10
jmp 0x140042a9c
mov edx, 3
movsx ecx, al
mov dword [rsp + 0x20], reloc.WS2_32.dll_WSACleanup
lea r9d, [rdx + 0x72]
lea r8d, [rdx + 0x66]
call fcn.14003f940
test eax, eax
je 0x140042c11
mov r15, qword gs:[0x58]
mov eax, 0x2f80
mov r14d, eax
mov rsi, qword [r15]
mov rax, qword [rsi + rax]
test rax, rax
jne 0x14004291f
call fcn.140176084
mov dword [rax], r13d
mov rcx, qword [rbx]
movzx eax, byte [rcx]
cmp al, byte [0x1401ab98c]
jne 0x140042941
movzx eax, byte [rcx + 1]
cmp al, byte [0x1401ab98d]
jne 0x140042941
mov eax, r13d
jmp 0x140042946
call fcn.140170820
mov dword [rdi + 0x14], eax
mov rax, qword [rsi + r14]
test rax, rax
jne 0x140042957
call fcn.140176084
cmp dword [rax], r13d
jne 0x140042bfb
mov rcx, qword [rbx + 8]
add rbx, 8
test rcx, rcx
je 0x140042be5
call fcn.14016d8b0
mov edx, eax
mov esi, 0x100
movzx ecx, dx
shr dx, 8
movzx eax, si
imul ecx, eax
add cx, dx
mov edx, 2
mov word [rdi + 0x18], cx
movsx ecx, byte [rdi + 0x22]
lea r9d, [rdx + 0x72]
lea r8d, [rdx + 0x73]
call fcn.14003f940
test eax, eax
je 0x1400429dd
cmp word [rdi + 0x18], r13w
je 0x1400429dd
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x140042b77
call fcn.14016d8b0
mov ecx, eax
movzx eax, si
movzx edx, cx
imul edx, eax
mov eax, reloc.WS2_32.dll_recv
shr cx, 8
add dx, cx
jmp 0x1400429e6
movzx edx, word [rdi + 0x18]
mov eax, 8
add rbx, rax
mov word [rdi + 0x1a], dx
cmp qword [rbx], r13
je 0x140042bcf
mov rsi, qword [r15]
mov rax, qword [rsi + r14]
test rax, rax
jne 0x140042a07
call fcn.140176084
mov dword [rax], r13d
mov rcx, qword [rbx]
movzx eax, byte [rcx]
cmp al, byte [0x1401ab98c]
jne 0x140042a29
movzx eax, byte [rcx + 1]
cmp al, byte [0x1401ab98d]
jne 0x140042a29
mov eax, r13d
jmp 0x140042a2e
call fcn.140170820
mov dword [rdi + 0x1c], eax
mov rax, qword [rsi + r14]
test rax, rax
jne 0x140042a3f
call fcn.140176084
cmp dword [rax], r13d
jne 0x140042bb9
mov rcx, qword [rbx + 8]
add rbx, 8
test rcx, rcx
je 0x140042a76
call fcn.14016d8b0
mov edx, eax
mov eax, 0x100
movzx ecx, dx
imul ecx, eax
shr dx, 8
add cx, dx
mov word [rdi + 0x20], cx
add rbx, 8
cmp byte [rdi + 0x22], 0x69
jne 0x140042a87
cmp word [rdi + 0x20], r13w
je 0x140042b8d
lea rsi, str.reject
lea r14, str.reuse
lea r15, str.mcast
cmp qword [rbx], r13
jne 0x140042ba3
mov rbx, qword [rbp + 8]
add rbp, 8
test rbx, rbx
je 0x140042ac3
mov ecx, dword [0x1402794e4]
mov eax, dword [0x1402794e0]
jmp 0x140042623
mov eax, 1
mov r15, qword [rsp + 0x88]
add rsp, 0x40
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret
lea rdx, str.failed_socket
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8d, 0x14c9
lea rdx, str.jtest_tr:_port__d_already_in_use
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_int_is_in_tr__prot__t__u__i__p_:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_a:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_tr__port_src__htons_atoi_a__:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_tr__tr_port__tr__port_dst__htons_atoi_a__:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_tr__dev:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_a:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr___tr__proti___tr__port_src_:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr__a:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr__errno:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_a:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_a:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr__errno:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_0:__s
mov ecx, 0x4b
call fcn.140028ae0
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_int_is_in_dir_______:__s
mov ecx, 0x4b
call fcn.140028ae0
int3