Function at 0x180041e70
Capabilities:
Write file on windows

Disassembly:
mov r11, rsp
mov qword [r11 + 0x20], r9
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x230
mov qword [r11 - 0x1c8], 0xfffffffffffffffe
mov rax, qword [0x1800b0070]
xor rax, rsp
mov qword [rsp + 0x228], rax
mov r12, r9
mov dword [rsp + 0x50], r8d
mov r13, rdx
mov rbx, rcx
mov qword [r11 - 0x48], 7
xor r15d, r15d
mov qword [r11 - 0x50], r15
mov word [r11 - 0x60], r15w
or rsi, 0xffffffffffffffff
mov r8, rsi
nop
inc r8
cmp word [rdx + r8*2], r15w
jne 0x180041ed0
lea rcx, [rsp + 0x200]
call fcn.180046e10
nop
lea rcx, [rbx + 0x150]
lea rdx, [rsp + 0x200]
call fcn.180043be0
mov rbx, qword [rax]
mov qword [rsp + 0x68], rbx
lea rcx, [rbx + 0x20]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp byte [rsp + 0x2b8], 0
jne 0x18004257f
mov ecx, 0xdeadbeef
mov r14, qword [rsp + 0x2b0]
mov rax, r14
xor rax, rcx
mov qword [rsp + 0x90], rax
mov edx, 0x1f31d
mov ecx, eax
call qword [sym.imp.msvcrt.dll_ldiv]
mov qword [rsp + 0x58], rax
mov rcx, rax
shr rcx, 0x20
imul edx, ecx, 0x41a7
imul ecx, eax, 0xb14
sub edx, ecx
mov dword [rsp + 0x5c], edx
jns 0x180041f6f
add edx, 0x7fffffff
mov dword [rsp + 0x5c], edx
mov r8, qword [rbx + 0xa0]
movsxd rcx, edx
and rcx, r8
cmp qword [rbx + 0xa8], rcx
ja 0x180041f91
shr r8, 1
mov rax, rsi
sub rax, r8
add rcx, rax
lea rdx, [rcx*8]
mov r8, qword [rbx + 0x88]
mov rax, qword [rdx + r8]
cmp rax, qword [r8 + rdx + 8]
je 0x180041fdd
mov rcx, qword [rax + 0x10]
cmp rcx, r14
jb 0x180041fd8
cmp r14, rcx
jae 0x180041fc9
mov rax, qword [rbx + 0x70]
mov qword [rsp + 0x70], rax
lea rax, [rsp + 0x70]
jmp 0x180041fd3
mov qword [rsp + 0x60], rax
lea rax, [rsp + 0x60]
mov rax, qword [rax]
jmp 0x180041fe1
mov rax, qword [rax]
jmp 0x180041fa4
mov rax, qword [rbx + 0x70]
cmp rax, qword [rbx + 0x70]
jne 0x180042013
mov qword [rsp + 0x80], r14
mov qword [rsp + 0x88], r15
lea r8, [rsp + 0x80]
lea rdx, [rsp + 0x90]
lea rcx, [rbx + 0x60]
call fcn.180045170
mov rax, qword [rax]
mov rdx, qword [rax + 0x18]
mov rax, qword [rbx + 0xb0]
mov byte [rdx + rax], 1
mov rcx, qword [rbx + 0xb8]
mov rax, qword [rsp + 0x2a0]
mov qword [rcx + rdx*8], rax
mov rdi, qword [rbx + 0xc0]
mov qword [rsp + 0x78], rdi
mov edx, dword [rbx + 0xc8]
add rdx, qword [rbx + 0xc0]
mov rax, qword [rbx + 0x50]
cmp rdx, rax
cmovb rax, rdx
cmp rdi, rax
jae 0x180042521
mov rax, qword [rbx + 0xb0]
cmp byte [rdi + rax], 0
je 0x180042521
mov rax, qword [rbx + 0x48]
mov r8, qword [rax + rdi*8]
mov rcx, qword [rbx + 0xb8]
mov r9, qword [rbx + 0x58]
mov r8, qword [r8 + 0x18]
mov edx, 1
mov rcx, qword [rcx + rdi*8]
call qword [sym.imp.msvcrt.dll_fwrite]
mov r12, rax
mov rcx, qword [rbx + 0x48]
mov rdx, qword [rcx + rdi*8]
cmp rax, qword [rdx + 0x18]
jne 0x180042157
lea r14, [rdi + 1]
mov rcx, qword [rbx + 0x50]
mov qword [rsp + 0x48], rcx
mov qword [rsp + 0x40], r14
mov rcx, qword [rbx]
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x30], rax
lea rax, [0x180008cd0]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 3
mov r9d, 0x1a3
lea r8, [0x180008d40]
lea rdx, [0x1800083c0]
mov ecx, 1
call sym.StorageClientLib.dll_griteLog
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rax + rdi*8]
call sub.msvcrt.dll_free
mov rax, qword [rbx + 0xb8]
mov qword [rax + rdi*8], r15
mov ecx, dword [rbx + 0xc8]
xor edx, edx
mov rax, r14
div rcx
test rdx, rdx
je 0x180042139
mov rax, qword [rbx + 0x50]
dec rax
cmp rdi, rax
jne 0x180042143
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov qword [rbx + 0xc0], r14
mov rdi, r14
mov qword [rsp + 0x78], r14
jmp 0x180042041
mov rax, qword [rbx + 0xb8]
mov rcx, qword [rax + rdi*8]
call sub.msvcrt.dll_free
mov rax, qword [rbx + 0xb8]
mov qword [rax + rdi*8], r15
mov qword [rsp + 0x1d0], 7
mov qword [rsp + 0x1c8], r15
mov word [rsp + 0x1b8], r15w
mov r8d, 6
lea rdx, [0x180008da8]
lea rcx, [rsp + 0x1b0]
call fcn.180046e10
nop
mov qword [rsp + 0x1f8], 7
mov qword [rsp + 0x1f0], r15
mov word [rsp + 0x1e0], r15w
lea rcx, [rsp + 0xb0]
call fcn.180043eb0
nop
mov rdx, r12
lea rcx, [rsp + 0xc0]
call fcn.180043580
lea rdx, [rsp + 0x1d8]
lea rcx, [rsp + 0xb0]
call fcn.180049760
mov r9, rsi
xor r8d, r8d
lea rdx, [rsp + 0x1d8]
lea rcx, [rsp + 0x1b0]
call fcn.180044ef0
mov r8d, 0xf
lea rdx, [0x180008db8]
lea rcx, [rsp + 0x1b0]
call fcn.180045020
mov rdx, qword [rbx]
mov r8, rsi
inc r8
cmp word [rdx + r8*2], 0
jne 0x180042235
lea rcx, [rsp + 0x1b0]
call fcn.180045020
mov r8d, 0xd
lea rdx, [0x180008dd8]
lea rcx, [rsp + 0x1b0]
call fcn.180045020
mov rax, qword [rsp + 0xb0]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0xb0]
add rcx, rax
mov edx, r15d
mov r14d, 4
cmp qword [rcx + 0x48], rdx
cmove edx, r14d
xor r8d, r8d
call fcn.180040220
lea rdx, [rdi + 1]
lea rcx, [rsp + 0xc0]
call fcn.180043580
lea rdx, [rsp + 0x1d8]
lea rcx, [rsp + 0xb0]
call fcn.180049760
mov r9, rsi
xor r8d, r8d
lea rdx, [rsp + 0x1d8]
lea rcx, [rsp + 0x1b0]
call fcn.180044ef0
lea r8d, [r14 + 4]
lea rdx, [0x180008df8]
lea rcx, [rsp + 0x1b0]
call fcn.180045020
mov rax, qword [rsp + 0xb0]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0xb0]
add rcx, rax
mov edx, r15d
cmp qword [rcx + 0x48], rdx
cmove edx, r14d
xor r8d, r8d
call fcn.180040220
mov rdx, qword [rbx + 0x50]
lea rcx, [rsp + 0xc0]
call fcn.180043580
lea rdx, [rsp + 0x1d8]
lea rcx, [rsp + 0xb0]
call fcn.180049760
mov r9, rsi
xor r8d, r8d
lea rdx, [rsp + 0x1d8]
lea rcx, [rsp + 0x1b0]
call fcn.180044ef0
lea r8d, [r14 + 4]
lea rdx, [0x180008e10]
lea rcx, [rsp + 0x1b0]
call fcn.180045020
mov rax, qword [rsp + 0xb0]
movsxd rcx, dword [rax + 4]
lea rax, [rsp + 0xb0]
add rcx, rax
mov edx, r15d
cmp qword [rcx + 0x48], rdx
cmove edx, r14d
xor r8d, r8d
call fcn.180040220
mov rax, qword [rbx + 0x48]
mov rdx, qword [rax + rdi*8]
mov rdx, qword [rdx + 0x18]
lea rcx, [rsp + 0xc0]
call fcn.180043580
lea rdx, [rsp + 0x1d8]
lea rcx, [rsp + 0xb0]
call fcn.180049760
mov r9, rsi
xor r8d, r8d
lea rdx, [rsp + 0x1d8]
lea rcx, [rsp + 0x1b0]
call fcn.180044ef0
lea r8d, [r14 + 0xf]
lea rdx, [0x180008e28]
lea rcx, [rsp + 0x1b0]
call fcn.180045020
lea rax, [rsp + 0x1b8]
cmp qword [rsp + 0x1d0], 8
cmovae rax, qword [rsp + 0x1b8]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 1
mov r9d, 0x1c3
lea r8, [0x180008d40]
lea rdx, [0x1800083c0]
lea ecx, [r14 - 3]
call sym.StorageClientLib.dll_griteLog
mov rcx, qword [rbx + 0x10]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, 0x80004005
mov edi, dword [rsp + 0x50]
test edi, edi
cmovns edi, eax
mov dword [rsp + 0x280], edi
lea rcx, [rsp + 0x148]
call fcn.180043fa0
lea rax, [rsp + 0x148]
mov qword [rsp + 0x90], rax
lea rax, [0x180009818]
mov qword [rsp + 0x148], rax
lea rax, [0x180009970]
mov qword [rsp + 0x148], rax
lea rcx, [rsp + 0x148]
call fcn.18003ae6c
nop
cmp qword [rsp + 0x1f8], 8
jb 0x1800424c2
mov rcx, qword [rsp + 0x1e0]
call sub.msvcrt.dll_free
mov qword [rsp + 0x1f8], 7
mov qword [rsp + 0x1f0], r15
mov word [rsp + 0x1e0], r15w
cmp qword [rsp + 0x1d0], 8
jb 0x1800424f7
mov rcx, qword [rsp + 0x1b8]
call sub.msvcrt.dll_free
mov qword [rsp + 0x1d0], 7
mov qword [rsp + 0x1c8], r15
mov word [rsp + 0x1b8], r15w
mov r12, qword [rsp + 0x288]
jmp 0x1800425a0
mov rax, qword [rbx + 0x50]
cmp qword [rbx + 0xc0], rax
jb 0x180042577
mov rax, qword [rbx]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], r13
lea rax, [0x180008e50]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 3
mov r9d, 0x1d0
lea r8, [0x180008d40]
lea rdx, [0x1800083c0]
mov ecx, 1
call sym.StorageClientLib.dll_griteLog
mov rcx, qword [rbx + 0x10]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov r12, qword [rsp + 0x288]
mov edi, dword [rsp + 0x50]
jmp 0x1800425a0
cmp byte [rsp + 0x2b8], 0
jne 0x1800425fa
test edi, edi
jns 0x1800425fa
mov rax, qword [r12 + 0x28]
test rax, rax
je 0x1800425fa
nop dword [rax + rax]
inc rsi
cmp word [rax + rsi*2], 0
jne 0x1800425c0
test rsi, rsi
je 0x1800425fa
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 1
mov r9d, 0x1df
lea r8, [0x180008d40]
lea rdx, [0x1800083c0]
mov ecx, 1
call sym.StorageClientLib.dll_griteLog
lea rcx, [rbx + 0x20]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
nop
cmp qword [rsp + 0x220], 8
jb 0x18004261d
mov rcx, qword [rsp + 0x208]
call sub.msvcrt.dll_free
mov qword [rsp + 0x220], 7
mov qword [rsp + 0x218], r15
mov word [rsp + 0x208], r15w
mov rcx, qword [rsp + 0x228]
xor rcx, rsp
call fcn.18003b8c0
add rsp, 0x230
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret