Function at 0x405c80
Capabilities:
Query environment variable
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
sub esp, 0x330
push ebx
push ebp
push esi
push edi
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CString::CString_2
mov esi, 0x100
xor ebp, ebp
lea ecx, [esp + 0x10]
mov dword [esp + 0x38], esi
mov dword [esp + 0x34], esi
mov dword [esp + 0x2c], ebp
call sub.MFC42.DLL_CString::CString_2
lea eax, [esp + 0x10]
push str.7__
push eax
call sub.MFC42.DLL_CString::Format
add esp, 8
lea ecx, [esp + 0x10]
push 1
push ebp
call sub.MFC42.DLL_CString::GetBuffer
push eax
call fcn.00401240
mov eax, dword [0x4277a8]
add esp, 8
cmp eax, ebp
je 0x405d14
lea ecx, [esp + 0x10]
push 0x411b34
push ecx
call sub.MFC42.DLL_CString::Format
add esp, 8
push 1
push ebp
jmp 0x405feb
push str.SystemRoot
call dword [sym.imp.MSVCRT.dll_getenv]
add esp, 4
lea ecx, [esp + 0x20]
push eax
call sub.MFC42.DLL_CString::operator
mov edx, dword [esp + 0x20]
cmp dword [edx - 8], ebp
jne 0x405d96
lea eax, [esp + 0x10]
push 0x411304
push eax
call sub.MFC42.DLL_CString::Format
add esp, 8
lea ecx, [esp + 0x10]
push 6
push ebp
call sub.MFC42.DLL_CString::GetBuffer
push eax
call fcn.00401240
add esp, 8
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::CString
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x330
ret
push str.SYSTEMCurrentControlSetServices
lea ecx, [esp + 0x18]
mov edi, 1
call sub.MFC42.DLL_CString::operator
lea ecx, [esp + 0x30]
push ecx
push 0xf003f
push ebp
push ebp
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::GetBuffer
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405fc5
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov eax, dword [esp + 0x30]
lea edx, [esp + 0x40]
push esi
push edx
push ebp
push eax
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyA]
cmp eax, 0x103
je 0x405fba
push str.SYSTEMCurrentControlSetServices_
lea ecx, [esp + 0x18]
inc ebp
call sub.MFC42.DLL_CString::operator
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x18]
call fcn.0040c9dc
lea edx, [esp + 0x28]
lea ecx, [esp + 0x14]
push edx
push 0xf003f
push 0
push 0
call sub.MFC42.DLL_CString::GetBuffer
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405dd8
lea eax, [esp + 0x38]
lea ecx, [esp + 0x140]
push eax
mov eax, dword [esp + 0x2c]
lea edx, [esp + 0x30]
push ecx
push edx
push 0
push str.Start
push eax
mov dword [esp + 0x50], esi
call ebx
test eax, eax
jne 0x405fa5
cmp dword [esp + 0x2c], 4
jne 0x405fa5
mov esi, dword [esp + 0x140]
cmp esi, 3
ja 0x405fa5
lea ecx, [esp + 0x34]
lea edx, [esp + 0x240]
push ecx
mov ecx, dword [esp + 0x2c]
lea eax, [esp + 0x30]
push edx
push eax
push 0
push str.ImagePath
push ecx
mov dword [esp + 0x4c], 0x100
call ebx
test eax, eax
jne 0x405fa5
lea edx, [esp + 0x240]
lea ecx, [esp + 0x1c]
push edx
call sub.MFC42.DLL_CString::operator
push ecx
lea eax, [esp + 0x20]
mov ecx, esp
mov dword [esp + 0x40], esp
push eax
call fcn.0040c9c4
call fcn.00402ee0
add esp, 4
test eax, eax
jne 0x405fa5
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString_2
test esi, esi
jne 0x405ef6
push str.SERVICE_BOOT_START
jmp 0x405f1f
cmp esi, 1
jne 0x405f02
push str.SERVICE_SYSTEM_START
jmp 0x405f1f
cmp esi, 2
jne 0x405f0e
push 0x411aa4
jmp 0x405f1f
cmp esi, 3
jne 0x405f1a
push 0x411a9c
jmp 0x405f1f
push 0x411a94
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::operator
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::MakeUpper
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
push ecx
lea eax, [esp + 0x44]
push edx
push eax
lea ecx, [esp + 0x1c]
push 0x411a70
push ecx
call sub.MFC42.DLL_CString::Format
add esp, 0x14
lea ecx, [esp + 0x10]
push 4
push 0
call sub.MFC42.DLL_CString::GetBuffer
push eax
call fcn.00401240
mov eax, dword [esp + 0x34c]
add esp, 8
xor edi, edi
test eax, eax
je 0x405f9c
lea edx, [esp + 0x10]
push 0x4118b0
push edx
call sub.MFC42.DLL_CString::Format
add esp, 8
lea ecx, [esp + 0x10]
push 4
push edi
call sub.MFC42.DLL_CString::GetBuffer
push eax
call fcn.00401240
add esp, 8
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::CString
mov eax, dword [esp + 0x28]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, 0x100
jmp 0x405dd8
mov ecx, dword [esp + 0x30]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test edi, edi
je 0x405fd5
lea edx, [esp + 0x10]
push 0x411b34
push edx
jmp 0x405fdf
lea eax, [esp + 0x10]
push 0x411a50
push eax
call sub.MFC42.DLL_CString::Format
add esp, 8
push 1
push 0
lea ecx, [esp + 0x18]
call sub.MFC42.DLL_CString::GetBuffer
push eax
call fcn.00401240
add esp, 8
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x20]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x14]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x24]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x1c]
call sub.MFC42.DLL_CString::CString
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x330
ret