Function at 0x180041740
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x20], r9
mov dword [rax + 0x18], r8d
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa0
mov r15, rdx
mov rbx, rcx
xor esi, esi
or r14, 0xffffffffffffffff
mov qword [rax - 0x70], r14
and dword [rsp + 0x40], esi
xor edi, edi
mov qword [rax - 0x68], rdi
test rcx, rcx
je 0x180041a41
cmp qword [rcx + 0xb3], rdi
je 0x180041a41
call fcn.180005000
and qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40010000
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r14, rax
mov qword [rsp + 0x58], rax
cmp rax, 0xffffffffffffffff
je 0x180041a39
imul eax, dword [rbx], 0x11
add eax, 0x12
mov r13d, eax
mov qword [rbx + 0x1a], r13
mov qword [rsp + 0x70], r13
mov ecx, eax
call fcn.180053730
mov rdi, rax
mov qword [rsp + 0x60], rax
test rax, rax
jne 0x180041801
lea esi, [rax + 8]
jmp 0x180041a41
xor ecx, ecx
mov qword [rsp + 0x48], rcx
mov r8, r13
xor edx, edx
mov rcx, rdi
call fcn.180046390
mov rax, qword [rbx]
mov qword [rdi], rax
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov r8d, r13d
mov rdx, rdi
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180041a39
xor r15d, r15d
mov qword [rsp + 0x88], r15
mov rax, qword [rbx + 8]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x78], rax
cmp r15, qword [rbx]
jae 0x180041a0c
test rax, rax
je 0x180041a0c
imul r12, r15, 0x11
mov rax, qword [rbx + 0xb3]
test byte [r12 + rax + 0x10], 2
je 0x18004198b
mov rdx, r15
mov rcx, rbx
call fcn.1800057e0
test al, al
je 0x18004198b
mov rax, qword [rsp + 0x50]
dec rax
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x78], rax
mov rax, qword [rbx + 0xb3]
mov rcx, qword [r12 + rax]
mov qword [rsp + 0x80], rcx
mov rax, qword [r12 + rax + 8]
mov qword [rsp + 0x70], rax
mov r8, rax
mov rdx, rcx
mov rcx, rbx
call fcn.180004440
test al, al
je 0x18004198b
mov rdx, qword [rbx + 0xb3]
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov rax, qword [rsp + 0x80]
mov r8d, dword [rax]
mov rdx, qword [r12 + rdx]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180041a39
mov r8, qword [rsp + 0x48]
mov qword [r12 + rdi + 0x12], r8
mov eax, dword [rsp + 0x40]
add r8, rax
mov qword [rsp + 0x48], r8
mov rax, qword [rsp + 0x70]
mov eax, dword [rax]
cmp rax, qword [rbx + 0x22]
ja 0x18004198b
mov rdx, qword [rbx + 0xb3]
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov r8d, eax
mov rdx, qword [r12 + rdx + 8]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x180041a39
mov rcx, qword [rsp + 0x48]
mov qword [r12 + rdi + 0x1a], rcx
mov eax, dword [rsp + 0x40]
add rcx, rax
mov qword [rsp + 0x48], rcx
mov rax, qword [rbx + 0xb3]
mov dl, byte [r12 + rax + 0x10]
and dl, 3
lea rax, [r15 + 2]
imul rcx, rax, 0x11
mov byte [rcx + rdi], dl
inc qword [rdi + 8]
inc r15
mov qword [rsp + 0x88], r15
cmp qword [rsp + 0xf0], 0
je 0x180041a02
mov r12, qword [rbx]
lea rcx, [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov rcx, qword [rsp + 0x68]
sub rcx, qword [0x1800dd5f0]
movabs rax, 0x346dc5d63886594b
mul rcx
shr rdx, 0xb
mov eax, dword [rsp + 0xe0]
cmp rdx, rax
jae 0x1800419dd
cmp r15, r12
jne 0x180041a02
mov r8, qword [rbx]
mov rdx, r15
mov rcx, qword [rsp + 0xe8]
call qword [rsp + 0xf0]
mov rcx, qword [rsp + 0x68]
mov qword [0x1800dd5f0], rcx
test al, al
je 0x180041a41
mov rax, qword [rsp + 0x50]
jmp 0x180041856
and qword [rsp + 0x90], 0
lea rax, [rsp + 0x90]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x40]
mov r8d, r13d
mov rdx, rdi
mov rcx, r14
call fcn.180028500
test al, al
jne 0x180041a41
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp r14, 0xffffffffffffffff
je 0x180041a50
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test rdi, rdi
je 0x180041a5d
mov rcx, rdi
call fcn.180053728
mov eax, esi
lea r11, [rsp + 0xa0]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret