Function at 0x140021080
Capabilities:
Resolve dns

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x40]
sub rsp, 0x140
mov rax, qword [0x14007a040]
xor rax, rsp
mov qword [rbp + 0x38], rax
movzx r13d, r9b
mov r12, r8
mov r14, rdx
mov r15, rcx
mov qword [rbp + 0x20], rdx
mov qword [rbp + 0x28], r8
xor edi, edi
mov qword [rsp + 0x30], rdi
mov rbx, rdx
cmp qword [rdx + 0x18], 0xf
jbe 0x1400210d3
mov rbx, qword [rdx]
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_gethostbyname]
test rax, rax
je 0x1400210f3
cmp word [rax + 0x10], 2
jne 0x1400210f3
mov rax, qword [rax + 0x18]
mov rcx, qword [rax]
mov eax, dword [rcx]
jmp 0x14002116c
mov dword [rbp + 0x30], 0
mov esi, edi
mov eax, 0x2e
lea rdx, [rbx + 1]
mov qword [rbp + 0x10], rdx
cmp byte [rbx], 0x30
je 0x140021146
mov r8d, 0xa
lea rdx, [rbp + 0x10]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_strtol]
cmp eax, 0xff
ja 0x140021170
mov rdx, qword [rbp + 0x10]
cmp rdx, rbx
je 0x140021170
mov rcx, rdx
sub rcx, rbx
cmp rcx, 3
jg 0x140021170
mov byte [rbp + rdi + 0x30], al
mov eax, 0x2e
xor ecx, ecx
cmp esi, 3
cmovl ecx, eax
movsx eax, byte [rdx]
cmp eax, ecx
jne 0x140021170
lea rbx, [rdx + 1]
inc esi
inc rdi
cmp rdi, 4
mov eax, 0x2e
jl 0x140021101
mov eax, dword [rbp + 0x30]
mov dword [rsp + 0x30], eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rdi, rax
mov rbx, r12
cmp qword [r12 + 0x18], 0xf
jbe 0x140021188
mov rbx, qword [r12]
mov dword [rax], 0
mov r8d, 0xa
lea rdx, [rbp + 0x18]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_strtol]
mov esi, eax
cmp rbx, qword [rbp + 0x18]
jne 0x1400211b7
lea rcx, str.invalid_stoi_argument
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Xinvalid_argument_char_const____ptr64_]
int3
cmp dword [rdi], 0x22
jne 0x1400211ca
lea rcx, str.stoi_argument_out_of_range
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Xout_of_range_char_const____ptr64_]
int3
mov word [rsp + 0x34], si
mov rcx, qword [r15 + 0x38]
test rcx, rcx
je 0x1400211e7
xor edx, edx
call fcn.140032d10
mov qword [r15 + 0x38], 0
mov rax, qword [r15 + 0x30]
mov byte [rax + 0x2b10], r13b
mov rbx, qword [r15 + 0x20]
xorps xmm0, xmm0
movups xmmword [rsp + 0x38], xmm0
xor r13d, r13d
mov qword [rsp + 0x48], r13
mov qword [rsp + 0x50], r13
lea r8d, [r13 + 0x24]
lea rdx, str.Connecting_to_Growtopia_server_:
lea rcx, [rsp + 0x38]
call fcn.14000e5a0
lea rax, [rsp + 0x38]
mov qword [rsp + 0x60], rax
lea rax, [rsp + 0x38]
cmp qword [rsp + 0x50], 0xf
cmova rax, qword [rsp + 0x38]
mov qword [rbp - 0x70], rax
mov rax, qword [rsp + 0x48]
mov qword [rbp - 0x68], rax
mov rcx, r14
cmp qword [r14 + 0x18], 0xf
jbe 0x140021255
mov rcx, qword [r14]
mov rax, qword [r14 + 0x10]
mov qword [rsp + 0x70], rcx
mov qword [rsp + 0x78], rax
movzx eax, si
mov dword [rbp - 0x60], eax
movups xmm0, xmmword [rsp + 0x70]
movups xmmword [rbp - 0x30], xmm0
movups xmm1, xmmword [rbp - 0x60]
movups xmmword [rbp - 0x20], xmm1
mov qword [rbp - 0x80], gethostbyname
lea rax, [rbp - 0x30]
mov qword [rbp - 0x78], rax
movaps xmm0, xmmword [rbp - 0x80]
movdqa xmmword [rbp - 0x50], xmm0
movaps xmm1, xmmword [rbp - 0x70]
movdqa xmmword [rbp - 0x40], xmm1
lea r8, [rbp - 0x50]
lea rdx, [rbp - 0x40]
lea rcx, [rbp - 0x10]
call fcn.140004090
lea r8, [rbp - 0x10]
mov edx, 1
mov rcx, rbx
call fcn.1400215a0
nop
mov rdx, qword [rsp + 0x50]
cmp rdx, 0xf
jbe 0x1400212ff
inc rdx
mov rcx, qword [rsp + 0x38]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400212fa
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400212fa
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14005b0bc
mov rax, qword [r15 + 0x30]
add dword [rax + 0x20], 0x6d2b79f5
mov ecx, dword [rax + 0x20]
mov edx, ecx
shr edx, 0xf
xor edx, ecx
or ecx, 1
imul edx, ecx
mov ecx, edx
shr ecx, 7
xor ecx, edx
mov eax, edx
or eax, 0x3d
imul ecx, eax
add ecx, edx
xor edx, ecx
mov eax, edx
shr eax, 0xe
xor eax, edx
mov dword [rsp + 0x20], eax
lea rdx, [rsp + 0x30]
mov rcx, qword [r15 + 0x30]
call fcn.1400339c0
mov qword [r15 + 0x38], rax
mov qword [r15 + 0x40], r13
mov rbx, qword [r15 + 0x48]
mov qword [r15 + 0x48], r13
mov esi, 0xffffffff
test rbx, rbx
je 0x140021389
mov eax, esi
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x140021389
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
mov eax, esi
lock xadd dword [rbx + 0xc], eax
cmp eax, 1
jne 0x140021389
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + reloc.WS2_32.dll_htonl]
mov rax, qword [r15 + 0x28]
test rax, rax
je 0x140021396
lock inc dword [rax + 8]
mov rax, qword [r15 + 0x20]
mov rbx, qword [r15 + 0x28]
test rbx, rbx
je 0x1400213a7
lock inc dword [rbx + 8]
mov qword [r15 + 0x40], rax
mov rdi, qword [r15 + 0x48]
mov qword [r15 + 0x48], rbx
test rdi, rdi
je 0x1400213e1
mov eax, esi
lock xadd dword [rdi + 8], eax
cmp eax, 1
jne 0x1400213e1
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax]
mov eax, esi
lock xadd dword [rdi + 0xc], eax
cmp eax, 1
jne 0x1400213e1
mov rax, qword [rdi]
mov rcx, rdi
call qword [rax + reloc.WS2_32.dll_htonl]
test rbx, rbx
je 0x14002140d
mov eax, esi
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x14002140d
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
lock xadd dword [rbx + 0xc], esi
cmp esi, 1
jne 0x14002140d
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + reloc.WS2_32.dll_htonl]
cmp qword [r15 + 0x38], 0
setne bl
mov rdx, qword [r14 + 0x18]
cmp rdx, 0xf
jbe 0x14002144f
mov rcx, qword [r14]
inc rdx
cmp rdx, 0x1000
jb 0x14002144a
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x1400214d4
mov rcx, r8
call fcn.14005b0bc
mov qword [r14 + 0x10], r13
mov qword [r14 + 0x18], reloc.WS2_32.dll_ntohs
mov byte [r14], 0
mov rdx, qword [r12 + 0x18]
cmp rdx, 0xf
jbe 0x140021497
inc rdx
mov rcx, qword [r12]
cmp rdx, 0x1000
jb 0x140021492
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x1400214db
mov rcx, r8
call fcn.14005b0bc
mov qword [r12 + 0x10], r13
mov qword [r12 + 0x18], reloc.WS2_32.dll_ntohs
mov byte [r12], 0
movzx eax, bl
mov rcx, qword [rbp + 0x38]
xor rcx, rsp
call fcn.14005ac30
mov rbx, qword [rsp + 0x198]
add rsp, 0x140
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
nop
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3