Function at 0x140012970
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rax - 0x2b8]
sub rsp, 0x390
mov qword [rbp + 0x40], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x20], rsi
mov rax, qword [0x140115fa8]
xor rax, rsp
mov qword [rbp + 0x280], rax
mov rdi, r8
mov r14, rdx
xor r12d, r12d
mov dword [rsp + 0x40], r12d
mov ecx, 0xfffffff5
call qword [sym.imp.KERNEL32.dll_GetStdHandle]
mov rsi, rax
cmp rax, 0xffffffffffffffff
jne 0x140012e39
lea rax, [0x1400dd080]
mov qword [rsp + 0x50], rax
lea rcx, [rbp - 0x28]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::constructor_void____ptr64]
nop
mov dword [rsp + 0x40], 4
xor r9d, r9d
xor r8d, r8d
lea rdx, [rsp + 0x58]
lea rcx, [rsp + 0x50]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::constructor_class_std::basic_streambuf_char__struct_std::char_traits_char______ptr64__bool____ptr64]
nop
mov rax, qword [rsp + 0x50]
movsxd rcx, dword [rax + 4]
lea r15, vtable.std::basic_ostringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov qword [rsp + rcx + 0x50], r15
mov rax, qword [rsp + 0x50]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x88]
mov dword [rsp + rcx + 0x4c], edx
lea rcx, [rsp + 0x58]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::constructor_void____ptr64]
lea rax, vtable.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov qword [rsp + 0x58], rax
mov qword [rbp - 0x40], r12
mov dword [rbp - 0x38], 4
lea rdx, str.Error_getting_stdout_handle:
lea rcx, [rsp + 0x50]
call fcn.1400020e0
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
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___unsigned_long_int____ptr64]
lea rcx, [rbp + 0x50]
call sub.Common_HvdAgent.dll_class_std::shared_ptr_class_CSF::csflogger::LogController____cdecl_VirtualChannelLogger_getInstance_void_
cmp qword [rax], r12
je 0x140012a91
cmp qword [0x140118a70], r12
je 0x140012a91
mov dil, 1
jmp 0x140012a94
xor dil, dil
mov r14, 0xffffffffffffffff
mov rbx, qword [rbp + 0x58]
test rbx, rbx
je 0x140012acf
mov eax, r14d
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x140012acf
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
mov eax, r14d
lock xadd dword [rbx + 0xc], eax
cmp eax, 1
jne 0x140012acf
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 8]
test dil, dil
je 0x140012df2
mov rcx, qword [0x140118a70]
call qword [sym.imp.uvdilogger.dll_CSFLogger_getName]
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x230], xmm0
mov byte [rbp + 0x220], 0
mov r8, r14
nop
inc r8
cmp byte [rax + r8], 0
jne 0x140012b00
mov rdx, rax
lea rcx, [rbp + 0x220]
call fcn.140003630
nop
lea rcx, [rbp + 0x60]
call sub.Common_HvdAgent.dll_class_std::shared_ptr_class_CSF::csflogger::LogController____cdecl_VirtualChannelLogger_getInstance_void_
nop
mov rdi, qword [rax]
mov rax, qword [rdi]
mov rsi, qword [rax + 0x38]
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x190], xmm0
mov byte [rbp + 0x180], 0
mov dword [rsp + 0x40], 0x14
mov eax, dword [rbp - 0x38]
test al, 2
jne 0x140012b92
lea rcx, [rsp + 0x58]
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const___ptr64]
test rax, rax
je 0x140012b8f
mov rax, qword [rsp + 0x78]
mov rbx, qword [rax]
lea rcx, [rsp + 0x58]
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::pptr_void_const___ptr64]
mov qword [rbp + 0x48], rax
cmp rax, qword [rbp - 0x40]
cmovb rax, qword [rbp - 0x40]
sub rax, rbx
mov r8, rax
mov rdx, rbx
jmp 0x140012bbf
mov eax, dword [rbp - 0x38]
test al, 4
jne 0x140012bcc
lea rcx, [rsp + 0x58]
call qword [sym.imp.MSVCP140.dll_protected:_char____ptr64___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::gptr_void_const___ptr64]
test rax, rax
je 0x140012bcc
mov rax, qword [rsp + 0x70]
mov rdx, qword [rax]
mov rax, qword [rbp - 0x58]
movsxd r8, dword [rax]
sub r8, rdx
mov rax, qword [rbp - 0x70]
add r8, qword [rax]
lea rcx, [rbp + 0x180]
call fcn.140003630
nop
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x1d0], xmm0
mov byte [rbp + 0x1c0], 0
mov r8d, 0x19
lea rdx, str.DcvPipeWin::writeToStdout
lea rcx, [rbp + 0x1c0]
call fcn.140003630
nop
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x1b0], xmm0
mov byte [rbp + 0x1a0], 0
mov r8d, 0x3e
lea rdx, str.src_virtualchannel_srccommondcvcommonWindowsDcvPipeWin.cpp
lea rcx, [rbp + 0x1a0]
call fcn.140003630
nop
lea rax, [rbp + 0x180]
mov qword [rsp + 0x30], rax
lea rax, [rbp + 0x1c0]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x3b
lea r9, [rbp + 0x1a0]
mov r8d, 2
lea rdx, [rbp + 0x220]
mov rcx, rdi
call rsi
nop
mov rdx, qword [rbp + 0x1b8]
cmp rdx, 0x10
jb 0x140012cac
inc rdx
mov rcx, qword [rbp + 0x1a0]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140012ca7
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140012ca7
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140047a18
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x1b0], xmm0
mov byte [rbp + 0x1a0], 0
mov rdx, qword [rbp + 0x1d8]
cmp rdx, 0x10
jb 0x140012d07
inc rdx
mov rcx, qword [rbp + 0x1c0]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140012d02
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140012d02
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140047a18
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x1d0], xmm0
mov byte [rbp + 0x1c0], 0
mov rdx, qword [rbp + 0x198]
cmp rdx, 0x10
jb 0x140012d62
inc rdx
mov rcx, qword [rbp + 0x180]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140012d5d
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140012d5d
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140047a18
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x190], xmm0
mov byte [rbp + 0x180], 0
mov rbx, qword [rbp + 0x68]
test rbx, rbx
je 0x140012dad
mov eax, r14d
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x140012dad
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
lock xadd dword [rbx + 0xc], r14d
cmp r14d, 1
jne 0x140012dad
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 8]
nop
mov rdx, qword [rbp + 0x238]
cmp rdx, 0x10
jb 0x140012df2
inc rdx
mov rcx, qword [rbp + 0x220]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140012dec
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140012dec
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140047a18
nop
mov rax, qword [rsp + 0x50]
movsxd rcx, dword [rax + 4]
mov qword [rsp + rcx + 0x50], r15
mov rax, qword [rsp + 0x50]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x88]
mov rax, rcx
mov dword [rsp + rcx + 0x4c], edx
lea rcx, [rsp + 0x58]
call fcn.140002d10
lea rcx, [rsp + 0x60]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::destructor_void____ptr64]
lea rcx, [rbp - 0x28]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::destructor_void____ptr64]
xor al, al
jmp 0x140012e87
mov ebx, r12d
test rdi, rdi
je 0x140012e7c
mov rax, r12
nop dword [rax]
nop dword [rax + rax]
lea rdx, [r14 + rax]
mov r8d, edi
sub r8d, ebx
mov qword [rsp + 0x20], r12
lea r9, [rsp + 0x44]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x140012eb2
add ebx, dword [rsp + 0x44]
mov eax, ebx
cmp rax, rdi
jb 0x140012e50
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov al, 1
mov rcx, qword [rbp + 0x280]
xor rcx, rsp
call fcn.140047d70
lea r11, [rsp + 0x390]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret
lea rax, [0x1400dd080]
mov qword [rbp + 0x90], rax
lea rcx, [rbp + 0x118]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::constructor_void____ptr64]
nop
mov dword [rsp + 0x40], 0x20
xor r9d, r9d
xor r8d, r8d
lea rdx, [rbp + 0x98]
lea rcx, [rbp + 0x90]
call qword [sym.imp.MSVCP140.dll_public:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::constructor_class_std::basic_streambuf_char__struct_std::char_traits_char______ptr64__bool____ptr64]
nop
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
lea r15, vtable.std::basic_ostringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov qword [rbp + rcx + 0x90], r15
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x88]
mov dword [rbp + rcx + 0x8c], edx
lea rcx, [rbp + 0x98]
call qword [sym.imp.MSVCP140.dll_protected:_void___cdecl_std::basic_streambuf_char__struct_std::char_traits_char__::constructor_void____ptr64]
lea rax, vtable.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.0
mov qword [rbp + 0x98], rax
mov qword [rbp + 0x100], r12
mov dword [rbp + 0x108], 4
lea rdx, str.Could_not_write_to_handle:
lea rcx, [rbp + 0x90]
call fcn.1400020e0
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
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___unsigned_long_int____ptr64]
lea rcx, [rbp + 0x70]
call sub.Common_HvdAgent.dll_class_std::shared_ptr_class_CSF::csflogger::LogController____cdecl_VirtualChannelLogger_getInstance_void_
cmp qword [rax], 0
je 0x140012f94
cmp qword [0x140118a70], 0
je 0x140012f94
mov dil, 1
jmp 0x140012f97
xor dil, dil
mov r14, 0xffffffffffffffff
mov rbx, qword [rbp + 0x78]
test rbx, rbx
je 0x140012fd2
mov eax, r14d
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x140012fd2
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
mov eax, r14d
lock xadd dword [rbx + 0xc], eax
cmp eax, 1
jne 0x140012fd2
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 8]
test dil, dil
je 0x14001326b
mov rcx, qword [0x140118a70]
call qword [sym.imp.uvdilogger.dll_CSFLogger_getName]
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x250], xmm0
mov byte [rbp + 0x240], 0
mov r8, r14
inc r8
cmp byte [rax + r8], 0
jne 0x140013002
mov rdx, rax
lea rcx, [rbp + 0x240]
call fcn.140003630
nop
lea rcx, [rbp + 0x80]
call sub.Common_HvdAgent.dll_class_std::shared_ptr_class_CSF::csflogger::LogController____cdecl_VirtualChannelLogger_getInstance_void_
nop
mov rsi, qword [rax]
mov rax, qword [rsi]
mov rdi, qword [rax + 0x38]
lea rdx, [rbp + 0x260]
lea rcx, [rbp + 0x90]
call fcn.140006c50
mov rbx, rax
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x210], xmm0
mov byte [rbp + 0x200], 0
mov r8d, 0x19
lea rdx, str.DcvPipeWin::writeToStdout
lea rcx, [rbp + 0x200]
call fcn.140003630
nop
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x1f0], xmm0
mov byte [rbp + 0x1e0], 0
mov r8d, 0x3e
lea rdx, str.src_virtualchannel_srccommondcvcommonWindowsDcvPipeWin.cpp
lea rcx, [rbp + 0x1e0]
call fcn.140003630
nop
mov qword [rsp + 0x30], rbx
lea rax, [rbp + 0x200]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x49
lea r9, [rbp + 0x1e0]
mov r8d, 2
lea rdx, [rbp + 0x240]
mov rcx, rsi
call rdi
nop
mov rdx, qword [rbp + 0x1f8]
cmp rdx, 0x10
jb 0x140013122
inc rdx
mov rcx, qword [rbp + 0x1e0]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14001311d
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x14001311d
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140047a18
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x1f0], xmm0
mov byte [rbp + 0x1e0], 0
mov rdx, qword [rbp + 0x218]
cmp rdx, 0x10
jb 0x14001317d
inc rdx
mov rcx, qword [rbp + 0x200]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140013178
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140013178
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140047a18
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x210], xmm0
mov byte [rbp + 0x200], 0
mov rdx, qword [rbp + 0x278]
cmp rdx, 0x10
jb 0x1400131d8
inc rdx
mov rcx, qword [rbp + 0x260]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400131d3
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400131d3
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140047a18
movdqa xmm0, xmmword [0x1400dd280]
movdqu xmmword [rbp + 0x270], xmm0
mov byte [rbp + 0x260], 0
mov rbx, qword [rbp + 0x88]
test rbx, rbx
je 0x140013226
mov eax, r14d
lock xadd dword [rbx + 8], eax
cmp eax, 1
jne 0x140013226
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax]
lock xadd dword [rbx + 0xc], r14d
cmp r14d, 1
jne 0x140013226
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 8]
nop
mov rdx, qword [rbp + 0x258]
cmp rdx, 0x10
jb 0x14001326b
inc rdx
mov rcx, qword [rbp + 0x240]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140013265
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140013265
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.140047a18
nop
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
mov qword [rbp + rcx + 0x90], r15
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x88]
mov rax, rcx
mov dword [rbp + rcx + 0x8c], edx
lea rcx, [rbp + 0x98]
call fcn.140002d10
lea rcx, [rbp + 0xa0]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::destructor_void____ptr64]
lea rcx, [rbp + 0x118]
call qword [sym.imp.MSVCP140.dll_public_virtual:_void___cdecl_std::basic_ios_char__struct_std::char_traits_char__::destructor_void____ptr64]
xor al, al
jmp 0x140012e87