Function at 0x140040dd0
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.140115900
sub rsp, rax
mov rax, qword [0x1401858e0]
xor rax, rsp
mov qword [rbp + 0x4060], rax
movzx ebx, word [0x1401968a0]
mov rdi, qword [0x140196538]
test bx, bx
jne 0x140040e23
lea rdx, str.API_disabled
mov ecx, 4
call fcn.140033bd0
jmp 0x14004147c
mov qword [rsp + 0x41a8], r12
lea r12, str.___API_will_not_be_available
mov qword [rsp + 0x4178], r14
test rdi, rdi
je 0x140040e61
call fcn.140040a60
cmp dword [reloc.WS2_32.dll_accept], 0
jne 0x140040e61
mov r8, r12
lea rdx, str.API_not_running__no_valid_IPs_specified__s
mov ecx, 1
call fcn.140033bd0
mov edx, 8
lea ecx, [rdx - 7]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov r14, rax
test rax, rax
je 0x140041496
mov ecx, 0x3e8
mov qword [rsp + 0x41a0], rsi
mov qword [rax], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_Sleep]
xor r8d, r8d
mov esi, 2
mov ecx, esi
lea edx, [r8 + 1]
call qword [sym.imp.WS2_32.dll_socket]
mov qword [r14], rax
cmp rax, 0xffffffffffffffff
jne 0x140040ed9
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
mov r9, r12
lea rdx, str.API_initialisation_failed___s__s
mov r8, rax
xor ecx, ecx
call fcn.140033bd0
jmp 0x140041464
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 0x140040f23
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
mov r9, r12
lea rdx, str.API_initialisation_2_failed___s__s
mov r8, rax
xor ecx, ecx
call fcn.140033bd0
jmp 0x140041464
movzx ecx, bx
call qword [sym.imp.WS2_32.dll_htons]
xor ecx, ecx
mov word [rsp + 0x3a], ax
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
mov rsi, rax
nop dword [rax]
mov rcx, qword [r14]
lea rdx, [rsp + 0x38]
mov r8d, reloc.WS2_32.dll_recv
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
jns 0x140040fe6
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
xor ecx, ecx
mov rdi, rax
call qword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
sub rax, rsi
cmp rax, 0x3d
jg 0x140040fbb
cmp byte [0x1401965dc], 0
je 0x140040f99
cmp byte [0x1401965da], 0
jne 0x140040f99
cmp byte [0x1401965d9], 0
je 0x140040fae
movzx r8d, bx
lea rdx, str.API_bind_to_port__u_failed___trying_again_in_20sec
mov ecx, 1
call fcn.140033bd0
mov ecx, 0x4e20
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140040f40
movzx r8d, bx
lea rdx, str.API_bind_to_port__d_failed___s__s
mov r9, rdi
mov qword [rsp + 0x20], r12
mov ecx, 1
call fcn.140033bd0
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140041464
mov rcx, qword [r14]
mov edx, 0xa
call qword [sym.imp.WS2_32.dll_listen]
cmp eax, 0xffffffff
jne 0x140041032
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
mov r9, r12
lea rdx, str.API_initialisation_3_failed___s__s
mov r8, rax
xor ecx, ecx
call fcn.140033bd0
mov rcx, qword [r14]
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
jmp 0x140041464
mov edx, 0x4001
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov qword [0x140196d40], rax
test rax, rax
je 0x1400414af
cmp dword [0x140196d48], 0
mov qword [rsp + 0x41b0], r13
mov qword [rsp + 0x4170], r15
jne 0x140041435
lea rsi, str.Accepted
lea r13, str.summary
nop dword [rax]
mov dword [rsp + 0x30], reloc.WS2_32.dll_recv
lea r8, [rsp + 0x30]
mov rcx, qword [r14]
lea rdx, [rsp + 0x48]
call qword [sym.imp.WS2_32.dll_accept]
mov r15, rax
cmp rax, 0xffffffffffffffff
je 0x14004140a
mov ecx, dword [rsp + 0x4c]
xor bl, bl
call qword [sym.imp.WS2_32.dll_inet_ntoa]
mov ecx, 0x52
mov rdi, rax
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_toupper]
cmp qword [0x140196538], 0
je 0x14004110b
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 0x14004111f
mov rdx, qword [0x140196c60]
nop dword [rax]
mov ecx, dword [rdx + 4]
and ecx, eax
cmp ecx, dword [rdx]
je 0x140041107
inc r8d
add rdx, 0xc
cmp r8d, r9d
jl 0x1400410f0
jmp 0x14004111f
mov bl, 1
jmp 0x14004111f
lea rdx, str.127.0.0.1
mov rcx, rdi
call sub.api_ms_win_crt_string_l1_1_0.dll_strcmp
test eax, eax
sete bl
cmp byte [0x1401965da], 0
jne 0x140041131
cmp byte [0x1401965d9], 0
je 0x140041152
test bl, bl
lea r9, str.Ignored
mov r8, rdi
lea rdx, str.API:_connection_from__s____s
cmovne r9, rsi
mov ecx, 4
call fcn.140033bd0
test bl, bl
je 0x1400413fb
xor r9d, r9d
lea rdx, [rbp + 0x60]
mov r8d, 0x400
mov rcx, r15
xor esi, esi
call qword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
mov edi, eax
sete dl
test dl, dl
je 0x140041184
mov byte [rbp + 0x60], sil
jmp 0x1400411cb
test eax, eax
jle 0x1400411cb
lea ecx, [rax - 1]
movsxd rax, ecx
cmp byte [rbp + rax + 0x60], 0xa
jne 0x1400411cb
cmp rax, 0x4000
jae 0x1400414ce
mov byte [rbp + rax + 0x60], sil
mov edi, ecx
test ecx, ecx
jle 0x1400411cb
lea eax, [rcx - 1]
movsxd rcx, eax
cmp byte [rbp + rcx + 0x60], 0xd
jne 0x1400411cb
cmp rcx, 0x4000
jae 0x1400414c8
mov byte [rbp + rcx + 0x60], sil
movsxd rax, edi
cmp rax, 0x4000
jae 0x1400414d4
mov byte [rbp + rax + 0x60], sil
test dl, dl
jne 0x1400413f4
lea rdx, str.GET__
lea rcx, [rbp + 0x60]
call qword [sym.imp.VCRUNTIME140.dll_strstr]
mov rbx, rax
test rax, rax
je 0x1400412df
or rcx, 0xffffffffffffffff
nop dword [rax + rax]
inc rcx
cmp byte [rax + rcx], sil
jne 0x140041210
cmp rcx, 5
jbe 0x1400412df
xor edx, edx
lea rcx, [rsp + 0x60]
mov r8d, 0x100
call sub.VCRUNTIME140.dll_memset
lea rcx, [rbx + 5]
lea r8, [rsp + 0x60]
lea rdx, [0x140175978]
call fcn.14003f7d0
mov edx, Ordinal_50
lea rcx, [rsp + 0x60]
call qword [sym.imp.VCRUNTIME140.dll_strchr]
test rax, rax
je 0x140041262
mov byte [rax], 0x7c
mov edx, Ordinal_50
lea rcx, [rsp + 0x60]
call qword [sym.imp.VCRUNTIME140.dll_strchr]
test rax, rax
je 0x14004127a
mov byte [rax], sil
lea rdx, str.Sec_WebSocket_Key
mov rcx, rbx
call qword [sym.imp.VCRUNTIME140.dll_strstr]
mov rsi, rax
test rax, rax
je 0x1400412c8
mov edx, reloc.WS2_32.dll_listen
mov rcx, rax
call qword [sym.imp.VCRUNTIME140.dll_strchr]
test rax, rax
je 0x1400412a8
mov byte [rax], 0
mov edx, Ordinal_60
mov rcx, rsi
call qword [sym.imp.VCRUNTIME140.dll_strchr]
cmp byte [rax + 1], 0x20
lea rsi, [rax + 1]
jne 0x1400412c8
inc rsi
cmp byte [rsi], 0x20
je 0x1400412c0
lea r8, [rsp + 0x60]
lea rdx, [0x140172c44]
lea rcx, [rbp + 0x60]
call fcn.140029290
mov edi, eax
mov edx, 0x7c
lea rcx, [rbp + 0x60]
call qword [sym.imp.VCRUNTIME140.dll_strchr]
mov rbx, rax
test rax, rax
je 0x1400412fc
mov byte [rax], 0
inc rbx
cmp byte [0x1401965da], 0
jne 0x140041312
cmp byte [0x1401965d9], 0
je 0x140041335
test edi, edi
jle 0x140041335
test rbx, rbx
lea r9, [0x1401332a2]
lea r8, [rbp + 0x60]
mov ecx, 4
cmovne r9, rbx
lea rdx, str.API:_exec_command__s__s_
call fcn.140033bd0
xor r10d, r10d
mov r9, r13
xor r11d, r11d
nop
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 0x140041363
inc rax
test ecx, ecx
jne 0x140041350
test edx, edx
jne 0x14004137e
lea rcx, [rbp + 0x60]
or rax, 0xffffffffffffffff
nop
inc rax
cmp byte [rcx + rax], 0
jne 0x140041370
test rax, rax
jne 0x140041390
inc r10d
inc r11
add r9, 0x10
cmp r10d, 8
jb 0x140041340
jmp 0x1400413eb
add r11, r11
mov rcx, rbx
call qword [r13 + r11*reloc.WS2_32.dll_htonl + 8]
mov rdx, rax
test rsi, rsi
je 0x1400413b0
mov r8, rsi
mov rcx, r15
call fcn.1400407a0
jmp 0x1400413eb
test rdx, rdx
jne 0x1400413c2
lea r8d, [rdx + 1]
lea rdx, [0x1401332a2]
jmp 0x1400413df
or rax, 0xffffffffffffffff
nop word [rax + rax]
cmp byte [rdx + rax + 1], 0
lea rax, [rax + 1]
jne 0x1400413d0
lea r8d, [rax + 1]
xor r9d, r9d
mov rcx, r15
call qword [sym.imp.WS2_32.dll_send]
mov rcx, r15
call qword [sym.imp.WS2_32.dll_closesocket]
lea rsi, str.Accepted
cmp dword [0x140196d48], 0
je 0x140041080
jmp 0x140041435
cmp byte [0x140196522], 0
jne 0x140041435
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov ecx, dword [rax]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
mov r9, r12
lea rdx, str.API_failed___s__s
mov r8, rax
xor ecx, ecx
call fcn.140033bd0
mov rcx, qword [r14]
call qword [sym.imp.WS2_32.dll_closesocket]
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [0x140196d40]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov r13, qword [rsp + 0x41b0]
mov r15, qword [rsp + 0x4170]
mov rsi, qword [rsp + 0x41a0]
mov r12, qword [rsp + 0x41a8]
mov r14, qword [rsp + 0x4178]
mov rcx, qword [rbp + 0x4060]
xor rcx, rsp
call fcn.1401150e0
add rsp, 0x4180
pop rdi
pop rbx
pop rbp
ret
lea rdx, str.Out_of_memory_
xor ecx, ecx
call fcn.140033bd0
mov ecx, 1
call fcn.1400293d0
int3
lea rdx, str.Out_of_memory_
xor ecx, ecx
call fcn.140033bd0
mov ecx, 1
call fcn.1400293d0
int3
call fcn.140114ebc
int3
call fcn.140114ebc
int3
call fcn.140114ebc
int3