Function at 0x140018240
Capabilities:
Resolve dns
Set thread local storage value

Disassembly:
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push r12
sub rsp, 0x60
mov rdi, qword [rcx]
mov rsi, rcx
lea rcx, str.worker
call fcn.140016370
xor r12d, r12d
mov eax, 1
mov dword [rsp + 0x40], r12d
lock xadd dword [0x140234154], eax
inc eax
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
mov dword [rsp + 0x44], eax
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov ecx, dword [0x140233490]
lea rdx, [rsp + 0x40]
mov qword [rsp + 0x48], rax
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov r11, qword [rdi + 0xd0]
test r11, r11
je 0x1400182ba
lea edx, [r12 + 1]
mov rcx, rdi
call r11
movsxd rax, dword [rsi + 8]
test eax, eax
js 0x1400185a9
cmp eax, dword [rdi + 0x40]
jae 0x1400185a9
mov ecx, dword [rdi + 0x60]
mov qword [rsp + 0x70], rbx
mov rbx, rax
imul rbx, rbx, 0x9b8
add rbx, qword [rdi + 0x20]
call fcn.140073404
mov qword [rbx + 0x960], rax
test rax, rax
jne 0x140018327
lea rax, [rdi + 0xf0]
mov qword [0x140234008], rdi
lea rdx, str.Out_of_memory:_Cannot_allocate_buffer_for_worker__i
mov qword [0x140234010], rax
mov r8d, dword [rsi + 8]
lea rcx, [0x140233740]
call fcn.14000e440
jmp 0x1400183b7
mov eax, dword [rdi + 0x60]
mov qword [rbx + 0x8c8], rdi
mov qword [rbx + 0x8d8], r12
mov dword [rbx + 0x980], eax
mov qword [rsp + 0x78], rbp
lea rbp, [rdi + 0xf0]
mov qword [rbx + 0x8d0], rbp
mov eax, dword [rsi + 8]
xor r8d, r8d
mov dword [rbx + 0x9b0], eax
mov rax, qword [rdi + 0xe8]
xor edx, edx
xor ecx, ecx
mov qword [rbx + 0x78], rax
call qword [sym.imp.KERNEL32.dll_CreateMutexA]
mov qword [rbx + 0x9a8], rax
test rax, rax
jne 0x1400183d1
mov rcx, qword [rbx + 0x960]
call fcn.1400733f0
lea r8, str.Cannot_create_mutex
lea rdx, [0x1400a24e0]
lea rcx, [0x140233740]
mov qword [0x140234008], rdi
mov qword [0x140234010], rbp
call fcn.14000e440
mov rbp, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x70]
lea r11, [rsp + 0x60]
xor eax, eax
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop r12
ret
mov eax, dword [rdi + 0x28]
test eax, eax
jne 0x140018564
nop dword [rax]
mov r8d, dword [rbx + 0x9b0]
lea rdx, [rbx + 0x8f0]
mov rcx, rdi
call fcn.14000de40
test eax, eax
je 0x140018564
xor ecx, ecx
call fcn.1400754a0
movzx ecx, word [rbx + 0x90a]
mov qword [rbx + 0x920], rax
call qword [sym.imp.WS2_32.dll_ntohs]
lea rcx, [rbx + 0x908]
lea r8, [rbx + 0x38]
movzx r11d, ax
mov dword [rbx + 0x70], r11d
mov byte [r8], r12b
test rcx, rcx
je 0x14001845b
cmp word [rcx], 2
jne 0x14001845b
mov edx, reloc.WS2_32.dll_recv
mov dword [rsp + 0x30], 2
mov dword [rsp + 0x28], r12d
lea r9d, [rdx + 0x20]
mov qword [rsp + 0x20], r12
call qword [sym.imp.WS2_32.dll_getnameinfo]
movzx eax, byte [rbx + 0x918]
mov rcx, rbx
mov dword [rbx + 0x74], eax
test al, al
je 0x140018554
mov rdx, qword [rbx + 0x8d0]
mov r9, qword [rbx + 0x8c8]
mov r8, qword [0x1400d0fd8]
mov rdx, qword [rdx]
add r9, 0x28
call fcn.1400155e0
mov rcx, rbx
test eax, eax
je 0x14001854d
call fcn.140010360
mov rcx, rbx
call fcn.140017fa0
mov rcx, qword [rbx + 0x490]
test rcx, rcx
je 0x140018559
mov rcx, qword [rcx + 8]
call fcn.1400733f0
mov rcx, qword [rbx + 0x490]
mov rcx, qword [rcx + 0x10]
call fcn.1400733f0
mov rcx, qword [rbx + 0x490]
mov rcx, qword [rcx + 0x18]
call fcn.1400733f0
mov rcx, qword [rbx + 0x490]
mov rcx, qword [rcx + 0x20]
call fcn.1400733f0
mov rcx, qword [rbx + 0x490]
mov rcx, qword [rcx]
call qword [0x1400d12e8]
mov r11, qword [rbx + 0x490]
mov qword [r11], r12
mov rax, qword [rbx + 0x490]
mov qword [rax + 8], r12
mov rax, qword [rbx + 0x490]
mov qword [rax + 0x10], r12
mov rax, qword [rbx + 0x490]
mov qword [rax + 0x18], r12
mov rax, qword [rbx + 0x490]
mov qword [rax + 0x20], r12
mov rcx, qword [rbx + 0x490]
call fcn.1400733f0
mov qword [rbx + 0x490], r12
jmp 0x140018559
call fcn.140011100
jmp 0x140018559
call fcn.140017fa0
mov eax, dword [rdi + 0x28]
test eax, eax
je 0x1400183e0
mov ecx, dword [0x140233490]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbx + 0x9a8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbx + 0x960]
mov dword [rbx + 0x980], r12d
call fcn.1400733f0
mov qword [rbx + 0x960], r12
jmp 0x1400183b2
lea rax, [rdi + 0xf0]
mov qword [0x140234008], rdi
lea rdx, str.Internal_error:_Invalid_worker_index__i
mov qword [0x140234010], rax
mov r8d, dword [rsi + 8]
lea rcx, [0x140233740]
call fcn.14000e440
jmp 0x1400183bc