Function at 0x409260
Capabilities:
Create service
Get session user name
Persist via windows service
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5799fe
mov eax, dword fs:[0]
push eax
sub esp, 0x8b4
mov eax, dword [0x5d7ce0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x296]
mov dword [ebp - 4], 0
push ecx
xor esi, esi
mov word [ebp - 0x298], ax
call fcn.00550f40
add esp, 0xc
push 0x104
lea edx, [ebp - 0x298]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0xf003f
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
je 0x40956d
push esi
push esi
push esi
push esi
push esi
lea eax, [ebp - 0x298]
push eax
push 1
push 2
push 0x110
push 0xf01ff
push 0x5ab3a4
push 0x5ab3a4
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
test eax, eax
je 0x409552
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x49e]
push edx
mov dword [ebp - 0x8bc], esi
mov word [ebp - 0x4a0], cx
call fcn.00550f40
xor eax, eax
push 0x40e
push eax
lea ecx, [ebp - 0x8ae]
push ecx
mov word [ebp - 0x8b0], ax
call fcn.00550f40
push 0x5ab3a4
lea edx, [ebp - 0x4a0]
push str.SYSTEMCurrentControlSet_services_s
push edx
call fcn.0054e46c
add esp, 0x24
lea eax, [ebp - 0x8bc]
push eax
push 0x20006
push esi
lea ecx, [ebp - 0x4a0]
push ecx
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x409564
xor edx, edx
push 0x7e
push edx
lea eax, [ebp - 0x8e]
push eax
mov word [ebp - 0x90], dx
call fcn.00550f40
add esp, 0xc
lea ecx, [ebp - 0x8c0]
push ecx
lea edx, [ebp - 0x90]
push edx
mov dword [ebp - 0x8c0], 0x40
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
je 0x409564
push 0x5ab424
lea ecx, [ebp - 0x8b8]
call fcn.004079b0
mov byte [ebp - 4], 1
cmp dword [0x5e0bd0], esi
je 0x409410
mov eax, dword [0x5e0bd8]
push eax
push 0x5aafe4
lea ecx, [ebp - 0x8b8]
push 0x5ab428
push ecx
call fcn.00409220
add esp, 0x10
push 0x5ab424
lea ecx, [ebp - 0x8b4]
call fcn.004079b0
mov byte [ebp - 4], 2
cmp dword [0x5e0bf8], 0
je 0x40944d
mov edx, dword [0x5e0bfc]
push edx
push str._mod
lea eax, [ebp - 0x8b4]
push 0x5ab428
push eax
call fcn.00409220
add esp, 0x10
cmp dword [0x5e0bc4], 0
mov ecx, 0x5ab004
jne 0x409460
mov ecx, 0x5ab424
cmp dword [ebp + 0xc], 0
mov eax, 0x5ab014
jne 0x409470
mov eax, 0x5ab424
mov edx, dword [ebp - 0x8b4]
push 0x5aafec
push 0x5ab00c
push edx
mov edx, dword [ebp - 0x8b8]
push edx
push ecx
mov ecx, dword [ebp + 8]
push eax
lea eax, [ebp - 0x90]
push eax
push 0x5aafdc
push ecx
push 0x5aaff4
lea edx, [ebp - 0x298]
push edx
lea eax, [ebp - 0x8b0]
push str.__s___s___s___s___s___s__s__s__s__s__s
push eax
call fcn.0054e46c
lea eax, [ebp - 0x8b0]
add esp, 0x34
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4094c3
sub eax, edx
mov edx, dword [ebp - 0x8bc]
sar eax, 1
lea eax, [eax + eax + 2]
push eax
lea ecx, [ebp - 0x8b0]
push ecx
push 2
push 0
push str.ImagePath
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
xor ecx, ecx
test eax, eax
sete cl
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x8b4]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov esi, ecx
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x409523
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x8b8]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x409564
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40956f
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
cmp eax, 0x431
sete cl
mov esi, ecx
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40956f
xor esi, esi
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x409595
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0054bd91
mov esp, ebp
pop ebp
ret