Function at 0x100160bf0
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rax - 0x1d8]
sub rsp, 0x2b0
mov qword [rsp + 0x68], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rsi
mov rax, qword [0x10022f440]
xor rax, rsp
mov qword [rbp + 0x1a0], rax
mov r15, rdx
mov rdi, rcx
lea rcx, [rsp + 0x60]
call qword [sym.imp.MSVCR100.dll__time64]
lea rdx, [rsp + 0x60]
lea rcx, [rsp + 0x70]
call qword [sym.imp.MSVCR100.dll__localtime64_s]
xor esi, esi
mov eax, dword [rbp - 0x74]
cmp dword [rdi + 0x118], eax
jne 0x100160c6b
mov eax, dword [rdi + 0x11c]
cmp eax, dword [rdi + 0x178]
jle 0x100160cf0
lea r14, [rdi + 0x120]
mov qword [rsp + 0x40], r14
mov dword [rsp + 0x48], esi
lea r9, [rdi + 0x150]
or r8d, 0xffffffff
mov r12d, 2
mov edx, r12d
mov rcx, r14
call fcn.100076f30
mov ebx, esi
test eax, eax
cmove ebx, r12d
mov dword [rsp + 0x48], ebx
mov eax, dword [rbp - 0x74]
cmp dword [rdi + 0x118], eax
jne 0x100160cc5
mov eax, dword [rdi + 0x11c]
mov ebx, dword [rsp + 0x48]
mov r14, qword [rsp + 0x40]
cmp eax, dword [rdi + 0x178]
jle 0x100160cde
mov rcx, rdi
call fcn.100161c90
mov r11d, dword [rbp - 0x74]
mov dword [rdi + 0x118], r11d
mov dword [rdi + 0x11c], esi
test ebx, ebx
je 0x100160cf0
mov edx, ebx
mov rcx, r14
call fcn.1001047d0
mov dword [rsp + 0x48], esi
mov qword [rsp + 0x30], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rcx, rax
lea r9, [rsp + 0x30]
mov r14d, 1
mov r8d, r14d
lea edx, [r14 + 3]
call qword [sym.imp.ADVAPI32.dll_OpenThreadToken]
test eax, eax
jne 0x100160d35
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp eax, 0x3f0
je 0x100160d63
or ebx, 0x80130000
jmp 0x100160d65
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
test eax, eax
jne 0x100160d63
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], 0xffffffffffffffff
or ebx, 0x80130000
jmp 0x100160d65
mov ebx, esi
mov ecx, ebx
call fcn.10015ed00
nop
lea rcx, [rdi + 0x120]
mov qword [rsp + 0x50], rcx
mov dword [rsp + 0x58], esi
lea r9, [rdi + 0x150]
or r8d, 0xffffffff
mov edx, r14d
call fcn.100076f30
mov ecx, esi
test eax, eax
cmove ecx, r14d
mov dword [rsp + 0x58], ecx
mov dword [rsp + 0x38], esi
or rbx, 0xffffffffffffffff
inc rbx
cmp word [r15 + rbx*2], 0
jne 0x100160da4
add ebx, ebx
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x38]
mov r8d, ebx
mov rdx, r15
mov rcx, qword [rdi + 0x2a8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov r11d, dword [rsp + 0x38]
cmp ebx, r11d
je 0x100160e18
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r8, [0x1000451b0]
mov edx, 0x100
lea rcx, [rbp - 0x60]
call fcn.10006c5f0
mov r9d, r14d
mov edx, 4
mov ecx, r14d
lea rax, [rbp - 0x60]
mov qword [rsp + 0x20], rax
lea r8d, [rdx + 0x77]
call fcn.10015ebf0
mov r11d, dword [rsp + 0x38]
lock xadd dword [rdi + 0x11c], r11d
mov edx, dword [rsp + 0x58]
test edx, edx
je 0x100160e37
mov rcx, qword [rsp + 0x50]
call fcn.1001047d0
mov dword [rsp + 0x58], esi
mov rdx, qword [rsp + 0x30]
cmp rdx, 0xffffffffffffffff
je 0x100160e83
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_SetThreadToken]
test eax, eax
jne 0x100160e78
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov rcx, qword [rsp + 0x30]
cmp rcx, 0xffffffffffffffff
je 0x100160e70
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], 0xffffffffffffffff
or esi, 0x80130000
jmp 0x100160e8c
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x30], 0xffffffffffffffff
mov ecx, esi
call fcn.10015ed00
mov rcx, qword [rbp + 0x1a0]
xor rcx, rsp
call fcn.10005f420
lea r11, [rsp + 0x2b0]
mov rbx, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret