Function at 0x10002174c
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 0x18], r8
mov qword [rax + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
sub rsp, 0x100
mov qword [rsp + 0x50], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov r12, r8
mov rsi, rdx
mov rdi, rcx
xor ebp, ebp
lea rcx, [0x100083100]
mov rax, qword [0x100083100]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x40], rax
lea rcx, [0x100083100]
mov rax, qword [0x100083100]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x48], rax
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x48]
mov rcx, rsi
call fcn.1000328c4
mov rbx, qword [rsp + 0x40]
lea ecx, [rbp + 1]
sub ecx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
mov r13d, 0x104
sub eax, r13d
or eax, ecx
jge 0x1000217f0
mov edx, r13d
lea rcx, [rsp + 0x40]
call fcn.100020154
mov rbx, qword [rsp + 0x40]
cmp dword [rbx - 0xc], r13d
jge 0x100021801
mov ecx, 0x80070057
call fcn.1000201f8
int3
mov dword [rbx - 0x10], r13d
and word [rbx + 0x208], 0
mov r13d, 0x98
mov r8, r13
xor edx, edx
lea rcx, [rsp + 0x60]
call sub.msvcrt.dll_memset
mov dword [rsp + 0x60], r13d
mov qword [rsp + 0x68], rdi
mov rax, qword [0x100083fd8]
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x90], rbx
mov eax, dword [rbx - 0x10]
mov dword [rsp + 0x98], eax
mov dword [rsp + 0xc0], 6
lea rcx, [rsp + 0x60]
call qword [sym.imp.COMDLG32.dll_GetSaveFileNameW]
or r13, 0xffffffffffffffff
test eax, eax
je 0x10002190d
and qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, r13
je 0x1000218f1
mov rdx, qword [r12]
mov r8d, dword [rdx - 0x10]
add r8d, r8d
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x148]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1000218ca
lea ebp, [r13 + 2]
jmp 0x1000218e6
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov r9, qword [rsi]
lea r8, [0x100005c68]
mov ecx, 3
call fcn.10001e694
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x10002190d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov r9, qword [rsi]
lea r8, [0x100005c68]
mov ecx, 3
call fcn.10001e694
xor eax, eax
mov rcx, r13
mov rdi, rbx
repne scasw ax, word [rdi]
not rcx
sub rcx, 1
test ecx, ecx
js 0x1000219c3
cmp ecx, dword [rbx - 0xc]
jg 0x1000219c3
mov dword [rbx - 0x10], ecx
movsxd rax, ecx
and word [rbx + rax*2], 0
mov rdx, qword [rsp + 0x48]
add rdx, 0xffffffffffffffe8
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
add eax, r13d
test eax, eax
jg 0x10002195d
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsp + 0x40]
add rdx, 0xffffffffffffffe8
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
add eax, r13d
test eax, eax
jg 0x10002197f
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [rsi]
sub rdx, 0x18
mov eax, r13d
lock xadd dword [rdx + 0x10], eax
add eax, r13d
test eax, eax
jg 0x10002199f
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
nop
mov rdx, qword [r12]
sub rdx, 0x18
mov ecx, r13d
lock xadd dword [rdx + 0x10], ecx
add ecx, r13d
test ecx, ecx
jg 0x1000219bf
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, ebp
jmp 0x1000219ce
mov ecx, 0x80070057
call fcn.1000201f8
nop
mov rbx, qword [rsp + 0x130]
add rsp, 0x100
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret