Function at 0x140120790
Capabilities:
Check for time delay via gettickcount
Get local ipv4 addresses
Resolve dns
Send data
Send data on socket
Send http request
Send http request with host header
Set socket configuration

Disassembly:
mov qword [rsp + 0x18], rbx
mov dword [rsp + 0x10], edx
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x630]
sub rsp, 0x730
movzx r12d, byte [rbp + 0x698]
xor eax, eax
mov rsi, qword [rbp + 0x6a0]
mov r13, r8
mov qword [rsp + 0x40], rax
mov edi, edx
mov dword [rsp + 0x5c], eax
mov eax, 1
mov dword [rsp + 0x60], eax
mov dword [rbp + 0x698], eax
mov dword [rsp + 0x64], r12d
test rsi, rsi
je 0x1401207f6
mov dword [rsi], 0xffffffff
mov r14d, dword [rbp + 0x690]
cmp r9d, eax
mov r15d, 2
mov eax, reloc.WS2_32.dll_socket
mov ecx, r15d
mov ebx, 0x76c
cmovne ebx, r9d
mov edx, r15d
test r14d, r14d
lea r8d, [r15 + 0xf]
cmovne ecx, eax
call qword [sym.imp.WS2_32.dll_socket]
mov qword [rsp + 0x30], rax
cmp rax, 0xffffffffffffffff
jne 0x140120870
test rsi, rsi
je 0x140120840
mov dword [rsi], 0xffffff9b
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, r15d
mov ebx, eax
call fcn.14015878c
mov rcx, rax
lea r8, str.socket
mov r9d, ebx
lea rdx, str.Socket_error:__s___d_n
call fcn.14007f080
xor eax, eax
jmp 0x140121299
xorps xmm0, xmm0
xor eax, eax
mov qword [rbp - 0xe], rax
mov dword [rbp - 6], eax
mov word [rbp - 2], ax
lea r15d, [rax + 0x10]
movups xmmword [rbp - 0x7e], xmm0
movups xmmword [rbp - 0x6e], xmm0
movups xmmword [rbp - 0x5e], xmm0
movups xmmword [rbp - 0x4e], xmm0
movups xmmword [rbp - 0x3e], xmm0
movups xmmword [rbp - 0x2e], xmm0
movups xmmword [rbp - 0x1e], xmm0
test r14d, r14d
je 0x14012093d
mov eax, reloc.WS2_32.dll_socket
mov word [rbp - 0x80], ax
lea eax, [rbx - 1]
cmp eax, 0xfffe
ja 0x1401208c9
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
mov word [rbp - 0x7e], ax
movups xmm0, xmmword [0x1401a3738]
movups xmmword [rbp - 0x78], xmm0
mov r14, qword [rsp + 0x30]
lea r9, [rsp + 0x60]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 4
mov rcx, r14
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140120ade
test rsi, rsi
je 0x14012090d
mov dword [rsi], 0xffffff9b
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, 2
mov ebx, eax
call fcn.14015878c
mov rcx, rax
lea r8, str.setsockopt_SO_REUSEADDR_..._
mov r9d, ebx
lea rdx, str.Socket_error:__s___d_n
call fcn.14007f080
jmp 0x14012128b
mov eax, 2
mov word [rbp - 0x80], ax
lea eax, [rbx - 1]
cmp eax, 0xfffe
ja 0x14012095d
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
mov word [rbp - 0x7e], ax
lea rcx, str.223.255.255.255
mov dword [rbp - 0x7c], 0
call qword [sym.imp.WS2_32.dll_inet_addr]
mov ecx, eax
lea rdx, [rsp + 0x38]
call sub.IPHLPAPI.DLL_GetBestInterface
test eax, eax
jne 0x1401208d4
xor r14d, r14d
mov eax, 0x3c00
mov dword [rbp + 0x688], eax
xor esi, esi
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, ebx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
je 0x140120a0e
xor r8d, r8d
lea rax, [rbp + 0x688]
mov r9, rdi
mov qword [rsp + 0x20], rax
mov edx, r15d
lea ecx, [r8 + 2]
call sub.IPHLPAPI.DLL_GetAdaptersAddresses
mov r14d, eax
cmp eax, 0x6f
jne 0x140120a0e
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
inc esi
cmp esi, 3
jge 0x1401209fc
mov eax, dword [rbp + 0x688]
jmp 0x140120995
mov edi, dword [rbp + 0x678]
mov rsi, qword [rbp + 0x6a0]
jmp 0x1401208d4
test r14d, r14d
jne 0x140120acb
mov rax, rdi
test rdi, rdi
je 0x1401209fc
mov edx, dword [rsp + 0x38]
cmp dword [rax + 4], edx
jne 0x140120a31
mov rcx, qword [rax + 0x18]
test rcx, rcx
jne 0x140120a65
mov rax, qword [rax + 8]
test rax, rax
jne 0x140120a23
mov r14, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [rbp + 0x678]
mov rsi, qword [rbp + 0x6a0]
jmp 0x1401208d9
mov rsi, qword [rcx + 0x10]
lea r9, [rsp + 0x58]
mov r14, qword [rsp + 0x30]
xor edx, edx
mov rcx, r14
mov dword [rsp + 0x20], 4
mov eax, dword [rsi + 4]
lea r8d, [rdx + 9]
mov dword [rsp + 0x58], eax
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140120ac0
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, 2
mov ebx, eax
call fcn.14015878c
mov rcx, rax
lea r8, str.setsockopt
mov r9d, ebx
lea rdx, str.Socket_error:__s___d_n
call fcn.14007f080
mov eax, dword [rsi + 4]
mov dword [rbp - 0x7c], eax
jmp 0x140120a3f
mov r14, qword [rsp + 0x30]
test rdi, rdi
je 0x140120a53
jmp 0x140120a3f
mov ebx, dword [rbp + 0x690]
mov r8d, 0xa
mov dword [rsp + 0x20], 4
test ebx, ebx
je 0x140120b55
mov dword [rbp + 0x688], r12d
lea r9, [rbp + 0x688]
mov r12, qword [rsp + 0x30]
lea edx, [r8 + 0x1f]
mov rcx, r12
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140120ba5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r14d, 2
mov ebx, eax
mov ecx, r14d
call fcn.14015878c
mov rcx, rax
lea r8, str.setsockopt_IPV6_MULTICAST_HOPS_..._
mov r9d, ebx
lea rdx, str.Socket_error:__s___d_n
call fcn.14007f080
mov ebx, dword [rbp + 0x690]
jmp 0x140120bab
mov r12, qword [rsp + 0x30]
lea r9, [rsp + 0x64]
mov rcx, r12
xor edx, edx
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140120ba5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov r14d, 2
mov ebx, eax
mov ecx, r14d
call fcn.14015878c
mov rcx, rax
lea r8, str.setsockopt_IP_MULTICAST_TTL_..._
mov r9d, ebx
lea rdx, str.Socket_error:__s___d_n
call fcn.14007f080
mov ebx, dword [rbp + 0x690]
jmp 0x140120bab
mov r14d, 2
test r13, r13
je 0x140120c16
test ebx, ebx
jne 0x140120c16
mov rcx, r13
call qword [sym.imp.WS2_32.dll_inet_addr]
mov dword [rbp + 0x688], eax
cmp eax, 0xffffffff
je 0x140120c16
lea r9, [rbp + 0x688]
mov dword [rbp - 0x7c], eax
xor edx, edx
mov dword [rsp + 0x20], 4
lea r8d, [rbx + 9]
mov rcx, r12
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140120c16
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, r14d
mov ebx, eax
call fcn.14015878c
mov rcx, rax
lea r8, str.setsockopt_IP_MULTICAST_IF
mov r9d, ebx
lea rdx, str.Socket_error:__s___d_n
call fcn.14007f080
mov ebx, dword [rbp + 0x690]
lea rdx, [rbp - 0x80]
mov eax, 0x1c
test ebx, ebx
mov rcx, r12
cmovne r15d, eax
mov r8d, r15d
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
je 0x140120c7f
test rsi, rsi
je 0x140120c46
mov dword [rsi], 0xffffff9b
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, r14d
mov ebx, eax
call fcn.14015878c
mov rcx, rax
lea r8, str.bind
mov r9d, ebx
lea rdx, str.Socket_error:__s___d_n
call fcn.14007f080
mov rcx, r12
call qword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x140121299
mov r15, qword [rbp + 0x6a0]
test r15, r15
je 0x140120c92
mov dword [r15], 0
mov r13, qword [rbp + 0x670]
mov eax, 0x10624dd3
mul edi
mov eax, 1
shr edx, 6
test edx, edx
mov ecx, edx
cmove ecx, eax
mov eax, 0x3e8
cmovne eax, edi
mov dword [rsp + 0x6c], ecx
cmp qword [r13], 0
mov dword [rbp + 0x688], eax
je 0x140121286
xor r14d, r14d
lea rdx, str._FF02::C_
test ebx, ebx
mov ebx, dword [rbp + 0x698]
je 0x140120cef
test ebx, ebx
lea r9, str._FF05::C_
cmovne r9, rdx
jmp 0x140120cf6
lea r9, str.239.255.255.250
mov rax, qword [r13]
lea r8, str.M_SEARCH__HTTP_1.1_r_nHOST:__s:1900_r_nST:__s_r_nMAN:__ssdp:discover__r_nMX:__u_r_n_r_n
mov dword [rsp + 0x28], ecx
mov edx, 0x600
lea rcx, [rbp + 0x30]
mov qword [rsp + 0x20], rax
call fcn.14011fd60
mov esi, eax
cmp eax, 0x600
jae 0x1401212b4
xorps xmm0, xmm0
mov edi, 2
movups xmmword [rbp], xmm0
mov dword [rbp + 8], edi
movups xmmword [rbp + 0x10], xmm0
movups xmmword [rbp + 0x20], xmm0
cmp dword [rbp + 0x690], r14d
je 0x140120d5b
test ebx, ebx
lea rcx, str.FF05::C
lea rax, str.FF02::C
cmovne rcx, rax
jmp 0x140120d62
lea rcx, str.239.255.255.250
lea r9, [rsp + 0x78]
lea r8, [rbp]
lea rdx, str.1900
call qword [sym.imp.WS2_32.dll_getaddrinfo]
mov ebx, eax
test eax, eax
jne 0x140121261
mov rdi, qword [rsp + 0x78]
test rdi, rdi
je 0x140120e13
lea r15d, [rax + 2]
lea r13d, [rax + 1]
nop dword [rax + rax]
mov eax, dword [rdi + 0x10]
lea rdx, [rbp + 0x30]
mov dword [rsp + 0x28], eax
xor r9d, r9d
mov rax, qword [rdi + 0x20]
mov r8d, esi
mov rcx, r12
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_sendto]
mov esi, eax
test eax, eax
jns 0x140120df4
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ecx, r15d
mov ebx, eax
call fcn.14015878c
mov rcx, rax
lea r8, str.sendto
mov r9d, ebx
lea rdx, str.Socket_error:__s___d_n
call fcn.14007f080
jmp 0x140120df7
mov r14d, r13d
mov rdi, qword [rdi + 0x28]
test rdi, rdi
jne 0x140120da0
mov r15, qword [rbp + 0x6a0]
mov r13, qword [rbp + 0x670]
mov rdi, qword [rsp + 0x78]
mov rcx, rdi
call qword [sym.imp.WS2_32.dll_freeaddrinfo]
test r14d, r14d
jne 0x140120e2f
test r15, r15
je 0x140120e38
mov dword [r15], 0xffffff9b
jmp 0x140120e38
cmp dword [rbp + 0x6a8], 0
je 0x140120e43
cmp qword [r13 + 8], 0
jne 0x1401211ce
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
mov eax, edx
shr eax, 6
mov dword [rsp + 0x58], eax
imul eax, eax, 0x3e8
sub ecx, eax
mov eax, dword [rbp + 0x688]
mov dword [rsp + 0x68], ecx
jmp 0x140120e75
mov r12, qword [rsp + 0x30]
mov rbx, qword [rsp + 0x40]
nop word [rax + rax]
lea rcx, [rsp + 0x5c]
mov r9d, eax
mov qword [rsp + 0x20], rcx
lea rdx, [rbp + 0x30]
mov rcx, r12
mov r8d, 0x600
call fcn.140122b00
mov dword [rsp + 0x38], eax
mov esi, eax
test eax, eax
js 0x140121248
je 0x1401211b2
xor r10d, r10d
mov qword [rsp + 0x48], r10
mov r12d, r10d
mov qword [rsp + 0x50], r10
mov r13d, r10d
mov qword [rsp + 0x70], r10
mov r15d, r10d
mov edx, r10d
mov ebx, r10d
mov ecx, r10d
mov edi, r10d
mov r14d, r10d
test eax, eax
jle 0x14012117a
movzx eax, byte [rbp + r14 + 0x30]
cmp al, 0xa
je 0x140120f1d
cmp al, 0xd
je 0x140120f1d
mov r9, qword [rsp + 0x48]
mov r8, qword [rsp + 0x50]
cmp al, 0x3a
jne 0x140121011
test ebx, ebx
mov rax, r14
cmovne rax, rcx
mov rcx, rax
mov eax, edi
cmovne eax, ebx
mov ebx, eax
jmp 0x140121011
test ebx, ebx
je 0x140121004
lea rax, [rbp + 0x30]
add rax, rcx
nop dword [rax]
inc ebx
lea rax, [rax + 1]
cmp byte [rax], 0x20
je 0x140120f30
movsxd rax, edx
lea rsi, [rbp + 0x30]
add rsi, rax
lea rdx, str.location:
mov rcx, rsi
mov r8d, 9
call fcn.14015e738
test eax, eax
jne 0x140120f85
mov r8, qword [rsp + 0x50]
lea r9, [rbp + 0x30]
mov esi, dword [rsp + 0x38]
mov r12d, edi
movsxd rax, ebx
sub r12d, ebx
add r9, rax
xor ebx, ebx
xor ecx, ecx
mov qword [rsp + 0x48], r9
jmp 0x14012100e
mov r8d, 3
lea rdx, [0x1401a329c]
mov rcx, rsi
call fcn.14015e738
test eax, eax
jne 0x140120fc2
mov r9, qword [rsp + 0x48]
lea r8, [rbp + 0x30]
mov esi, dword [rsp + 0x38]
mov r13d, edi
movsxd rax, ebx
sub r13d, ebx
add r8, rax
xor ebx, ebx
xor ecx, ecx
mov qword [rsp + 0x50], r8
jmp 0x14012100e
mov r8d, 4
lea rdx, str.usn:
mov rcx, rsi
call fcn.14015e738
mov r9, qword [rsp + 0x48]
test eax, eax
jne 0x140120ff5
movsxd rax, ebx
lea r10, [rbp + 0x30]
add r10, rax
mov r15d, edi
mov qword [rsp + 0x70], r10
sub r15d, ebx
mov r8, qword [rsp + 0x50]
xor ebx, ebx
mov esi, dword [rsp + 0x38]
xor ecx, ecx
jmp 0x14012100e
mov r9, qword [rsp + 0x48]
mov r8, qword [rsp + 0x50]
lea edx, [rdi + 1]
inc edi
inc r14
cmp edi, esi
jl 0x140120ee5
test r8, r8
je 0x14012117a
test r9, r9
je 0x14012117a
mov rax, qword [rsp + 0x40]
mov rbx, rax
test rax, rax
je 0x1401210c8
movsxd rsi, r12d
movsxd r14, r13d
movsxd rdi, r15d
nop word [rax + rax]
mov rcx, qword [rbx + 8]
mov r8, rsi
mov rdx, r9
call fcn.14015e460
test eax, eax
jne 0x1401210bb
mov rax, qword [rbx + 8]
cmp byte [rsi + rax], 0
jne 0x1401210bb
mov rdx, qword [rsp + 0x50]
mov r8, r14
mov rcx, qword [rbx + 0x10]
call fcn.14015e460
test eax, eax
jne 0x1401210bb
mov rax, qword [rbx + 0x10]
cmp byte [r14 + rax], 0
jne 0x1401210bb
test r15d, r15d
je 0x1401210a7
mov rdx, qword [rsp + 0x70]
mov r8, rdi
mov rcx, qword [rbx + 0x18]
call fcn.14015e460
test eax, eax
jne 0x1401210bb
mov rax, qword [rbx + 0x18]
cmp byte [rdi + rax], 0
mov eax, dword [rbp + 0x688]
je 0x140120e70
mov rbx, qword [rbx]
mov r9, qword [rsp + 0x48]
test rbx, rbx
jne 0x140121050
movsxd rsi, r13d
movsxd rdi, r15d
movsxd r14, r12d
lea rcx, [rsi + 0x2b]
add rcx, rdi
add rcx, r14
call fcn.140159b98
mov rbx, rax
test rax, rax
je 0x140121216
mov rax, qword [rsp + 0x40]
lea rcx, [rbx + 0x24]
mov rdx, qword [rsp + 0x48]
mov r8, r14
mov qword [rbx], rax
lea rax, [r14 + 0x25]
add rax, rbx
mov qword [rbx + 8], rcx
mov qword [rbx + 0x10], rax
inc rax
add rax, rsi
mov qword [rbx + 0x18], rax
call fcn.140149970
mov rdx, qword [rsp + 0x50]
mov r8, rsi
mov byte [rbx + r14 + 0x24], 0
mov rcx, qword [rbx + 0x10]
call fcn.140149970
lea eax, [r12 + r13]
movsxd rcx, eax
mov rax, qword [rsp + 0x70]
mov byte [rcx + rbx + 0x25], 0
test rax, rax
je 0x14012115a
mov rcx, qword [rbx + 0x18]
mov r8, rdi
mov rdx, rax
call fcn.140149970
mov esi, dword [rsp + 0x38]
lea eax, [r15 + r13]
add eax, r12d
mov qword [rsp + 0x40], rbx
cdqe
mov byte [rax + rbx + 0x26], 0
mov eax, dword [rsp + 0x5c]
mov dword [rbx + 0x20], eax
jmp 0x14012117f
mov rbx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r12, qword [rsp + 0x30]
mov ecx, eax
imul eax, dword [rsp + 0x58], 0x3e8
sub ecx, eax
mov eax, dword [rbp + 0x688]
sub ecx, dword [rsp + 0x68]
cmp ecx, eax
jg 0x1401211c0
mov qword [rsp + 0x40], rbx
test esi, esi
jle 0x1401211c0
jmp 0x140120e80
test rbx, rbx
je 0x1401211c0
cmp dword [rbp + 0x6a8], 0
je 0x14012122f
mov r13, qword [rbp + 0x670]
mov r15, qword [rbp + 0x6a0]
mov ebx, dword [rbp + 0x690]
test ebx, ebx
je 0x1401211fb
cmp dword [rbp + 0x698], 0
je 0x1401211f1
mov dword [rbp + 0x698], 0
sub r13, 8
jmp 0x1401211fb
mov dword [rbp + 0x698], 1
add r13, 8
mov qword [rbp + 0x670], r13
cmp qword [r13], 0
je 0x140121286
mov ecx, dword [rsp + 0x6c]
jmp 0x140120ccc
mov rax, qword [rbp + 0x6a0]
mov r14, qword [rsp + 0x30]
test rax, rax
je 0x14012128b
mov dword [rax], 0xffffff9a
jmp 0x14012128b
mov rax, qword [rbp + 0x6a0]
mov r14, qword [rsp + 0x30]
test rax, rax
je 0x14012128b
mov dword [rax], 0
jmp 0x14012128b
mov rax, qword [rbp + 0x6a0]
mov r14, qword [rsp + 0x30]
test rax, rax
je 0x14012128b
mov dword [rax], 0xffffff9b
jmp 0x14012128b
test r15, r15
je 0x14012126d
mov dword [r15], 0xffffff9b
mov ecx, edi
call fcn.14015878c
mov rcx, rax
lea rdx, str.getaddrinfo___failed:__d_n
mov r8d, ebx
call fcn.14007f080
mov r14, qword [rsp + 0x30]
mov rcx, r14
call qword [sym.imp.WS2_32.dll_closesocket]
mov rax, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x780]
add rsp, 0x730
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov r14, qword [rsp + 0x30]
test r15, r15
je 0x14012128b
mov dword [r15], 0xffffff9a
jmp 0x14012128b