Function at 0x140040040
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rbp
lea rbp, [rax - 0x18]
sub rsp, 0x110
mov qword [rbp - 0x18], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x14009e018]
xor rax, rsp
mov qword [rbp + 8], rax
mov rdi, rcx
lea rax, [rbp - 0x58]
mov qword [rsp + 0x38], rax
xor esi, esi
mov qword [rsp + 0x30], rsi
lea rax, [rbp - 0x50]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rsi
xor r9d, r9d
lea edx, [rsi + 2]
lea r8d, [rsi + 4]
call qword [sym.imp.ADVAPI32.dll_GetSecurityInfo]
mov ebx, eax
test eax, eax
je 0x140040135
mov ecx, 0x4b4f4e00
call fcn.14001a490
mov edx, 0x5017
movzx ecx, word [rax]
xor cx, dx
mov word [rbp - 0x10], cx
movzx ecx, word [rax + 2]
xor cx, dx
mov word [rbp - 0xe], cx
movzx ecx, word [rax + 4]
xor cx, dx
mov word [rbp - 0xc], cx
movzx eax, word [rax + 6]
xor ax, dx
mov word [rbp - 0xa], ax
mov word [rbp - 8], si
mov rcx, qword [0x1400a34c0]
test rcx, rcx
je 0x14004012a
lea rdx, [rbp - 0x10]
or rax, 0xffffffffffffffff
nop
lea rax, [rax + 1]
cmp word [rdx + rax*2], si
jne 0x140040100
lea r8d, [rax*2 + 2]
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x60]
lea rdx, [rbp - 0x10]
mov rcx, qword [rcx + 0x70]
call qword [sym.imp.KERNEL32.dll_WriteFile]
or ebx, 0xe0ff0000
jmp 0x1400403bc
lea rax, [rbp - 0x58]
mov qword [rsp + 0x60], rax
lea r8, [rsp + 0x60]
lea rcx, [rbp - 0x28]
call fcn.14003a9c0
nop
mov dword [rbp], 0
mov word [rbp + 4], 0x100
lea rax, [rsp + 0x68]
mov qword [rsp + 0x50], rax
mov dword [rsp + 0x48], esi
mov dword [rsp + 0x40], esi
mov dword [rsp + 0x38], esi
mov dword [rsp + 0x30], esi
mov dword [rsp + 0x28], esi
mov dword [rsp + 0x20], esi
xor r9d, r9d
xor r8d, r8d
mov dl, 1
lea rcx, [rbp]
call qword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
jne 0x14004022e
mov ecx, 0x78f00527
call fcn.14001a490
mov edx, 0x5017
movzx ecx, word [rax]
xor cx, dx
mov word [rbp - 0x10], cx
movzx ecx, word [rax + 2]
xor cx, dx
mov word [rbp - 0xe], cx
movzx ecx, word [rax + 4]
xor cx, dx
mov word [rbp - 0xc], cx
movzx eax, word [rax + 6]
xor ax, dx
mov word [rbp - 0xa], ax
mov word [rbp - 8], si
mov rcx, qword [0x1400a34c0]
test rcx, rcx
je 0x14004021b
lea rdx, [rbp - 0x10]
or rax, 0xffffffffffffffff
nop dword [rax + rax]
lea rax, [rax + 1]
cmp word [rdx + rax*2], 0
jne 0x1400401f0
lea r8d, [rax*2 + 2]
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x60]
lea rdx, [rbp - 0x10]
mov rcx, qword [rcx + 0x70]
call qword [sym.imp.KERNEL32.dll_WriteFile]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
or ebx, 0xe0ff0000
jmp 0x1400403ad
lea rax, [rsp + 0x68]
mov qword [rsp + 0x60], rax
lea r8, [rsp + 0x60]
lea rcx, [rbp - 0x38]
call fcn.14003a9c0
nop
xor eax, eax
mov qword [rsp + 0x78], rax
mov qword [rbp - 0x80], rax
mov qword [rbp - 0x78], rax
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], rax
mov dword [rsp + 0x7c], 2
mov dword [rsp + 0x78], 0x35
mov dword [rbp - 0x80], esi
mov dword [rbp - 0x6c], esi
mov dword [rbp - 0x68], 5
mov rax, qword [rsp + 0x68]
mov qword [rbp - 0x60], rax
lea r9, [rsp + 0x70]
mov r8, qword [rbp - 0x50]
lea rdx, [rsp + 0x78]
mov ecx, 1
call qword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
mov ebx, eax
test eax, eax
je 0x1400402f5
mov ecx, 0x88d30cf7
call fcn.14001a490
mov edx, 0x5017
movzx ecx, word [rax]
xor cx, dx
mov word [rbp - 0x10], cx
movzx ecx, word [rax + 2]
xor cx, dx
mov word [rbp - 0xe], cx
movzx ecx, word [rax + 4]
xor cx, dx
mov word [rbp - 0xc], cx
movzx eax, word [rax + 6]
xor ax, dx
mov word [rbp - 0xa], ax
mov word [rbp - 8], si
lea rcx, [rbp - 0x10]
call fcn.14003ade0
or ebx, 0xe0ff0000
jmp 0x14004039d
lea rax, [rsp + 0x70]
mov qword [rsp + 0x60], rax
lea r8, [rsp + 0x60]
lea rcx, [rbp - 0x48]
call fcn.14003a9c0
nop
mov qword [rsp + 0x30], rsi
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rsi
xor r9d, r9d
lea edx, [r9 + 2]
lea r8d, [r9 + 4]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_SetSecurityInfo]
mov ebx, eax
test eax, eax
je 0x14004038b
mov ecx, 0x7fdae4b0
call fcn.14001a490
mov edx, 0x5017
movzx ecx, word [rax]
xor cx, dx
mov word [rbp - 0x10], cx
movzx ecx, word [rax + 2]
xor cx, dx
mov word [rbp - 0xe], cx
movzx ecx, word [rax + 4]
xor cx, dx
mov word [rbp - 0xc], cx
movzx eax, word [rax + 6]
xor ax, dx
mov word [rbp - 0xa], ax
mov word [rbp - 8], si
lea rcx, [rbp - 0x10]
call fcn.14003ade0
or ebx, 0xe0ff0000
jmp 0x14004038d
mov ebx, esi
cmp byte [rbp - 0x48], 0
jne 0x14004039d
lea rcx, [rbp - 0x48]
call fcn.140041690
nop
cmp byte [rbp - 0x38], 0
jne 0x1400403ad
lea rcx, [rbp - 0x38]
call fcn.14003c370
nop
cmp byte [rbp - 0x28], 0
jne 0x1400403bc
lea rcx, [rbp - 0x28]
call fcn.140041690
mov eax, ebx
mov rcx, qword [rbp + 8]
xor rcx, rsp
call fcn.140051aa0
lea r11, [rsp + 0x110]
mov rbx, qword [r11 + 0x18]
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret