Function at 0x401440
Capabilities:
Check for peb beingdebugged flag
Get process heap flags
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov ebx, dword [ebp + 8]
test byte [section..data], 8
jne 0x402138
cmp ebx, 1
jle 0x40151f
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x3c], 1
add eax, 4
mov dword [ebp - 0x40], eax
lea eax, [ebx - 2]
sub ebx, 1
and eax, 0xfffffffe
or ebx, 1
add eax, 3
mov dword [ebp - 0x50], ebx
mov dword [ebp - 0x54], eax
lea esi, [esi]
nop
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], 0x404408
mov eax, dword [eax]
mov dword [esp], eax
call sub.kernel32.dll_lstrcmpiW
sub esp, 8
test eax, eax
jne 0x401bc8
movzx eax, byte [section..data]
mov edi, dword [ebp - 0x3c]
cmp dword [ebp - 0x50], edi
je 0x4021b0
mov edi, dword [ebp - 0x40]
mov dword [ebp - 0x24], 0
lea ecx, [edi + 4]
mov ebx, dword [edi + 4]
mov dword [ebp - 0x58], ecx
test al, 8
jne 0x401c60
lea eax, [ebp - 0x24]
mov dword [esp + 0xc], 0x20019
mov dword [esp + 0x10], eax
mov dword [esp + 8], 0
mov dword [esp + 4], str.SoftwareMicrosoftWindows_NTCurrentVersionSvchost
mov dword [esp], 0x80000002
call sub.advapi32.dll_RegOpenKeyExW
sub esp, 0x14
mov esi, eax
test eax, eax
je 0x401530
test byte [section..data], 2
jne 0x401d28
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x24]
mov edx, ebx
call fcn.00401090
mov dword [ebp - 0x4c], eax
mov edi, eax
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call sub.advapi32.dll_RegCloseKey
sub esp, 4
test edi, edi
je 0x401f50
xor ecx, ecx
cmp word [edi], 0
mov edx, edi
mov ebx, 8
je 0x40158c
lea esi, [esi]
mov ebx, ecx
mov eax, edx
add ecx, 1
nop
mov edx, eax
add eax, 2
cmp word [eax], 0
jne 0x401570
add edx, 4
cmp word [eax + 2], 0
jne 0x401568
lea ebx, [ebx*8 + 0x10]
test byte [section..data], 8
jne 0x402030
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapAlloc
mov edi, dword [ebp - 0x4c]
sub esp, 0xc
mov dword [ebp - 0x44], eax
cmp word [edi], 0
je 0x4021e8
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x2c], edi
lea esi, [esi]
lea esi, [esi]
mov dword [ebp - 0x20], 0
test byte [section..data], 8
jne 0x401a80
mov eax, 0x79
mov esi, str.SystemCurrentControlSetServices
jmp 0x401604
movzx eax, word [esi + 2]
add esi, 2
test ax, ax
jne 0x401600
sub esi, str.SystemCurrentControlSetServices
mov eax, dword [ebp - 0x2c]
sar esi, 1
add esi, 1
cmp word [eax], 0
je 0x401630
add eax, 2
cmp word [eax], 0
jne 0x401620
sub eax, dword [ebp - 0x2c]
sar eax, 1
add esi, eax
lea eax, [esi + 1]
mov edx, 0x61
mov esi, str.Parameters
jmp 0x401644
movzx edx, word [esi + 2]
add esi, 2
test dx, dx
jne 0x401640
sub esi, str.Parameters
mov dword [esp + 4], 0
sar esi, 1
add esi, eax
lea edx, [esi + esi + 2]
mov dword [esp + 8], edx
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapAlloc
mov edx, 0x53
mov ebx, eax
sub esp, 0xc
xor eax, eax
jmp 0x401697
movzx edx, word [eax + str.SystemCurrentControlSetServices]
mov word [ebx + eax], dx
add eax, 2
test dx, dx
jne 0x401690
cmp word [ebx], 0
mov eax, ebx
je 0x4016b9
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x4016b0
xor edx, edx
mov ecx, 0x5c
jmp 0x4016cf
movzx ecx, word [edx + 0x404404]
mov word [eax + edx], cx
add edx, 2
test cx, cx
jne 0x4016c8
cmp word [ebx], 0
mov eax, ebx
je 0x4016f1
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x4016e8
xor edx, edx
lea esi, [esi]
nop
mov edi, dword [ebp - 0x2c]
movzx ecx, word [edi + edx]
mov word [eax + edx], cx
add edx, 2
test cx, cx
jne 0x4016f8
cmp word [ebx], 0
mov eax, ebx
je 0x401721
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x401718
xor edx, edx
mov ecx, 0x5c
jmp 0x401737
movzx ecx, word [edx + 0x404404]
mov word [eax + edx], cx
add edx, 2
test cx, cx
jne 0x401730
cmp word [ebx], 0
mov eax, ebx
je 0x401759
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x401750
xor edx, edx
mov ecx, 0x50
jmp 0x40176f
movzx ecx, word [edx + str.Parameters]
mov word [eax + edx], cx
add edx, 2
test cx, cx
jne 0x401768
xor ecx, ecx
lea eax, [ebp - 0x20]
mov word [ebx + esi*2], cx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x20019
mov dword [esp + 8], 0
mov dword [esp + 4], ebx
mov dword [esp], 0x80000002
call sub.advapi32.dll_RegOpenKeyExW
mov dword [ebp - 0x38], eax
sub esp, 0x14
test eax, eax
je 0x4018a0
test byte [section..data], 2
jne 0x401ab8
mov dword [ebp - 0x38], 0
xor esi, esi
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov edi, dword fs:[0x18]
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
mov eax, dword [ebp - 0x30]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
mov eax, dword [ebp - 0x34]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
sub esp, 0xc
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
mov eax, dword [ebp - 0x38]
sub esp, 0xc
test eax, eax
je 0x401da8
mov eax, dword [ebp - 0x2c]
add dword [ebp - 0x48], 1
cmp word [eax], 0
je 0x401884
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x401878
mov dword [ebp - 0x2c], eax
mov edi, dword [ebp - 0x2c]
cmp word [edi + 2], 0
lea eax, [edi + 2]
je 0x401e20
mov dword [ebp - 0x2c], eax
jmp 0x4015e0
mov eax, dword [ebp - 0x20]
mov edx, str.ServiceDll
call fcn.00401090
mov dword [ebp - 0x30], eax
test eax, eax
je 0x401b10
test byte [section..data], 8
jne 0x401c30
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.kernel32.dll_ExpandEnvironmentStringsW
sub esp, 0xc
mov edi, eax
test eax, eax
je 0x401c98
lea eax, [eax + eax + 2]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov esi, dword fs:[0x18]
mov eax, dword [esi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapAlloc
sub esp, 0xc
mov dword [ebp - 0x34], eax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], edi
mov dword [esp], eax
call sub.kernel32.dll_ExpandEnvironmentStringsW
sub esp, 0xc
test eax, eax
je 0x401ff0
mov edx, dword [ebp - 0x34]
test edx, edx
je 0x401ce2
mov eax, dword [ebp - 0x20]
lea edi, [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], str.ServiceMain
mov dword [esp], eax
call sub.advapi32.dll_RegQueryValueExA
sub esp, 0x18
test eax, eax
jne 0x401b40
mov edx, dword [ebp - 0x1c]
mov dword [esp + 4], 0
lea eax, [edx + 1]
mov dword [ebp - 0x5c], edx
mov dword [esp + 8], eax
mov eax, dword [esi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapAlloc
sub esp, 0xc
mov esi, eax
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], str.ServiceMain
mov dword [esp], eax
call sub.advapi32.dll_RegQueryValueExA
mov edx, dword [ebp - 0x5c]
sub esp, 0x18
test eax, eax
jne 0x402098
mov byte [esi + edx], 0
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sub.advapi32.dll_RegCloseKey
mov eax, dword [ebp - 0x34]
sub esp, 4
mov dword [esp + 8], 8
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.kernel32.dll_LoadLibraryExW
sub esp, 0xc
test eax, eax
je 0x401b76
test esi, esi
je 0x401f25
mov dword [esp + 4], esi
mov dword [esp], eax
mov dword [ebp - 0x5c], eax
call sub.kernel32.dll_GetProcAddress
mov edx, dword [ebp - 0x5c]
sub esp, 8
mov edi, eax
test edi, edi
je 0x401e00
mov dword [esp + 4], str.SvchostPushServiceGlobals
mov dword [esp], edx
call sub.kernel32.dll_GetProcAddress
sub esp, 8
test eax, eax
je 0x401a62
test byte [section..data], 1
jne 0x402060
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x48]
mov dword [ebp - 0x38], 1
mov edx, dword [ebp - 0x2c]
mov dword [eax + ecx*8 + 4], edi
mov dword [eax + ecx*8], edx
jmp 0x4017da
mov eax, dword [ebp - 0x2c]
call fcn.00401220
mov dword [esp + 0xc], str.Adding_element_for__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.AddServiceElem
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call section..text
jmp 0x4015f4
mov eax, ebx
xor esi, esi
call fcn.00401220
mov edi, dword [ebp - 0x38]
mov dword [esp + 0xc], str.cannot_open_key__s__err_d_n
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edi
mov dword [esp + 8], str.AddServiceElem
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
jmp 0x4017da
test byte [section..data], 2
jne 0x401fa8
mov eax, dword [ebp - 0x20]
xor esi, esi
mov dword [esp], eax
call sub.advapi32.dll_RegCloseKey
mov dword [ebp - 0x34], 0
sub esp, 4
jmp 0x4017da
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sub.advapi32.dll_RegCloseKey
mov eax, dword [ebp - 0x34]
sub esp, 4
mov dword [esp + 8], 8
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.kernel32.dll_LoadLibraryExW
sub esp, 0xc
mov esi, eax
test eax, eax
jne 0x401f30
test byte [section..data], 2
je 0x4017da
mov eax, dword fs:[0x18]
mov edi, dword [eax + 0x34]
mov eax, dword [ebp - 0x34]
call fcn.00401220
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.failed_to_load_library__s__err_u_n
mov dword [esp + 8], str.AddServiceElem
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
jmp 0x4017da
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], 0x404410
mov eax, dword [eax]
mov dword [esp], eax
call sub.kernel32.dll_lstrcmpiW
sub esp, 8
test eax, eax
je 0x4014b0
test byte [section..data], 1
je 0x40151f
mov eax, dword [ebp - 0x40]
mov eax, dword [eax]
call fcn.00401220
mov dword [esp + 0xc], str.Unrecognized_option:__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.wmain
mov dword [esp + 4], 0x403000
mov dword [esp], 0
call section..text
jmp 0x40151f
mov dword [esp + 0xc], section..rdata
mov dword [esp + 8], 0x4042b8
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call section..text
jmp 0x4018c5
mov eax, ebx
call fcn.00401220
mov dword [esp + 0xc], str.Loading_service_group_for__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.LoadGroup
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call section..text
jmp 0x4014de
test byte [section..data], 2
je 0x401b1d
mov eax, dword fs:[0x18]
mov esi, dword [eax + 0x34]
mov eax, dword [ebp - 0x30]
call fcn.00401220
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.cannot_expand_env_vars_in__s:__u_n
mov dword [esp + 8], 0x4042b8
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
test byte [section..data], 2
je 0x401b1d
mov eax, dword [ebp - 0x30]
call fcn.00401220
mov dword [esp + 0xc], str.failed_to_expand_string__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.AddServiceElem
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
jmp 0x401b1d
mov eax, str.SoftwareMicrosoftWindows_NTCurrentVersionSvchost
call fcn.00401220
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.cannot_open_key__s__err_d_n
mov dword [esp + 8], str.LoadGroup
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
test byte [section..data], 2
je 0x40151f
mov eax, dword [ebp - 0x58]
mov eax, dword [eax]
call fcn.00401220
mov dword [esp + 0xc], str.Failed_to_load_requested_group:__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.wmain
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
jmp 0x40151f
mov eax, dword [ebp - 0x44]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
sub esp, 0xc
test byte [section..data], 8
jne 0x401e90
mov ecx, dword [ebp - 0x4c]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], ecx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
sub esp, 0xc
jmp 0x401d5e
test byte [section..data], 2
jne 0x4020b8
mov dword [esp], edx
call sub.kernel32.dll_FreeLibrary
sub esp, 4
jmp 0x4017da
mov eax, dword [ebp - 0x44]
mov ecx, dword [ebp - 0x48]
lea eax, [eax + ecx*8]
mov dword [eax], 0
mov dword [eax + 4], 0
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call sub.advapi32.dll_StartServiceCtrlDispatcherW
sub esp, 4
test eax, eax
jne 0x401ec0
test byte [section..data], 2
jne 0x402168
mov ecx, dword [ebp - 0x44]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], ecx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
sub esp, 0xc
test byte [section..data], 8
je 0x401dd5
lea esi, [esi]
nop
mov dword [esp + 0xc], str.Failed_to_start_service_group_n
mov dword [esp + 8], str.LoadGroup
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call section..text
jmp 0x401dd5
mov eax, dword [ebp - 0x44]
mov dword [esp + 4], 0
mov ebx, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
mov eax, dword [ebp - 0x4c]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
add dword [ebp - 0x3c], 2
mov eax, dword [ebp - 0x3c]
add dword [ebp - 0x40], 8
sub esp, 0xc
cmp eax, dword [ebp - 0x54]
jne 0x401490
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, eax
lea esi, [esi]
nop
mov dword [esp], esi
mov dword [esp + 4], str.ServiceMain
call sub.kernel32.dll_GetProcAddress
mov edx, esi
xor esi, esi
sub esp, 8
mov edi, eax
jmp 0x401a36
test byte [section..data], 2
je 0x40151f
mov eax, str.SoftwareMicrosoftWindows_NTCurrentVersionSvchost
call fcn.00401220
mov esi, eax
mov eax, ebx
call fcn.00401220
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.cannot_find_registry_value__s_in__s_n
mov dword [esp + 8], str.LoadGroup
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
jmp 0x401d5e
mov eax, dword [ebp - 0x2c]
call fcn.00401220
mov esi, eax
mov eax, str.ServiceDll
call fcn.00401220
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.cannot_find_registry_value__s_for_service__s_n
mov dword [esp + 8], str.AddServiceElem
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
jmp 0x401b1d
test byte [section..data], 2
jne 0x4020f8
mov ecx, dword [ebp - 0x34]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], ecx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sub.kernel32.dll_HeapFree
sub esp, 0xc
jmp 0x401ce2
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], str.Service_group_contains__d_services_n
mov dword [esp + 8], str.StartGroupServices
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call section..text
jmp 0x401599
mov eax, dword [ebp - 0x34]
call fcn.00401220
mov dword [esp + 0xc], str.library__s_expects_undocumented_SvchostPushServiceGlobals_function_to_be_called_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.AddServiceElem
mov dword [esp + 4], 0x403000
mov dword [esp], 0
call section..text
jmp 0x401a62
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sub.advapi32.dll_RegCloseKey
mov dword [ebp - 0x38], 0
sub esp, 4
jmp 0x4017da
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x5c], edx
call fcn.00401220
mov dword [esp + 0xc], str.cannot_locate_ServiceMain_procedure_in_DLL_for__s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.AddServiceElem
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
mov edx, dword [ebp - 0x5c]
jmp 0x401e0d
mov eax, dword [ebp - 0x30]
mov esi, dword [esi + 0x34]
call fcn.00401220
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.cannot_expand_env_vars_in__s:__u_n
mov dword [esp + 8], 0x4042b8
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
jmp 0x401ffd
mov dword [esp + 0xc], section..rdata
mov dword [esp + 8], str.wmain
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call section..text
jmp 0x401459
mov eax, dword fs:[0x18]
mov ebx, dword [eax + 0x34]
mov eax, dword [ebp - 0x4c]
call fcn.00401220
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.StartServiceCtrlDispatcherW_failed_to_start__s:__u_n
mov dword [esp + 8], str.StartGroupServices
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
jmp 0x401e55
test al, 2
je 0x40151f
mov dword [esp + 0xc], str.Must_specify_group_to_initialize_n
mov dword [esp + 8], str.wmain
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call section..text
jmp 0x40151f
mov eax, dword [ebp - 0x44]
jmp 0x401e29