Function at 0x409720
Capabilities:
Create service
Modify service
Persist via windows service

Disassembly:
sub esp, 0x494
push ebp
push esi
push edi
lea eax, [esp + 0x20]
push 0x200
push eax
push 0
mov dword [esp + 0x24], 0x80
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edi, [esp + 0x20]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1a0]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x20
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x24]
push ecx
call fcn.00438b90
add esp, 8
test eax, eax
jne 0x409795
lea edx, [esp + 0x20]
push 9
push edx
call fcn.00438b90
add esp, 8
test eax, eax
je 0x409817
call fcn.0040cf60
cmp eax, 4
lea edi, [esp + 0x20]
jb 0x4097e6
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x3a0]
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x1a0]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x3a0]
push ecx
push str.__s_
push edx
call fcn.004380cf
add esp, 0xc
jmp 0x409817
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea edi, [esp + 0x21]
lea edx, [esp + 0x20]
mov byte [esp + ecx + 0x1f], al
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebp, eax
test ebp, ebp
jne 0x40983b
pop edi
pop esi
mov eax, 1
pop ebp
add esp, 0x494
ret
push 0
push 0
push 0
push 0
lea ecx, [esp + 0x1b0]
push 0
push ecx
push 1
push 2
push 0x10
push 0xf01ff
push str.Sentinel_Keys_Server
push str.SentinelKeysServer
push ebp
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov esi, eax
test esi, esi
jne 0x409885
push ebp
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop edi
pop esi
mov eax, 1
pop ebp
add esp, 0x494
ret
lea edx, [esp + 0x10]
mov dword [esp + 0x10], str.Manages_Sentinel_keys_attached_to_this_computer
push edx
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
push str.SentinelKeysServer
lea eax, [esp + 0x2a4]
push str.SystemCurrentControlSetServicesEventLogApplication_s
push eax
call fcn.004380cf
add esp, 0xc
lea ecx, [esp + 0xc]
lea edx, [esp + 0x2a0]
push ecx
push 0xf003f
push 0
push edx
push reloc.WSOCK32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x409902
lea eax, [esp + 0x1c]
lea ecx, [esp + 0xc]
push eax
push ecx
push 0
push 0xf003f
push 0
push 0
lea edx, [esp + 0x2b8]
push 0
push edx
push reloc.WSOCK32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
mov edx, dword [esp + 0xc]
test edx, edx
je 0x4099a1
lea edi, [esp + 0x20]
or ecx, 0xffffffff
xor eax, eax
push ebx
repne scasb al, byte es:[edi]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
lea eax, [esp + 0x24]
not ecx
push ecx
push eax
push 1
push 0
push str.EventMessageFile
push edx
call ebx
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x18]
push 4
push ecx
push 4
push 0
push str.TypesSupported
push edx
mov dword [esp + 0x30], 7
call ebx
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x124]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
cmp eax, 1
jne 0x409993
lea edi, [esp + 0x124]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x124]
repne scasb al, byte es:[edi]
not ecx
push ecx
push edx
push 1
push eax
mov eax, dword [esp + 0x20]
push str.UserLogin
push eax
call ebx
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebx
jmp 0x4099ae
push str._n_Sentinel_Keys_Server_unable_to_do_event_logging___
call fcn.004398c8
add esp, 4
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebp
call esi
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x494
ret