Function at 0x1400509f0
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push rbp
push rbx
push rdi
lea rbp, [rsp - 0x4080]
mov eax, 0x4180
call fcn.1401be380
sub rsp, rax
mov rax, qword [0x1402581e0]
xor rax, rsp
mov qword [rbp + 0x4060], rax
mov ebx, dword [0x140258b58]
mov rdi, qword [0x1402dde88]
test ebx, ebx
jne 0x140050a47
cmp dword [0x1402c7bbc], ebx
je 0x140050a47
lea rdx, str.API_disabled
lea ecx, [rbx + 4]
call fcn.140040950
jmp 0x140051163
mov qword [rsp + 0x41a0], rsi
mov qword [rsp + 0x41a8], r12
mov qword [rsp + 0x41b0], r13
mov qword [rsp + 0x4170], r15
lea r13, str.___API_will_not_be_available
test rdi, rdi
je 0x140050a95
call fcn.1400506b0
cmp dword [reloc.WS2_32.dll_accept], 0
jne 0x140050a95
lea rdx, str.API_not_running__no_valid_IPs_specified__s
mov r8, r13
mov ecx, 1
call fcn.140040950
mov edx, 8
lea ecx, [rdx - 7]
call qword [sym.imp.MSVCR120.dll_calloc]
mov ecx, 0x3e8
mov r12, rax
call qword [sym.imp.KERNEL32.dll_Sleep]
xor r8d, r8d
mov esi, 2
lea edx, [r8 + 1]
mov ecx, esi
call qword [sym.imp.WS2_32.dll_socket]
mov r15, rax
mov qword [r12], rax
cmp rax, 0xffffffffffffffff
jne 0x140050af9
call qword [sym.imp.MSVCR120.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.MSVCR120.dll_strerror]
lea rdx, str.API_initialisation_failed___s__s
mov r9, r13
mov r8, rax
xor ecx, ecx
call fcn.140040950
jmp 0x140051143
xor eax, eax
mov rcx, rdi
mov qword [rsp + 0x38], rax
mov word [rsp + 0x38], si
mov qword [rsp + 0x40], rax
call qword [sym.imp.WS2_32.dll_inet_addr]
mov dword [rsp + 0x3c], eax
cmp eax, 0xffffffff
jne 0x140050b43
call qword [sym.imp.MSVCR120.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.MSVCR120.dll_strerror]
lea rdx, str.API_initialisation_2_failed___s__s
mov r9, r13
mov r8, rax
xor ecx, ecx
call fcn.140040950
jmp 0x140051143
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
xor ecx, ecx
mov word [rsp + 0x3a], ax
call qword [sym.imp.MSVCR120.dll__time64]
mov rsi, rax
nop dword [rax]
lea rdx, [rsp + 0x38]
mov r8d, reloc.WS2_32.dll_recv
mov rcx, r15
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
jns 0x140050c53
call qword [sym.imp.MSVCR120.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.MSVCR120.dll_strerror]
xor ecx, ecx
mov rdi, rax
call qword [sym.imp.MSVCR120.dll__time64]
sub rax, rsi
cmp rax, 0x3d
jg 0x140050c28
cmp dword [0x140258b58], 0xfe4
jne 0x140050bf1
cmp dword [0x1402c7bbc], 0
je 0x140050bd0
movzx r8d, bx
lea rdx, str.API_bind_to_port__d_failed__trying_port__u
mov ecx, 4
lea r9d, [r8 + 1]
call fcn.140040950
inc bx
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
mov ecx, 0x3e8
mov word [rsp + 0x3a], ax
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140050b60
cmp dword [0x1402c7cc0], 0
je 0x140050c03
cmp dword [0x1402c7bbc], 0
je 0x140050c18
lea rdx, str.API_bind_to_port__u_failed___trying_again_in_20sec
movzx r8d, bx
mov ecx, 1
call fcn.140040950
mov ecx, 0x4e20
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140050b60
lea rdx, str.API_bind_to_port__d_failed___s__s
movzx r8d, bx
mov r9, rdi
mov ecx, 1
mov qword [rsp + 0x20], r13
call fcn.140040950
mov rcx, r12
call qword [sym.imp.MSVCR120.dll_free]
jmp 0x140051143
mov r8d, dword [0x140258b58]
movzx ebx, bx
cmp r8d, ebx
je 0x140050c7c
lea rdx, str.API_bind_to_port__d_failed___using_port__u
mov r9d, ebx
mov ecx, 1
call fcn.140040950
mov dword [0x140258b58], ebx
mov edx, 0xa
mov rcx, r15
call qword [sym.imp.WS2_32.dll_listen]
cmp eax, 0xffffffff
jne 0x140050cc8
call qword [sym.imp.MSVCR120.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.MSVCR120.dll_strerror]
lea rdx, str.API_initialisation_3_failed___s__s
mov r9, r13
mov r8, rax
xor ecx, ecx
call fcn.140040950
mov rcx, r15
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, r12
call qword [sym.imp.MSVCR120.dll_free]
jmp 0x140051143
mov edx, 0x4001
mov ecx, 1
mov qword [rsp + 0x4178], r14
call qword [sym.imp.MSVCR120.dll_calloc]
cmp dword [0x1402cb7f8], 0
mov qword [0x1402ddac8], rax
jne 0x14005111c
lea rsi, str.Accepted
nop dword [rax + rax]
mov eax, dword [0x1402c7d7c]
test eax, eax
jne 0x14005111c
lea r8, [rsp + 0x30]
lea rdx, [rsp + 0x48]
mov rcx, r15
mov dword [rsp + 0x30], reloc.WS2_32.dll_recv
call qword [sym.imp.WS2_32.dll_accept]
mov r14, rax
cmp rax, 0xffffffffffffffff
je 0x1400510fa
mov ecx, dword [rsp + 0x4c]
xor ebx, ebx
call qword [sym.imp.WS2_32.dll_inet_ntoa]
lea ecx, [rbx + 0x52]
mov rdi, rax
call qword [sym.imp.MSVCR120.dll_toupper]
cmp qword [0x1402dde88], rbx
je 0x140050d95
mov ecx, dword [rsp + 0x4c]
call qword [sym.imp.WS2_32.dll_htonl]
mov r9d, dword [reloc.WS2_32.dll_accept]
xor r8d, r8d
test r9d, r9d
jle 0x140050da9
mov rdx, qword [0x1402cb7f0]
mov ecx, dword [rdx + 4]
and ecx, eax
cmp ecx, dword [rdx]
je 0x140050d8e
inc r8d
add rdx, 0xc
cmp r8d, r9d
jl 0x140050d77
jmp 0x140050da9
mov ebx, 1
jmp 0x140050da9
lea rdx, str.127.0.0.1
mov rcx, rdi
call sub.MSVCR120.dll_strcmp
test eax, eax
sete bl
cmp dword [0x1402c7bbc], 0
je 0x140050ddc
cmp dword [0x1402c7ad4], 0
je 0x140050ddc
test ebx, ebx
lea r9, str.Ignored
lea rdx, str.API:_connection_from__s____s
mov r8, rdi
mov ecx, 4
cmovne r9, rsi
call fcn.140040950
test ebx, ebx
je 0x1400510eb
lea rdx, [rbp + 0x60]
xor r9d, r9d
mov r8d, 0x400
mov rcx, r14
xor esi, esi
call qword [sym.imp.WS2_32.dll_recv]
xor edx, edx
movsxd rbx, eax
cmp ebx, 0xffffffff
sete dl
test edx, edx
je 0x140050e11
mov byte [rbp + 0x60], sil
jmp 0x140050e5c
test eax, eax
jle 0x140050e5c
lea rcx, [rbp + 0x60]
cmp byte [rcx + rbx - 1], 0xa
jne 0x140050e5c
dec ebx
movsxd rax, ebx
cmp rax, 0x4000
jae 0x140051183
mov byte [rbp + rax + 0x60], sil
test ebx, ebx
jle 0x140050e5c
movsxd rax, ebx
cmp byte [rcx + rax - 1], 0xd
jne 0x140050e5c
lea eax, [rbx - 1]
movsxd rcx, eax
cmp rcx, 0x4000
jae 0x14005117d
mov byte [rbp + rcx + 0x60], sil
movsxd rax, ebx
cmp rax, 0x4000
jae 0x140051189
mov byte [rbp + rax + 0x60], sil
test edx, edx
jne 0x1400510e4
lea rdx, str.GET__
lea rcx, [rbp + 0x60]
call qword [sym.imp.MSVCR120.dll_strstr]
mov rdi, rax
test rax, rax
je 0x140050f76
or rcx, 0xffffffffffffffff
nop dword [rax]
inc rcx
cmp byte [rax + rcx], sil
jne 0x140050ea0
cmp rcx, 5
jbe 0x140050f76
lea rcx, [rsp + 0x61]
xor edx, edx
mov r8d, 0xff
mov byte [rsp + 0x60], sil
call sub.MSVCR120.dll_memset
lea rcx, [rdi + 5]
lea r8, [rsp + 0x60]
lea rdx, [0x14023f668]
call qword [sym.imp.MSVCR120.dll_sscanf]
lea rcx, [rsp + 0x60]
mov edx, 0x2f
call qword [sym.imp.MSVCR120.dll_strchr]
test rax, rax
je 0x140050ef8
mov byte [rax], 0x7c
lea rcx, [rsp + 0x60]
mov edx, 0x2f
call qword [sym.imp.MSVCR120.dll_strchr]
test rax, rax
je 0x140050f10
mov byte [rax], sil
lea rdx, str.Sec_WebSocket_Key
mov rcx, rdi
call qword [sym.imp.MSVCR120.dll_strstr]
mov rsi, rax
test rax, rax
je 0x140050f5e
mov edx, reloc.WS2_32.dll_listen
mov rcx, rax
call qword [sym.imp.MSVCR120.dll_strchr]
test rax, rax
je 0x140050f3e
mov byte [rax], 0
mov edx, 0x3a
mov rcx, rsi
call qword [sym.imp.MSVCR120.dll_strchr]
cmp byte [rax + 1], 0x20
lea rsi, [rax + 1]
jne 0x140050f5e
inc rsi
cmp byte [rsi], 0x20
je 0x140050f56
lea r8, [rsp + 0x60]
lea rdx, [0x14023e2b4]
lea rcx, [rbp + 0x60]
call qword [sym.imp.MSVCR120.dll_sprintf]
mov ebx, eax
lea rcx, [rbp + 0x60]
mov edx, 0x7c
call qword [sym.imp.MSVCR120.dll_strchr]
mov rdi, rax
test rax, rax
je 0x140050f93
mov byte [rax], 0
inc rdi
cmp dword [0x1402c7bbc], 0
je 0x140050fcc
cmp dword [0x1402c7ad4], 0
je 0x140050fcc
test ebx, ebx
jle 0x140050fcc
test rdi, rdi
lea r9, [0x1401d3072]
lea r8, [rbp + 0x60]
lea rdx, str.API:_exec_command__s__s_
mov ecx, 4
cmovne r9, rdi
call fcn.140040950
lea rbx, str.summary
xor r10d, r10d
xor r11d, r11d
mov r9, rbx
nop dword [rax]
mov r8, qword [r9]
lea rax, [rbp + 0x60]
sub r8, rax
nop word [rax + rax]
movzx edx, byte [rax]
movzx ecx, byte [rax + r8]
sub edx, ecx
jne 0x140051003
inc rax
test ecx, ecx
jne 0x140050ff0
test edx, edx
jne 0x14005101e
lea rcx, [rbp + 0x60]
or rax, 0xffffffffffffffff
nop
inc rax
cmp byte [rcx + rax], 0
jne 0x140051010
test rax, rax
jne 0x140051036
inc r10d
inc r11
add r9, 0x10
movsxd rax, r10d
cmp rax, 0xb
jb 0x140050fe0
jmp 0x1400510db
test rdi, rdi
je 0x140051080
or rax, 0xffffffffffffffff
nop
inc rax
cmp byte [rdi + rax], 0
jne 0x140051040
test rax, rax
je 0x140051080
or rax, 0xffffffffffffffff
cmp byte [rdi + rax + 1], 0
lea rax, [rax + 1]
jne 0x140051052
cmp byte [rax + rdi - 1], 0x7c
jne 0x140051080
or rax, 0xffffffffffffffff
nop dword [rax + rax]
cmp byte [rdi + rax + 1], 0
lea rax, [rax + 1]
jne 0x140051070
mov byte [rax + rdi - 1], 0
add r11, r11
mov rcx, rdi
call qword [rbx + r11*reloc.WS2_32.dll_htonl + 8]
mov rdx, rax
test rsi, rsi
je 0x1400510a0
mov r8, rsi
mov rcx, r14
call fcn.140050440
jmp 0x1400510db
test rax, rax
jne 0x1400510b2
lea r8d, [rax + 1]
lea rdx, [0x1401d3072]
jmp 0x1400510cf
or rax, 0xffffffffffffffff
nop word [rax + rax]
cmp byte [rdx + rax + 1], 0
lea rax, [rax + 1]
jne 0x1400510c0
lea r8d, [rax + 1]
xor r9d, r9d
mov rcx, r14
call qword [sym.imp.WS2_32.dll_send]
mov rcx, r14
call qword [sym.imp.WS2_32.dll_closesocket]
lea rsi, str.Accepted
cmp dword [0x1402cb7f8], 0
je 0x140050d00
jmp 0x14005111c
call qword [sym.imp.MSVCR120.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.MSVCR120.dll_strerror]
lea rdx, str.API_failed___s__s
mov r9, r13
mov r8, rax
xor ecx, ecx
call fcn.140040950
mov rcx, r15
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, r12
call qword [sym.imp.MSVCR120.dll_free]
mov rcx, qword [0x1402ddac8]
call qword [sym.imp.MSVCR120.dll_free]
mov r14, qword [rsp + 0x4178]
mov r13, qword [rsp + 0x41b0]
mov r12, qword [rsp + 0x41a8]
mov rsi, qword [rsp + 0x41a0]
mov r15, qword [rsp + 0x4170]
mov rcx, qword [rbp + 0x4060]
xor rcx, rsp
call fcn.1401bddc0
add rsp, 0x4180
pop rdi
pop rbx
pop rbp
ret
call fcn.1401bdf54
int3
call fcn.1401bdf54
int3
call fcn.1401bdf54
int3