Function at 0x140021e20
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r14
push r15
mov rbp, rsp
sub rsp, 0x80
mov rax, qword [0x1400a3020]
xor rax, rsp
mov qword [rbp - 8], rax
mov rdi, rdx
mov rsi, rcx
cmp byte [rcx + 0x40], 0
je 0x140021e66
cmp qword [rdx + 0x18], 8
jb 0x140021e5a
mov rdx, qword [rdx]
lea rcx, [0x140091398]
call fcn.1400227a0
lea rbx, [rsi + 0x18]
mov qword [rbp - 0x50], rbx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x140021e85
mov rcx, qword [rdi]
mov rax, qword [rdi + 0x10]
lea r9, [rcx + rax*2]
mov r8, rdi
jb 0x140021e95
mov r8, qword [rdi]
mov rdx, qword [rsi + 8]
mov rcx, rsi
call fcn.140022370
cmp byte [rsi + 0x41], 0
je 0x140022045
mov r10, qword [rsi + 0x50]
cmp r10, 0xffffffffffffffff
je 0x140022045
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rbp - 0x40], xmm0
mov qword [rbp - 0x30], rax
mov rcx, rdi
cmp qword [rdi + 0x18], 8
jb 0x140021ed3
mov rcx, qword [rdi]
mov rax, qword [rdi + 0x10]
lea r14, [rcx + rax*2]
jb 0x140021ee0
mov rdi, qword [rdi]
movdqu xmmword [rbp - 0x40], xmm0
xor r15d, r15d
mov qword [rbp - 0x30], r15
mov rdx, r14
sub rdx, rdi
sar rdx, 1
je 0x140021f3f
movabs rax, 0x7fffffffffffffff
cmp rdx, rax
ja 0x140022077
lea rcx, [rbp - 0x40]
call fcn.140021650
mov rdx, qword [rbp - 0x40]
mov rcx, rdx
cmp rdi, r14
je 0x140021f35
nop
movzx eax, byte [rdi]
mov byte [rcx], al
inc rcx
add rdi, 2
cmp rdi, r14
jne 0x140021f20
mov rdx, qword [rbp - 0x40]
mov qword [rbp - 0x38], rcx
mov r10, qword [rsi + 0x50]
jmp 0x140021f47
mov rcx, qword [rbp - 0x38]
mov rdx, qword [rbp - 0x40]
mov dword [rbp - 0x48], r15d
sub rcx, rdx
mov qword [rsp + 0x20], r15
lea r9, [rbp - 0x48]
mov r8d, ecx
mov rcx, r10
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x14002200e
mov qword [rbp - 0x28], r15
mov qword [rbp - 0x18], r15
mov qword [rbp - 0x10], reloc.WS2_32.dll_ntohs
mov byte [rbp - 0x28], al
lea r8d, [rax + 0x27]
lea rdx, str.CLogger::write_log__:_WriteFile_failed_n
lea rcx, [rbp - 0x28]
call fcn.140006ac0
nop
lea r8, [rbp - 0x28]
cmp qword [rbp - 0x10], 0x10
cmovae r8, qword [rbp - 0x28]
mov r9, qword [rbp - 0x18]
add r9, r8
lea r8, [rbp - 0x28]
cmp qword [rbp - 0x10], 0x10
cmovae r8, qword [rbp - 0x28]
mov rdx, qword [rsi + 8]
mov rcx, rsi
call fcn.1400225b0
lea rcx, [rbp - 0x28]
cmp qword [rbp - 0x10], 0x10
cmovae rcx, qword [rbp - 0x28]
call fcn.1400227a0
nop
mov rdx, qword [rbp - 0x10]
cmp rdx, 0x10
jb 0x14002200e
inc rdx
mov rcx, qword [rbp - 0x28]
mov rax, rcx
cmp rdx, 0x1000
jb 0x140022008
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14002207d
call fcn.1400477f0
nop
mov rcx, qword [rbp - 0x40]
test rcx, rcx
je 0x140022045
mov rdx, qword [rbp - 0x30]
sub rdx, rcx
mov rax, rcx
cmp rdx, 0x1000
jb 0x14002203f
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140022071
call fcn.1400477f0
nop
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rbp - 8]
xor rcx, rsp
call fcn.1400477d0
mov rbx, qword [rsp + 0xc0]
add rsp, 0x80
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret
call fcn.14004e14c
nop
call fcn.140001f90
nop
call fcn.14004e14c
int3