Function at 0x406b41
Capabilities:
Delete registry key
Delete service
Persist via windows service
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x334
push ebx
push esi
mov dword [ebp - 0x1c], ecx
push edi
xor ebx, ebx
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x333]
mov byte [ebp - 0x334], bl
push 0x40
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x12b]
mov byte [ebp - 0x12c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x334]
mov ecx, dword [ebp - 0x1c]
push ebx
push eax
lea eax, [ebp - 0x12c]
xor esi, esi
push eax
mov dword [ebp - 0x20], ebx
push dword [ebp + 8]
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 4], ebx
call fcn.00406d91
lea eax, [ebp - 0x12c]
push eax
call sub.MSVCRT.dll_strlen
test eax, eax
pop ecx
je 0x406d23
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea eax, [ebp - 0xc]
push eax
push 0xf003f
push ebx
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionSvcHost
push closesocket
call esi
test eax, eax
jne 0x406cc4
lea eax, [ebp - 4]
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push eax
lea eax, [ebp - 0x18]
push ebx
push eax
lea eax, [ebp - 0x12c]
push ebx
push eax
push dword [ebp - 0xc]
call edi
test eax, eax
jne 0x406cbb
push dword [ebp - 4]
call sub.MFC42.DLL_operatornew
push dword [ebp - 4]
mov dword [ebp - 8], eax
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0x10
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x18]
push dword [ebp - 8]
push eax
lea eax, [ebp - 0x12c]
push ebx
push eax
push dword [ebp - 0xc]
call edi
mov edi, dword [ebp - 8]
push edi
call sub.MSVCRT.dll_strlen
test eax, eax
pop ecx
je 0x406cbb
push dword [ebp + 8]
push edi
call dword [sym.imp.MSVCRT.dll__mbscmp]
pop ecx
pop ecx
test eax, eax
push edi
je 0x406c72
call sub.MSVCRT.dll_strlen
lea edi, [edi + eax + 1]
push edi
call sub.MSVCRT.dll_strlen
pop ecx
jmp 0x406c4a
call sub.MSVCRT.dll_strlen
pop ecx
or ecx, 0xffffffff
sub ecx, eax
mov eax, dword [ebp - 4]
add eax, ecx
mov dword [ebp - 4], eax
sub eax, edi
add eax, dword [ebp - 8]
push eax
push edi
call sub.MSVCRT.dll_strlen
pop ecx
lea eax, [eax + edi + 1]
push eax
push edi
call dword [sym.imp.MSVCRT.dll_memmove]
add esp, 0xc
lea eax, [ebp - 0x12c]
push dword [ebp - 4]
push dword [ebp - 8]
push dword [ebp - 0x18]
push ebx
push eax
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push dword [ebp + 8]
call sub.MSVCRT.dll_strlen
add eax, 0x104
push eax
call sub.MFC42.DLL_operatornew
pop ecx
mov edi, eax
pop ecx
push dword [ebp + 8]
push str.SYSTEMCurrentControlSetServices_s
push edi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x14]
push eax
push 0xf003f
push ebx
push edi
push closesocket
call esi
mov esi, eax
cmp esi, ebx
jne 0x406d1c
push str.Parameters
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
call sub.MFC42.DLL_operatordelete
pop ecx
cmp dword [ebp + 0x10], ebx
jne 0x406d88
push dword [ebp + 0xc]
lea eax, [ebp - 0x28]
mov ecx, dword [ebp - 0x1c]
push dword [ebp + 8]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x24]
push eax
call fcn.00406faf
mov esi, eax
cmp esi, ebx
jne 0x406d70
cmp dword [ebp - 0x10], ebx
je 0x406d70
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x406d70
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp esi, 0x430
jne 0x406d70
xor esi, esi
lea eax, [ebp - 0x28]
mov ecx, dword [ebp - 0x1c]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x24]
push eax
call fcn.00407067
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret 0xc