Function at 0x180009360
Capabilities:
Get file size
Write file on windows

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x10], rdx
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x90
mov r12, rdx
mov r15, rcx
xor edx, edx
mov rcx, r9
mov r13, r9
mov r14, r8
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov qword [rsp + 0x58], r13
mov edi, eax
xor eax, eax
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x70], rax
cmp r14, 0xffffffffffffffff
je 0x18000969a
cmp r13, 0xffffffffffffffff
je 0x18000969a
mov rcx, qword [r15 + 0x34]
mov rdx, qword [r12 + 0x10]
mov qword [rsp + 0x88], rbp
test rcx, rcx
je 0x1800093f5
mov rax, qword [rcx + 0x20]
cmp rax, rdx
jbe 0x1800093f5
mov qword [rcx + 0x18], rax
sub rax, rdx
mov qword [rcx + 0x28], rdx
cmp rax, 0xffffffffffffffff
jbe 0x1800093f5
lea rax, [rdx - 1]
mov qword [rcx + 0x18], rax
mov rax, qword [r12 + 0x8b]
mov dword [rsp + 0x40], 0
mov ebp, dword [rax]
cmp ebp, 0xffffffff
je 0x18000967c
xor ecx, ecx
mov rdx, rdi
mov r8d, 0x1000
lea r9d, [rcx + 4]
mov qword [rsp + 0x80], rsi
mov qword [rsp + 0x50], rdx
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rsi, rax
mov qword [rsp + 0x48], rax
test rax, rax
je 0x180009674
mov qword [rsp + 0xc0], rbx
xor ebx, ebx
cmp dword [r15 + 0x298], ebx
jbe 0x1800094b8
nop word [rax + rax]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [r15 + 0x294]
mov r9d, edi
mov r8, rsi
mov edx, ebx
shr ecx, 2
call fcn.180017600
xor eax, eax
lea r9, [rsp + 0xd0]
mov r8d, edi
mov rdx, rsi
mov rcx, r13
mov dword [rsp + 0xd0], eax
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WriteFile]
inc ebx
cmp ebx, dword [r15 + 0x298]
jb 0x180009460
add ebp, 0xfffffffe
cmp qword [r12 + 8], 0
jbe 0x18000965b
mov edi, dword [rsp + 0xe0]
mov rbx, qword [rsp + 0x50]
mov rcx, qword [r15 + 0x24]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x18000965b
mov ecx, dword [rsp + 0x40]
mov rax, qword [r12 + 8]
sub rax, rcx
cmp rbx, rax
cmovb rax, rbx
xor edx, edx
xor ecx, ecx
div edi
mov esi, ecx
mov edi, eax
mov r12d, eax
mov dword [rsp + 0x44], eax
test eax, eax
je 0x180009597
mov ebx, edi
test edi, edi
je 0x180009581
mov r12d, esi
mov r13d, ebp
nop
mov qword [rsp + 0x38], rcx
lea rax, [rsp + 0xd0]
lea r8, [rsp + 0x58]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], ecx
mov qword [rsp + 0x20], rcx
mov rcx, r14
mov r9d, 0x20
mov edx, 0x90074
mov qword [rsp + 0x60], r12
mov qword [rsp + 0x68], r13
mov dword [rsp + 0x70], ebx
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x18000956e
shr ebx, 1
mov ecx, eax
jne 0x180009520
jmp 0x180009581
mov eax, 1
lea ebp, [rbp + rbx - 1]
lea esi, [rsi + rbx - 1]
sub eax, ebx
add edi, eax
xor ecx, ecx
inc ebp
inc esi
add edi, 0xffffffff
jne 0x180009513
mov r12d, dword [rsp + 0x44]
mov r13, qword [rsp + 0xd8]
cmp dword [r15 + 0x298], 0
mov ebx, ecx
jbe 0x18000960d
mov edi, dword [rsp + 0xe0]
mov rsi, qword [rsp + 0x48]
imul r12d, edi
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [r15 + 0x294]
mov r9d, r12d
mov r8, rsi
mov edx, ebx
shr ecx, 2
call fcn.180017600
xor eax, eax
lea r9, [rsp + 0xd0]
mov r8d, r12d
mov rdx, rsi
mov rcx, r13
mov dword [rsp + 0xd0], eax
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_WriteFile]
inc ebx
cmp ebx, dword [r15 + 0x298]
jb 0x1800095b3
jmp 0x180009619
mov rsi, qword [rsp + 0x48]
mov edi, dword [rsp + 0xe0]
mov ecx, dword [rsp + 0x40]
mov r12, qword [rsp + 0xc8]
mov rbx, qword [rsp + 0x50]
mov rax, qword [r12 + 8]
sub rax, rcx
mov ecx, dword [rsp + 0x40]
cmp rbx, rax
cmovb rax, rbx
add ecx, eax
mov eax, ecx
mov dword [rsp + 0x40], ecx
mov rcx, qword [rsp + 0xe8]
mov qword [rcx], rax
cmp rax, qword [r12 + 8]
jb 0x1800094d3
xor edx, edx
mov r8d, 0x8000
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rbx, qword [rsp + 0xc0]
mov rsi, qword [rsp + 0x80]
mov rcx, qword [r15 + 0x34]
mov rbp, qword [rsp + 0x88]
test rcx, rcx
je 0x180009695
mov qword [rcx + 0x6b], 0xffffffffffffffff
mov eax, 1
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
ret