Function at 0x180002820
Capabilities:
Get disk size
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rax - 0xce8]
sub rsp, 0xdc0
mov qword [rsp + 0x70], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov rax, qword [0x180029528]
xor rax, rsp
mov qword [rbp + 0xcb0], rax
mov rbx, rcx
xor r12d, r12d
cmp byte [rcx + 0x78], r12b
je 0x180002928
call fcn.180002c18
test al, al
jne 0x180002928
mov ecx, dword [0x18002bde8]
lea r8d, [rcx + 2]
lea eax, [rcx + 1]
imul r8d, eax
imul r8d, ecx
mov eax, 0x66666667
imul r8d
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*4]
shl eax, 2
sub r8d, eax
cmp r8d, 0x11
jne 0x180002beb
mov word [rbp - 0x80], r12w
xor edx, edx
mov r8d, 0xd20
lea rcx, [rbp - 0x7e]
call fcn.18000dd50
mov r9d, r12d
or rsi, 0xffffffffffffffff
lea edi, [rsi + 2]
mov r8, r12
test r9, r9
je 0x1800028fd
test r8, r8
je 0x1800028fd
lea rcx, [r8 + rsi]
lea rax, [r8 + rsi]
movzx edx, word [rsp + rcx*2 + 0x30]
add dx, word [rbp + rax*2 - 0x80]
add dx, di
lea rax, [r8 + rsi]
mov word [rbp + rax*2 - 0x7e], dx
add r8, rdi
cmp r8, 0x29
jl 0x1800028d5
add r9, rdi
add rsi, 0x29
cmp rsi, 0x690
jl 0x1800028d2
movsx eax, word [rbp + 0xca0]
mov dword [0x18002bde8], eax
jmp 0x180002beb
lea r14, [rbx + 0xb0]
mov rax, qword [r14 + 8]
or rsi, 0xffffffffffffffff
lea edi, [rsi + 2]
cmp qword [r14], rax
jne 0x180002a34
mov r8d, dword [0x18002bde8]
lea ecx, [r8 + 2]
lea eax, [r8 + 1]
imul ecx, eax
imul ecx, r8d
mov eax, 0x30c30c31
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add edx, eax
imul edx, edx, 0x15
sub ecx, edx
cmp ecx, 8
jne 0x1800029b0
mov eax, 0x51eb851f
imul r8d
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
imul edx, edx, 0x64
sub r8d, edx
add r8d, 0x2f4
movsxd rcx, r8d
lea eax, [rsi + 5]
mul rcx
cmovo rax, rsi
mov rcx, rax
call fcn.180008ebc
mov rcx, rax
call fcn.18000a130
lea rax, [rbx + 0xd0]
mov qword [rsp + 0x38], rax
lea r15, [rax + 8]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp qword [rbx + 0x120], r12
jne 0x1800029e1
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x180002beb
lea rcx, [rbx + 0x100]
lea rdx, [rsp + 0x40]
call fcn.180003b4c
mov rdx, rax
mov rax, qword [rax]
test rax, rax
jne 0x180002a02
mov rax, r12
jmp 0x180002a05
mov rax, qword [rax]
mov rcx, qword [rax + 0x10]
sub rcx, rdi
and rcx, qword [rdx + 0x10]
mov rax, qword [rax + 8]
mov rdx, qword [rax + rcx*8]
add rdx, 8
mov rcx, r14
call fcn.180003644
mov qword [rbx + 0xc8], r12
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [rsp + 0x30], r12d
mov rdx, qword [r14]
mov r8, qword [r14 + 8]
sub r8, rdx
lea rcx, [rbx + 0x80]
add rdx, qword [rbx + 0xc8]
mov qword [rsp + 0x20], rcx
lea r9, [rsp + 0x30]
mov rcx, qword [rbx + 0xa8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x180002af7
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x6d
je 0x180002ac2
cmp eax, 0x3e5
je 0x180002abc
lea rax, str.Channel_write_failure
mov qword [rsp + 0x38], rax
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x40]
call fcn.180009f78
nop
lea rax, [0x180021c00]
mov qword [rsp + 0x40], rax
lea rdx, [0x1800275f8]
lea rcx, [rsp + 0x40]
call fcn.18000a6b8
int3
mov byte [rbx + 0x78], dil
jmp 0x180002af7
lea rcx, [rsp + 0x58]
call fcn.180009ff0
nop
lea rax, [0x180021c00]
mov qword [rsp + 0x58], rax
lea rax, [0x180021c20]
mov qword [rsp + 0x58], rax
lea rdx, [0x1800275b0]
lea rcx, [rsp + 0x58]
call fcn.18000a6b8
int3
cmp byte [rbx + 0x78], r12b
jne 0x180002beb
mov eax, dword [rsp + 0x30]
add qword [rbx + 0xc8], rax
mov ecx, dword [0x18002bde8]
imul ecx, ecx
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add edx, eax
imul edx, edx, 0xb
sub ecx, edx
cmp ecx, 7
jne 0x180002b44
mov qword [rsp + 0x20], r12
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceW]
mov rax, qword [r14 + 8]
sub rax, qword [r14]
cmp qword [rbx + 0xc8], rax
jne 0x180002bd9
lea rax, [rbx + 0xd0]
mov qword [rsp + 0x38], rax
lea r15, [rax + 8]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
cmp qword [rbx + 0x120], r12
je 0x180002bb7
mov rcx, qword [rbx + 0x110]
sub rcx, rdi
and rcx, qword [rbx + 0x118]
mov rax, qword [rbx + 0x108]
mov rcx, qword [rax + rcx*8]
mov rax, qword [rcx]
xor edx, edx
call qword [rax]
add qword [rbx + 0x120], rsi
jne 0x180002bb0
mov qword [rbx + 0x118], r12
jmp 0x180002bb7
add qword [rbx + 0x118], rdi
mov rax, qword [r14]
mov qword [r14 + 8], rax
mov qword [rbx + 0xc8], r12
cmp qword [rbx + 0x120], r12
setne dil
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rbx + 0xa0]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov al, dil
jmp 0x180002bed
xor al, al
mov rcx, qword [rbp + 0xcb0]
xor rcx, rsp
call fcn.180008ef0
lea r11, [rsp + 0xdc0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret