Function at 0x140042490
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.14004b890]
lea rcx, [r12 - 8]
lea rdx, [rsp + 0x90]
call fcn.140029110
mov qword [rsp + 0x90], rax
xor r13d, r13d
mov rax, qword [0x14027e030]
test rax, rax
je 0x1400425fc
mov rcx, rax
call fcn.1401762fc
cmp dword [0x1402794e0], r13d
mov edi, r13d
mov qword [0x14027e030], r13
jle 0x14004254c
mov esi, r13d
nop dword [rax]
mov rbx, qword [0x1402794d8]
add rbx, rsi
mov rcx, qword [rbx]
test rcx, rcx
je 0x14004251a
call fcn.1401762fc
mov qword [rbx], r13
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x14004252c
call fcn.1401762fc
mov qword [rbx + 0x30], r13
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x14004253e
call fcn.1401762fc
mov qword [rbx + 8], r13
inc edi
add rsi, 0x38
cmp edi, dword [0x1402794e0]
jl 0x140042500
mov rcx, qword [0x1402794d8]
test rcx, rcx
je 0x140042564
call fcn.1401762fc
mov qword [0x1402794d8], r13
mov ecx, dword [0x140263d24]
mov qword [0x1402794e0], r13
test ecx, ecx
js 0x140042584
call fcn.1400474f0
mov dword [0x140263d24], 0xffffffff
mov edx, dword [0x1402794c8]
mov ebx, r13d
mov rcx, qword [0x1402794c0]
test edx, edx
jle 0x1400425d1
mov rdi, r13
nop dword [rax + rax]
mov rax, qword [rdi + rcx + 8]
lea rsi, [rdi + rcx]
test rax, rax
je 0x1400425c7
mov rcx, rax
call fcn.1401762fc
mov qword [rsi + 8], r13
mov edx, dword [0x1402794c8]
mov rcx, qword [0x1402794c0]
inc ebx
add rdi, 0x18
cmp ebx, edx
jl 0x1400425a0
test rcx, rcx
je 0x1400425e2
call fcn.1401762fc
mov qword [0x1402794c0], r13
lea rcx, [0x1402794d0]
mov qword [0x1402794c8], r13
call fcn.14004b890
mov rax, qword [0x14027e030]
test rbp, rbp
jne 0x140042612
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 0x140042822
test rax, rax
je 0x1400426c5
mov rax, qword gs:[0x58]
mov edx, 0x22cc
mov rcx, qword [rax]
cmp dword [rdx + rcx], r13d
jne 0x1400426c5
mov r9d, 0x75
lea r8d, [r15 + 0x72]
mov ecx, r9d
mov edx, r15d
call fcn.14003fba0
lea r8d, [r15 + 0xf]
mov edx, r15d
mov ecx, r15d
call fcn.140048c00
movsxd rdi, eax
test eax, eax
js 0x1400426dc
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 0x1400426bf
lea edx, [rax + 1]
mov ecx, 0xb0
call fcn.1401762f4
mov qword [rbx + 0x60], rax
mov byte [rax + 0x64], 0x75
jmp 0x1400426d8
mov r8d, reloc.WS2_32.dll_recvfrom
mov edx, r15d
mov ecx, r15d
call fcn.140048c00
mov edi, eax
test edi, edi
jns 0x140042702
lea rdx, str.failed_socket__:__m
mov ecx, 0x4b0003
call fcn.14002d450
mov edi, eax
test eax, eax
jns 0x140042702
mov dword [0x140263d24], 0xffffffff
jmp 0x140042d3f
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 0x1400427a8
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.140171260
test eax, eax
je 0x1400427a8
lea rdx, str.failed_ioctl_FIOBIO_:__m
mov ecx, 0x4b0003
call fcn.14002d450
test eax, eax
je 0x1400427af
mov ecx, edi
call fcn.1400474f0
or edi, 0xffffffff
jmp 0x1400427af
or dword [rsi + 0x68], 0x80
mov dword [0x140263d24], edi
test edi, edi
js 0x140042d3f
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.14003ff90
test eax, eax
jne 0x140042d51
mov rdx, rbp
lea rcx, [0x14027e030]
call fcn.14002a280
mov rdx, qword [0x14027e030]
mov rcx, qword [rsp + 0x90]
call fcn.14004ba90
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 0x140042d23
lea rsi, str.reject
lea r14, str.reuse
lea r15, str.mcast
inc eax
cmp eax, ecx
jle 0x14004289f
mov edx, eax
lea rcx, [0x1402794d8]
call fcn.140042ea0
mov eax, dword [0x1402794e0]
jmp 0x1400428a5
mov dword [0x1402794e0], eax
dec eax
lea r8, [fcn.14004b890]
movsxd rcx, eax
lea rdx, [rsp + 0x80]
imul rdi, rcx, 0x38
lea rcx, [r12 - 8]
add rdi, qword [0x1402794d8]
call fcn.140029110
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.14002a280
movsx ecx, byte [rbx]
mov r9d, 0x3e
xor r8d, r8d
mov dword [rsp + 0x20], 0x3c
mov r10, rbx
lea edx, [r9 - 0x3b]
call fcn.14003fba0
test eax, eax
jne 0x140042947
movsx ecx, byte [rbx + 1]
mov r9d, 0x3e
inc rbx
mov dword [rsp + 0x20], 0x3c
xor r8d, r8d
lea edx, [r9 - 0x3b]
call fcn.14003fba0
test eax, eax
je 0x140042922
mov r8, rbx
lea rcx, [rdi + 8]
sub r8, r10
mov rdx, r10
call fcn.14002a6f0
movsx r10d, byte [rbx]
mov edx, 2
mov ecx, r10d
lea r9d, [rdx + 0x3a]
lea r8d, [rdx + 0x3c]
call fcn.14003fba0
test eax, eax
je 0x140042e87
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.14004ba20
mov rbx, qword [rax]
mov rcx, qword [rbx]
test rcx, rcx
je 0x1400429bb
or rax, 0xffffffffffffffff
inc rax
cmp byte [rcx + rax], r13b
jne 0x1400429b0
jmp 0x1400429be
mov rax, r13
cmp eax, 1
jne 0x1400429fb
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.14003fba0
test eax, eax
je 0x140042d69
jmp 0x1400429ff
mov byte [rdi + 0x22], reloc.WS2_32.dll_WSACleanup
mov r8, qword [rbx]
test r8, r8
je 0x140042d7f
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 0x140042a3a
cmp rcx, 7
jne 0x140042a20
or dword [rdi + 0x24], 2
jmp 0x140042aad
mov rcx, r13
nop dword [rax]
movzx eax, byte [r8 + rcx]
inc rcx
cmp al, byte [r14 + rcx - 1]
jne 0x140042a5b
cmp rcx, 6
jne 0x140042a40
or dword [rdi + 0x24], 4
jmp 0x140042aad
mov rax, r13
nop
movzx ecx, byte [r8 + rax]
inc rax
cmp cl, byte [r15 + rax - 1]
jne 0x140042a7b
cmp rax, 6
jne 0x140042a60
or dword [rdi + 0x24], 8
jmp 0x140042aad
lea rdx, [0x1401ab8bc]
mov rcx, r8
call fcn.14002a120
test eax, eax
je 0x140042aa1
mov rcx, qword [rbx]
lea rdx, [0x1401ab8c0]
call fcn.14002a120
test eax, eax
jne 0x140042ac3
mov rdx, qword [rbx]
lea rcx, [rdi + 0x30]
call fcn.14002a280
mov r8, qword [rbx + 8]
add rbx, 8
test r8, r8
je 0x140042d7f
jmp 0x140042a10
mov rcx, qword [rbx]
test rcx, rcx
je 0x140042d7f
movzx eax, byte [rdi + 0x22]
cmp al, 0x70
jne 0x140042b38
cmp qword [rdi + 0x30], r13
je 0x140042dc1
call fcn.14016db00
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 0x140042dab
mov rcx, qword [rbx + 8]
call fcn.14016db00
mov edx, eax
mov eax, 0x100
movzx ecx, dx
imul ecx, eax
shr dx, 8
add cx, dx
mov word [rdi + 0x20], cx
je 0x140042d95
add rbx, 0x10
jmp 0x140042cfc
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.14003fba0
test eax, eax
je 0x140042e71
mov r15, qword gs:[0x58]
mov eax, 0x2f80
mov r14d, eax
mov rsi, qword [r15]
mov rax, qword [rsi + rax]
test rax, rax
jne 0x140042b7f
call fcn.1401762d4
mov dword [rax], r13d
mov rcx, qword [rbx]
movzx eax, byte [rcx]
cmp al, byte [0x1401ab97c]
jne 0x140042ba1
movzx eax, byte [rcx + 1]
cmp al, byte [0x1401ab97d]
jne 0x140042ba1
mov eax, r13d
jmp 0x140042ba6
call fcn.140170a70
mov dword [rdi + 0x14], eax
mov rax, qword [rsi + r14]
test rax, rax
jne 0x140042bb7
call fcn.1401762d4
cmp dword [rax], r13d
jne 0x140042e5b
mov rcx, qword [rbx + 8]
add rbx, 8
test rcx, rcx
je 0x140042e45
call fcn.14016db00
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.14003fba0
test eax, eax
je 0x140042c3d
cmp word [rdi + 0x18], r13w
je 0x140042c3d
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x140042dd7
call fcn.14016db00
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 0x140042c46
movzx edx, word [rdi + 0x18]
mov eax, 8
add rbx, rax
mov word [rdi + 0x1a], dx
cmp qword [rbx], r13
je 0x140042e2f
mov rsi, qword [r15]
mov rax, qword [rsi + r14]
test rax, rax
jne 0x140042c67
call fcn.1401762d4
mov dword [rax], r13d
mov rcx, qword [rbx]
movzx eax, byte [rcx]
cmp al, byte [0x1401ab97c]
jne 0x140042c89
movzx eax, byte [rcx + 1]
cmp al, byte [0x1401ab97d]
jne 0x140042c89
mov eax, r13d
jmp 0x140042c8e
call fcn.140170a70
mov dword [rdi + 0x1c], eax
mov rax, qword [rsi + r14]
test rax, rax
jne 0x140042c9f
call fcn.1401762d4
cmp dword [rax], r13d
jne 0x140042e19
mov rcx, qword [rbx + 8]
add rbx, 8
test rcx, rcx
je 0x140042cd6
call fcn.14016db00
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 0x140042ce7
cmp word [rdi + 0x20], r13w
je 0x140042ded
lea rsi, str.reject
lea r14, str.reuse
lea r15, str.mcast
cmp qword [rbx], r13
jne 0x140042e03
mov rbx, qword [rbp + 8]
add rbp, 8
test rbx, rbx
je 0x140042d23
mov ecx, dword [0x1402794e4]
mov eax, dword [0x1402794e0]
jmp 0x140042883
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.140028d40
int3
mov r8d, 0x14c9
lea rdx, str.jtest_tr:_port__d_already_in_use
mov ecx, 0x4b
call fcn.140028d40
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.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_a:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_tr__port_src__htons_atoi_a__:__s
mov ecx, 0x4b
call fcn.140028d40
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.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_tr__dev:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_a:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr___tr__proti___tr__port_src_:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr__a:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr__errno:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_a:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_a:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr__errno:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_0:__s
mov ecx, 0x4b
call fcn.140028d40
int3
mov r8, qword [rbp]
lea rdx, str.invalid_sock_tr_int_is_in_dir_______:__s
mov ecx, 0x4b
call fcn.140028d40
int3