Function at 0x4be080
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x78
mov ebx, dword [rcx + 0x150]
mov r12, rcx
cmp ebx, 0xffffffff
je 0x4be240
mov rsi, qword [rcx + 0x180]
mov ecx, ebx
call qword [sym.imp.msvcrt.dll__get_osfhandle]
mov r13, rax
cmp rax, 0xffffffffffffffff
je 0x4be380
lea rcx, [0x00a09e00]
movzx edi, bl
call sub.KERNEL32.dll_EnterCriticalSection
mov eax, edi
lea r9, [0x00780e00]
mov rdx, rax
shl rdx, 4
add rdx, r9
mov r8, qword [rdx]
mov rcx, r8
and ecx, 0xf
test r8, r8
je 0x4be260
test rcx, rcx
jne 0x4be260
mov r8, qword [rdx + 8]
mov ecx, 0x10
mov rdx, r8
xor eax, eax
jmp 0x4be121
add rax, 1
add rdx, 0x28
cmp rax, rcx
jae 0x4be278
cmp ebx, dword [rdx]
jne 0x4be110
lea rax, [rax + rax*4]
lea rax, [r8 + rax*8]
test rax, rax
jne 0x4be208
lea rcx, [0x00a09e00]
call fcn.004d4240
cmp rsi, 0xffffffffffffffff
jne 0x4be2c0
mov dword [rsp + 0x38], 0
xor edi, edi
xor ebx, ebx
xor ebp, ebp
lea r14, [rsp + 0x44]
jmp 0x4be176
cmp dword [r12 + 0x170], ebx
jbe 0x4be338
cmp rsi, 0xffffffffffffffff
je 0x4be186
mov eax, ebp
add rax, rsi
mov qword [rsp + 0x60], rax
mov eax, ebx
mov r9, r14
mov rcx, r13
add ebx, 1
shl rax, 4
add rax, qword [r12 + 0x178]
mov rdx, qword [rax + 8]
mov qword [rsp + 0x20], rdi
mov r8d, dword [rax]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov r11d, dword [rsp + 0x44]
mov r15d, eax
add r11d, ebp
mov ebp, r11d
test eax, eax
jne 0x4be168
mov edx, dword [rsp + 0x38]
test edx, edx
jne 0x4be344
mov eax, dword [rsp + 0x38]
or eax, r11d
je 0x4be310
mov eax, r11d
mov qword [r12 + 0x88], rax
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea rax, [rax + rax*4]
lea rax, [rdx + rax*8]
movdqu xmm0, xmmword [rax + 8]
lea rcx, [0x00a09e00]
movaps xmmword [rsp + 0x50], xmm0
movdqu xmm1, xmmword [rax + 0x18]
movaps xmmword [rsp + 0x60], xmm1
call fcn.004d4240
lea r8, [rsp + 0x50]
mov rdx, r13
mov rcx, r12
call fcn.004bd880
jmp 0x4be1e5
mov qword [rcx + 0x88], 0xfffffffffffff00d
mov dword [rcx + 0x14c], 6
jmp 0x4be1e5
shl rax, 4
mov r8, qword [r9 + rax + 8]
test rcx, rcx
jne 0x4be104
nop word [rax + rax]
mov rdx, qword [r8 + 0x280]
test rdx, rdx
je 0x4be136
nop dword [rax + rax]
mov rcx, rdx
xor eax, eax
nop dword [rax]
cmp ebx, dword [rcx]
je 0x4be200
add eax, 1
add rcx, 0x28
cmp eax, 0x10
jne 0x4be298
mov rdx, qword [rdx + 0x280]
test rdx, rdx
jne 0x4be290
jmp 0x4be136
xor edx, edx
mov r9d, 1
lea r8, [rsp + 0x48]
mov rcx, r13
mov qword [rsp + 0x50], 0
lea rdi, [rsp + 0x50]
mov qword [rsp + 0x58], 0
mov qword [rsp + 0x60], 0
mov qword [rsp + 0x68], 0
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
setne al
movzx eax, al
mov dword [rsp + 0x38], eax
jmp 0x4be156
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [r12 + 0x14c], eax
mov ecx, eax
call fcn.004bb150
cdqe
mov qword [r12 + 0x88], rax
jmp 0x4be1e5
mov eax, dword [rsp + 0x38]
test eax, eax
je 0x4be1da
mov dword [rsp + 0x3c], r11d
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [rsp + 0x48]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov dword [rsp + 0x38], r15d
mov r11d, dword [rsp + 0x3c]
mov eax, dword [rsp + 0x38]
or eax, r11d
jne 0x4be1da
jmp 0x4be310
mov dword [r12 + 0x14c], 6
mov ecx, 6
call fcn.004bb150
cdqe
mov qword [r12 + 0x88], rax
jmp 0x4be1e5