Function at 0x407fe7
Capabilities:
Create service
Modify service
Persist via run registry key
Set registry value

Disassembly:
sub esp, 0x50c
push ebx
push esi
mov esi, ecx
call fcn.00409390
lea eax, [esp + 0x114]
push 0x3ff
xor ebx, ebx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x408038
lea ecx, [esp + 0x14]
push pe_nt_image_headers32
push ecx
mov ecx, esi
call fcn.00408f00
mov edx, dword [esi + 8]
push eax
push edx
push str.Unable_to_install__s____s_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 0xc
xor eax, eax
pop esi
pop ebx
add esp, 0x50c
ret
mov eax, dword [esi + 0x48]
push ebp
cmp eax, ebx
push edi
mov dword [esp + 0x10], ebx
jne 0x4080b3
mov ecx, dword [str.SoftwareMicrosoftWindowsCurrentVersionRunServices]
lea eax, [esp + 0x14]
push eax
push ecx
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x20], ebx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
test eax, eax
jne 0x4081b0
lea edi, [esp + 0x11c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, dword [esi + 4]
lea edx, [esp + 0x11c]
not ecx
push ecx
mov ecx, dword [esp + 0x18]
push edx
push 2
push ebx
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
mov dword [esp + 0xc], 1
mov eax, dword [esp + 0xc]
pop ebp
pop esi
pop ebx
add esp, 0x50c
ret
push 0xf003f
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebp, eax
cmp ebp, ebx
je 0x4081bf
mov ecx, dword [esi + 0x54]
cmp ecx, 1
je 0x4080d7
cmp ecx, 2
jne 0x4080e3
mov eax, dword [esi + 0x58]
cmp eax, ebx
je 0x4080e7
cmp eax, 1
je 0x4080e7
xor eax, eax
jmp 0x4080ea
lea eax, [esi + 0x64]
mov edx, dword [esi + 0x70]
push edx
mov edx, dword [esi + 0x6c]
push edx
mov edx, dword [esi + 0x68]
push edx
push eax
mov eax, dword [esi + 0x60]
lea edx, [esp + 0x12c]
push eax
mov eax, dword [esi + 0x5c]
push edx
mov edx, dword [esi + 0x58]
push eax
mov eax, dword [esi + 0x50]
push edx
mov edx, dword [esi + 4]
push ecx
mov ecx, dword [esi + 8]
push eax
push ecx
push edx
push ebp
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov edi, eax
cmp edi, ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
je 0x408164
mov eax, dword [0x431498]
lea edx, [esp + 0x18]
push edx
push 1
mov ecx, dword [eax + 0xc]
push edi
mov dword [esp + 0x24], ecx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
mov eax, dword [esi + 8]
push eax
push str._s_installed._n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 8
push edi
call ebx
mov dword [esp + 0x10], 1
jmp 0x408184
lea ecx, [esp + 0x1c]
push pe_nt_image_headers32
push ecx
mov ecx, esi
call fcn.00408f00
push eax
push str.CreateService_failed____s_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 8
push ebp
call ebx
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4081b0
mov eax, dword [esi]
lea ecx, [esp + 0x11c]
push 7
push ecx
mov ecx, esi
call dword [eax + 0x54]
mov edx, dword [esi]
push 0xffffffffffffffff
push 4
push str.Service_installed
mov ecx, esi
call dword [edx + 0x5c]
mov eax, dword [esp + 0x10]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x50c
ret
lea edx, [esp + 0x1c]
push pe_nt_image_headers32
push edx
mov ecx, esi
call fcn.00408f00
push eax
push str.OpenSCManager_failed____s_n
call dword [sym.imp.MSVCRT.dll_printf]
mov eax, dword [esp + 0x18]
add esp, 8
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x50c
ret