Function at 0x100046144
Capabilities:
Delete file
Write file on windows

Disassembly:
mov r11, rsp
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xf0
mov qword [rsp + 0xa8], 0xfffffffffffffffe
mov qword [r11 + 0x18], rbx
mov rax, qword [0x100142128]
xor rax, rsp
mov qword [rsp + 0xe0], rax
mov r13, rdx
mov rsi, rcx
mov qword [r11 - 0x50], rcx
xor r14d, r14d
mov qword [rsp + 0x48], r14
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea rdx, [rsp + 0xb0]
mov rcx, qword [0x100145a40]
call fcn.10006bf84
nop
lea r8, [0x10000a5b0]
lea rdx, [rsp + 0xb0]
lea rcx, [rsp + 0x80]
call fcn.100039e4c
nop
lea r15d, [r14 + 7]
mov qword [rsp + 0x70], r15
mov qword [rsp + 0x68], r14
mov word [rsp + 0x58], r14w
or rbx, 0xffffffffffffffff
mov r9, rbx
xor r8d, r8d
mov rdx, rax
lea rcx, [rsp + 0x50]
call fcn.10002cd2c
nop
mov r9, rbx
xor r8d, r8d
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0xb0]
call fcn.10002cd2c
nop
cmp qword [rsp + 0x70], 8
jb 0x100046223
mov rcx, qword [rsp + 0x58]
cmp rcx, r14
je 0x100046223
call sub.msvcrt.dll_free
mov qword [rsp + 0x70], r15
mov qword [rsp + 0x68], r14
mov word [rsp + 0x58], r14w
cmp qword [rsp + 0xa0], 8
jb 0x100046250
mov rcx, qword [rsp + 0x88]
cmp rcx, r14
je 0x100046250
call sub.msvcrt.dll_free
mov qword [rsp + 0xa0], r15
mov qword [rsp + 0x98], r14
mov word [rsp + 0x88], r14w
lea rcx, [rsp + 0xb8]
cmp qword [rsp + 0xd0], 8
cmovae rcx, qword [rsp + 0xb8]
mov qword [rsp + 0x30], r14
mov dword [rsp + 0x28], 0x80
mov eax, 2
mov dword [rsp + 0x20], eax
xor r9d, r9d
mov r8d, eax
mov edx, 0x40000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, rbx
jne 0x1000462cc
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ebx, ax
or ebx, 0x80070000
cmp eax, r14d
cmovle ebx, eax
jmp 0x1000464d1
mov dword [rsp + 0x78], r14d
mov rax, qword [rsi + 0x18]
lea r8d, [rax + rax]
cmp qword [rsi + 0x20], 8
jb 0x1000462e6
mov rdx, qword [rsi + 8]
jmp 0x1000462ea
lea rdx, [rsi + 8]
mov qword [rsp + 0x20], r14
lea r9, [rsp + 0x78]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, r14d
jne 0x100046325
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ebx, ax
or ebx, 0x80070000
cmp eax, r14d
cmovle ebx, eax
jmp 0x1000464b0
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, [0x100004bf0]
call fcn.1000493d8
mov rdi, rax
cmp rax, r14
jne 0x10004635c
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ebx, ax
or ebx, 0x80070000
cmp eax, r14d
cmovle ebx, eax
jmp 0x1000464b0
lea rdx, [0x100004c08]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rbx, rax
lea rdx, [0x100004c18]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov r12, rax
lea rdx, [0x100004c28]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov rdi, rax
cmp rax, r14
je 0x10004649b
cmp r12, r14
je 0x10004649b
cmp rbx, r14
je 0x10004649b
lea rcx, [rsp + 0xb8]
cmp qword [rsp + 0xd0], 8
cmovae rcx, qword [rsp + 0xb8]
lea r8, [rsp + 0x48]
mov edx, 1
call rbx
mov edx, eax
mov ecx, eax
call fcn.1000466ac
mov ebx, eax
cmp edx, r14d
jne 0x1000464b0
mov rcx, qword [rsp + 0x48]
cmp rcx, r14
je 0x1000464b0
mov qword [rsp + 0x40], r14
lea rdx, [rsp + 0x40]
call rdi
mov ebp, eax
cmp eax, r14d
jne 0x10004647a
mov qword [rsp + 0x70], r15
mov qword [rsp + 0x68], r14
mov word [rsp + 0x58], r14w
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdx, qword [rsp + 0x40]
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [rsp + 0x50]
call fcn.10002cf94
nop
or r9, 0xffffffffffffffff
xor r8d, r8d
lea rdx, [rsp + 0x50]
mov rcx, r13
call fcn.10002cd2c
nop
cmp qword [rsp + 0x70], 8
jb 0x10004646a
mov rcx, qword [rsp + 0x58]
cmp rcx, r14
je 0x10004646a
call sub.msvcrt.dll_free
mov qword [rsp + 0x70], r15
mov qword [rsp + 0x68], r14
mov word [rsp + 0x58], r14w
cmp ebp, 2
cmove ebx, r14d
lea rcx, [rsp + 0x48]
call r12
mov rcx, qword [rsp + 0x40]
cmp rcx, r14
je 0x1000464b0
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x1000464b0
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ebx, ax
or ebx, 0x80070000
cmp eax, r14d
cmovle ebx, eax
lea rcx, [rsp + 0xb8]
cmp qword [rsp + 0xd0], 8
cmovae rcx, qword [rsp + 0xb8]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
nop
cmp qword [rsp + 0xd0], 8
jb 0x1000464ee
mov rcx, qword [rsp + 0xb8]
cmp rcx, r14
je 0x1000464ee
call sub.msvcrt.dll_free
mov qword [rsp + 0xd0], r15
mov qword [rsp + 0xc8], r14
mov word [rsp + 0xb8], r14w
cmp qword [rsi + 0x20], 8
jb 0x10004651c
mov rcx, qword [rsi + 8]
cmp rcx, r14
je 0x10004651c
call sub.msvcrt.dll_free
mov qword [rsi + 0x20], r15
mov qword [rsi + 0x18], r14
mov word [rsi + 8], r14w
mov eax, ebx
mov rcx, qword [rsp + 0xe0]
xor rcx, rsp
call fcn.1000c8b30
mov rbx, qword [rsp + 0x140]
add rsp, 0xf0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret