Function at 0x140005020
Capabilities:
Create raw socket
Get socket status
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket

Disassembly:
push rbp
push rsi
lea rbp, [rsp - 0x1d8]
sub rsp, 0x2d8
mov rax, qword [0x1400ce110]
xor rax, rsp
mov qword [rbp + 0x1b0], rax
xor sil, sil
cmp byte [rcx], sil
jne 0x140005052
xor al, al
jmp 0x140005216
mov qword [rsp + 0x300], rdi
mov qword [rsp + 0x2d0], r13
xor r13d, r13d
mov rcx, rdx
mov edi, r13d
call qword [sym.imp.WS2_32.dll_gethostbyname]
test rax, rax
je 0x14000535b
mov r8, qword [rax + 0x18]
mov qword [rsp + 0x2f0], rbx
mov r9d, 4
mov r8, qword [r8]
mov qword [rsp + 0x308], r12
lea rcx, [rsp + 0x40]
mov edx, r9d
mov qword [rsp + 0x2c8], r14
mov qword [rsp + 0x2c0], r15
call qword [sym.imp.MSVCR120.dll_memcpy_s]
mov ecx, dword [rsp + 0x40]
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov r15d, 2
lea edx, [r13 + 3]
lea r8d, [r13 + 1]
mov ecx, r15d
mov rbx, rax
call qword [sym.imp.WS2_32.dll_socket]
mov rcx, rbx
mov r14, rax
call qword [sym.imp.WS2_32.dll_inet_addr]
mov word [rsp + 0x50], r15w
mov dword [rsp + 0x54], eax
call qword [sym.imp.MSVCR120.dll_rand]
mov dword [rsp + 0x48], r13d
mov word [rsp + 0x52], ax
mov dword [rsp + 0x4c], 0x4c4b40
call qword [sym.imp.MSVCR120.dll_rand]
mov ecx, eax
call qword [sym.imp.WS2_32.dll_htons]
lea ecx, [r13 + 0x28]
mov word [rsp + 0x34], ax
call sub.MSVCR120.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__
xor ecx, ecx
mov r15, rax
mov byte [rsp + 0x31], dil
call qword [sym.imp.WS2_32.dll_htons]
mov r9d, 8
lea r8, [rsp + 0x30]
mov rcx, r15
mov edx, r9d
mov word [rsp + 0x36], ax
mov byte [rsp + 0x30], 8
mov word [rsp + 0x32], r13w
call qword [sym.imp.MSVCR120.dll_memcpy_s]
movabs rax, 0x7878787878787878
mov qword [r15 + 8], rax
mov qword [r15 + 0x10], rax
mov qword [r15 + 0x18], rax
lea edx, [r13 + 0x28]
mov rcx, r15
mov qword [r15 + 0x20], rax
call fcn.140004f30
movzx ecx, ax
call qword [sym.imp.WS2_32.dll_htons]
mov r9d, 8
lea r8, [rsp + 0x30]
mov edx, r9d
mov rcx, r15
mov word [rsp + 0x32], ax
call qword [sym.imp.MSVCR120.dll_memcpy_s]
lea rax, [rsp + 0x50]
lea r8d, [r13 + 0x28]
xor r9d, r9d
mov rdx, r15
mov rcx, r14
mov dword [rsp + 0x28], recvfrom
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_sendto]
lea rcx, [rsp + 0x70]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetSystemTime]
cmp ebx, 0xffffffff
jne 0x14000522f
mov rcx, r15
call sub.MSVCR120.dll_void___cdecl_operator_delete_void____ptr64_
xor al, al
mov r14, qword [rsp + 0x2c8]
mov rbx, qword [rsp + 0x2f0]
mov r12, qword [rsp + 0x308]
mov r15, qword [rsp + 0x2c0]
mov rdi, qword [rsp + 0x300]
mov r13, qword [rsp + 0x2d0]
mov rcx, qword [rbp + 0x1b0]
xor rcx, rsp
call fcn.14000bf30
add rsp, 0x2d8
pop rsi
pop rbp
ret
lea rax, [rsp + 0x48]
lea rdx, [rbp - 0x60]
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
mov qword [rbp - 0x58], r14
mov qword [rsp + 0x20], rax
mov dword [rbp - 0x60], 1
call qword [sym.imp.WS2_32.dll_select]
cmp eax, 1
jl 0x140005342
lea rdx, [rbp - 0x60]
mov rcx, r14
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140005342
mov ecx, 0x5dc
call sub.MSVCR120.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__
xor r9d, r9d
mov r8d, 0x5dc
mov rcx, r14
mov rdx, rax
mov qword [rsp + 0x28], r13
mov rdi, rax
mov qword [rsp + 0x20], r13
call qword [sym.imp.WS2_32.dll_recvfrom]
movsxd rbx, eax
cmp ebx, 0xffffffff
je 0x140005342
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_GetSystemTime]
mov r9d, 8
lea r8, [rdi + 0x14]
lea rcx, [rsp + 0x38]
mov edx, r9d
call qword [sym.imp.MSVCR120.dll_memcpy_s]
mov r9d, reloc.WS2_32.dll_sendto
lea rcx, [rbp - 0x80]
mov edx, r9d
mov r8, rdi
call qword [sym.imp.MSVCR120.dll_memcpy_s]
movzx ecx, word [rsp + 0x3a]
call qword [sym.imp.WS2_32.dll_ntohs]
mov word [rsp + 0x3a], ax
cmp byte [rsp + 0x38], r13b
jne 0x140005342
movzx eax, word [rsp + 0x34]
cmp word [rsp + 0x3c], ax
jne 0x140005342
movzx eax, word [rsp + 0x36]
cmp word [rsp + 0x3e], ax
jne 0x140005342
lea edx, [rbx - 0x14]
lea rcx, [rdi + 0x14]
call fcn.140005360
test al, al
je 0x140005342
lea r8, [rbx - 0x1c]
lea rdx, [rdi + 0x1c]
lea rcx, [r15 + 8]
call sub.MSVCR120.dll_memcmp
movzx esi, sil
test eax, eax
mov eax, 1
cmove esi, eax
mov rcx, rdi
call sub.MSVCR120.dll_void___cdecl_operator_delete_void____ptr64_
mov rcx, r15
call sub.MSVCR120.dll_void___cdecl_operator_delete_void____ptr64_
movzx eax, sil
jmp 0x1400051e6
jmp 0x140005206