Function at 0x1400059a0
Capabilities:
Resolve dns

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbp
push rbx
push rsi
push rdi
push r13
lea rbp, [rsp - 0x470]
sub rsp, 0x570
xor eax, eax
mov edi, r9d
mov rbx, rdx
mov qword [rsp + 0x70], rax
mov rsi, rcx
mov dword [rsp + 0x78], eax
xorps xmm0, xmm0
mov byte [rbp + 0x4b8], al
lea r9, [rax - 1]
mov edx, 0x100
lea rcx, [rbp - 0x30]
movups xmmword [rsp + 0x60], xmm0
call fcn.14003c218
mov edx, 0x100
lea rcx, [rbp - 0x30]
call fcn.14003e904
cmp word [rbp - 0x30], 0
mov dword [rsp + 0x40], edi
je 0x140005df5
lea r9, [rbp + 0x4b8]
lea r8, [rsp + 0x40]
lea rdx, [rbp - 0x30]
call fcn.140065250
test al, al
je 0x140005df5
mov qword [rsp + 0x5b0], r12
lea r8, [rbp + 0x1d0]
lea rdx, [rbp - 0x30]
mov qword [rsp + 0x568], r14
call fcn.140061410
xor r13d, r13d
mov r14d, 2
test al, al
jne 0x140005a64
mov dword [rsp + 0x48], r13d
jmp 0x140005c25
lea r8, [rsp + 0x50]
mov qword [rsp + 0x50], r13
lea rdx, [0x1401b839c]
mov r12d, r13d
lea rcx, [rbp + 0x250]
call fcn.140040c2c
mov rdi, rax
test rax, rax
je 0x140005c1b
mov qword [rsp + 0x560], r15
mov r14, r13
mov qword [rsp + 0x48], r13
cmp r12d, 1
jge 0x140005be2
xorps xmm0, xmm0
mov qword [rbp - 0x68], 0
xorps xmm1, xmm1
mov qword [rsp + 0x58], r13
lea r9, [rsp + 0x58]
mov dword [rbp - 0x60], 1
lea r8, [rbp - 0x68]
mov dword [rbp - 0x5c], 6
xor edx, edx
mov rcx, rdi
movdqu xmmword [rbp - 0x58], xmm0
movdqu xmmword [rbp - 0x48], xmm1
call qword [sym.imp.WS2_32.dll_GetAddrInfoW]
test eax, eax
jne 0x140005be2
mov rbx, qword [rsp + 0x58]
test rbx, rbx
je 0x140005be2
imul rax, r14, 0x1c
lea rcx, [rsp + 0x60]
add rcx, rax
lea r13, [rsp + 0x62]
mov qword [rbp - 0x80], rcx
lea rdx, [rsp + 0x64]
lea rcx, [rsp + 0x68]
add r13, rax
add rcx, rax
add rdx, rax
mov qword [rbp - 0x70], rcx
mov qword [rbp - 0x78], rdx
nop
cmp dword [rbx + 4], 2
mov r15, rdi
jne 0x140005bc7
mov rsi, qword [rbx + 0x20]
add rsi, 4
cmp dword [rsi], 0
je 0x140005bc7
cmp r12d, 1
jge 0x140005bc7
movsxd rax, r12d
lea r14, [rsp + 0x60]
imul rdx, rax, 0x1c
xor eax, eax
mov ecx, 7
add r14, rdx
mov rdi, r14
rep stosd dword [rdi], eax
lea rdi, [rsp + 0x64]
mov ecx, 1
add rdi, rdx
rep movsd dword [rdi], dword [rsi]
movzx ecx, word [rsp + 0x40]
call qword [sym.imp.WS2_32.dll_htons]
mov rsi, qword [rbp - 0x80]
mov r8, r14
mov rdx, r15
mov word [r13], ax
mov word [rsi], 2
call fcn.140061550
mov r14, qword [rsp + 0x48]
add rsi, 0x1c
add qword [rbp - 0x78], 0x1c
inc r14
inc r12d
mov qword [rsp + 0x48], r14
add r13, 0x1c
mov qword [rbp - 0x80], rsi
add qword [rbp - 0x70], 0x1c
mov rdi, r15
mov rbx, qword [rbx + 0x28]
test rbx, rbx
jne 0x140005b30
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.WS2_32.dll_FreeAddrInfoW]
xor r13d, r13d
lea r8, [rsp + 0x50]
xor ecx, ecx
lea rdx, [0x1401b839c]
call fcn.140040c2c
mov rdi, rax
test rax, rax
jne 0x140005aa0
mov r15, qword [rsp + 0x560]
lea r14d, [rax + 2]
mov rsi, qword [rbp + 0x4a0]
mov rbx, qword [rbp + 0x4a8]
mov dword [rsp + 0x48], r12d
test r12d, r12d
jne 0x140005c53
mov r8d, dword [rsp + 0x40]
lea rax, [rsp + 0x48]
mov word [rsp + 0x30], r14w
lea r9, [rsp + 0x60]
mov dword [rsp + 0x28], 1
lea rdx, [rbp - 0x30]
mov qword [rsp + 0x20], rax
call fcn.1400616c0
mov r12d, eax
mov r14, qword [rsp + 0x568]
test r12d, r12d
mov r12, qword [rsp + 0x5b0]
je 0x140005df5
mov r9d, dword [rbp + 0x4c0]
lea rdi, [rbx + 4]
mov rdx, rdi
mov byte [rsp + 0x28], 0
mov r8d, 0x438
mov qword [rsp + 0x20], r13
mov rcx, rsi
call fcn.140006980
test al, al
jne 0x140005cca
lea rcx, [rsi + 0x22c]
mov qword [rsp + 0x20], rdi
lea r9, str.socks4___connect_to__s_failed
mov edx, 0x100
mov r8, 0xffffffffffffffff
call fcn.140003a90
xor al, al
add rsp, 0x570
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret
movzx eax, word [rsp + 0x62]
lea r9, [rsp + 0x40]
mov word [rbp - 0x66], ax
lea rdx, [rbp - 0x68]
mov eax, dword [rsp + 0x64]
mov r8d, 9
mov rcx, rsi
mov dword [rbp - 0x64], eax
mov word [rbp - 0x68], 0x104
mov word [rbp - 0x60], 0
mov dword [rsp + 0x40], r13d
call fcn.140007b40
test al, al
jne 0x140005d42
lea r9, str.socks4___send_to__s_failed_with__u_error
mov eax, dword [rsp + 0x40]
lea rcx, [rsi + 0x22c]
mov dword [rsp + 0x28], eax
mov edx, 0xff
mov r8, 0xffffffffffffffff
mov qword [rsp + 0x20], rdi
call fcn.140003a90
xor al, al
add rsp, 0x570
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret
mov byte [rsp + 0x30], 0
lea rax, [rsp + 0x40]
mov dword [rsp + 0x28], 0x1388
lea r9, [rsp + 0x50]
mov r8d, 8
mov qword [rsp + 0x20], rax
lea rdx, [rbp - 0x68]
mov qword [rsp + 0x50], r13
mov rcx, rsi
call fcn.1400077c0
test al, al
jne 0x140005d82
lea r9, str.socks4___read_from__s_failed_with__u_error
jmp 0x140005d0d
movsx eax, byte [rbp - 0x67]
cmp al, 0x5a
je 0x140005dbf
mov ecx, eax
sub ecx, 0x5b
je 0x140005db6
sub ecx, 1
je 0x140005dad
cmp ecx, 1
je 0x140005da4
lea r8, str.socks4___unknown_error
jmp 0x140005dfc
lea r8, str.socks4___request_rejected_because_the_client_program_and_identd_report_have_different_user_ids
jmp 0x140005dfc
lea r8, str.socks4___request_rejected_because_SOCKS_server_cannot_connect_to_identd_on_the_client
jmp 0x140005dfc
lea r8, str.socks4___request_rejected_or_failed
jmp 0x140005dfc
lea rcx, [rsi + 0x2c]
mov r9, 0xffffffffffffffff
lea r8, [rbp - 0x30]
mov edx, 0x100
call fcn.14003c218
movzx eax, byte [rbp + 0x4b8]
mov byte [rsi + 0x448], al
mov al, 1
add rsp, 0x570
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret
lea r8, str.socks4___resolve_failed
mov r9, 0xffffffffffffffff
lea rcx, [rsi + 0x22c]
mov edx, 0x100
call fcn.14003c218
xor al, al
add rsp, 0x570
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret