Function at 0x140040dd0
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push r14
push r15
lea rbp, [rax - 0x5f]
sub rsp, 0xf0
mov qword [rbp - 0x39], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov rax, qword [0x14009e018]
xor rax, rsp
mov qword [rbp + 0x3f], rax
mov r15d, 1
mov r8d, r15d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov qword [rbp - 0x61], rax
test rax, rax
jne 0x140040eb0
mov ecx, 0xa53c96e6
call fcn.14001a490
mov edx, 0x5017
movzx ecx, word [rax]
xor cx, dx
mov word [rbp - 0x31], cx
movzx ecx, word [rax + 2]
xor cx, dx
mov word [rbp - 0x2f], cx
movzx ecx, word [rax + 4]
xor cx, dx
mov word [rbp - 0x2d], cx
movzx eax, word [rax + 6]
xor ax, dx
mov word [rbp - 0x2b], ax
xor esi, esi
mov word [rbp - 0x29], si
mov rcx, qword [0x1400a34c0]
test rcx, rcx
je 0x140040ea9
lea rdx, [rbp - 0x31]
or rax, 0xffffffffffffffff
nop dword [rax]
lea rax, [rax + 1]
cmp word [rdx + rax*2], si
jne 0x140040e80
lea r8d, [rax*2 + 2]
mov qword [rsp + 0x20], rsi
lea r9, [rbp - 0x79]
lea rdx, [rbp - 0x31]
mov rcx, qword [rcx + 0x70]
call qword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
jmp 0x1400411fd
lea rax, [rbp - 0x61]
mov qword [rbp - 0x79], rax
lea r8, [rbp - 0x79]
lea rcx, [rbp - 0x49]
call fcn.14003a9c0
nop
mov rdx, qword [0x1400a34c0]
add rdx, 0x10
cmp qword [rdx + 0x18], 8
jb 0x140040edb
mov rdx, qword [rdx]
mov r8d, 5
mov rcx, qword [rbp - 0x61]
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov qword [rbp - 0x69], rax
test rax, rax
jne 0x140040f81
mov ecx, 0x450f883e
call fcn.14001a490
mov edx, 0x5017
movzx ecx, word [rax]
xor cx, dx
mov word [rbp - 0x31], cx
movzx ecx, word [rax + 2]
xor cx, dx
mov word [rbp - 0x2f], cx
movzx ecx, word [rax + 4]
xor cx, dx
mov word [rbp - 0x2d], cx
movzx eax, word [rax + 6]
xor ax, dx
mov word [rbp - 0x2b], ax
xor esi, esi
mov word [rbp - 0x29], si
mov rcx, qword [0x1400a34c0]
test rcx, rcx
je 0x140040f79
lea rdx, [rbp - 0x31]
or rax, 0xffffffffffffffff
nop dword [rax]
lea rax, [rax + 1]
cmp word [rdx + rax*2], si
jne 0x140040f50
lea r8d, [rax*2 + 2]
mov qword [rsp + 0x20], rsi
lea r9, [rbp - 0x79]
lea rdx, [rbp - 0x31]
mov rcx, qword [rcx + 0x70]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov r15d, esi
jmp 0x1400411eb
lea rax, [rbp - 0x69]
mov qword [rbp - 0x79], rax
lea r8, [rbp - 0x79]
lea rcx, [rbp - 0x59]
call fcn.14003a9c0
nop
xor esi, esi
mov ebx, esi
mov qword [rbp - 0x79], rbx
lea r9, [rbp - 0x71]
xor r8d, r8d
xor edx, edx
mov rcx, qword [rbp - 0x69]
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x140041067
nop word [rax + rax]
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x140041018
mov r14d, dword [rbp - 0x71]
mov edx, r14d
mov rcx, rbx
call fcn.140059130
mov rdi, rax
test rax, rax
je 0x140041011
mov rcx, rbx
mov rbx, rax
mov qword [rbp - 0x79], rax
test rcx, rcx
je 0x140040ff7
call fcn.140055a68
nop
lea r9, [rbp - 0x71]
mov r8d, r14d
mov rdx, rdi
mov rcx, qword [rbp - 0x69]
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
je 0x140040fc0
jmp 0x140041067
mov ecx, 0x9aac42bc
jmp 0x14004101d
mov ecx, 0x82ae0a8
call fcn.14001a490
mov edx, 0x5017
movzx ecx, word [rax]
xor cx, dx
mov word [rbp - 0x31], cx
movzx ecx, word [rax + 2]
xor cx, dx
mov word [rbp - 0x2f], cx
movzx ecx, word [rax + 4]
xor cx, dx
mov word [rbp - 0x2d], cx
movzx eax, word [rax + 6]
lea rcx, [rbp - 1]
call fcn.14003fee0
nop
mov qword [rbp - 9], 7
mov qword [rbp - 0x11], rsi
mov word [rbp - 0x21], si
lea r8, [rbp - 1]
cmp qword [rbp + 0x17], 8
cmovae r8, qword [rbp - 1]
lea rdx, str.__ls_
lea rcx, [rbp - 0x21]
call fcn.140041cd0
cmp dword [rbx], 0x110
jne 0x140041137
cmp dword [rbx + 4], 3
jne 0x140041137
cmp dword [rbx + 8], 1
jne 0x140041137
lea rdx, [rbp - 0x21]
cmp qword [rbp - 9], 8
cmovae rdx, qword [rbp - 0x21]
mov rcx, qword [rbx + 0x10]
call fcn.140055d34
test eax, eax
jne 0x140041137
lea rdx, str.LocalSystem
mov rcx, qword [rbx + 0x30]
call fcn.140055d34
test eax, eax
jne 0x140041137
lea rcx, [rbp + 0x1f]
call fcn.14003fe40
nop
lea rdx, [rbp - 1]
cmp qword [rbp + 0x17], 8
cmovae rdx, qword [rbp - 1]
cmp qword [rax + 0x18], 8
jb 0x14004110c
mov rax, qword [rax]
mov rcx, rax
call fcn.140040b30
test eax, eax
sete dil
mov r8, qword [rbp + 0x37]
cmp r8, 8
jb 0x140041130
inc r8
mov rdx, qword [rbp + 0x1f]
call fcn.140019be0
test dil, dil
jne 0x14004117e
jmp 0x140041181
mov ecx, 0x237051cc
call fcn.14001a490
mov edx, 0x5017
movzx ecx, word [rax]
xor cx, dx
mov word [rbp - 0x31], cx
movzx ecx, word [rax + 2]
xor cx, dx
mov word [rbp - 0x2f], cx
movzx ecx, word [rax + 4]
xor cx, dx
mov word [rbp - 0x2d], cx
movzx eax, word [rax + 6]
xor ax, dx
mov word [rbp - 0x2b], ax
mov word [rbp - 0x29], si
lea rcx, [rbp - 0x31]
call fcn.14003ade0
mov r15d, esi
mov r8, qword [rbp - 9]
cmp r8, 8
jb 0x140041197
inc r8
mov rdx, qword [rbp - 0x21]
call fcn.140019be0
mov qword [rbp - 9], 7
mov qword [rbp - 0x11], rsi
mov word [rbp - 0x21], si
mov r8, qword [rbp + 0x17]
cmp r8, 8
jb 0x1400411bd
inc r8
mov rdx, qword [rbp - 1]
call fcn.140019be0
mov qword [rbp + 0x17], 7
mov qword [rbp + 0xf], rsi
mov word [rbp - 1], si