Function at 0x402b50
Capabilities:
Create service
Query service status
Start service

Disassembly:
sub esp, 0x228
push esi
push edi
push 0x7d0
xor edi, edi
call fcn.00405b95
mov esi, eax
add esp, 4
test esi, esi
je 0x40308f
push 0x4139f8
call fcn.004020a0
push 0x413fe0
push str.Path_of_executable:__s
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
mov eax, dword [0x411430]
add esp, 0x14
cmp eax, 2
jne 0x402bab
push str.Service_start_type_is_Automatic.
call fcn.004020a0
add esp, 4
mov eax, dword [0x4139e8]
test eax, eax
je 0x402be9
push eax
call fcn.00402830
add esp, 4
test eax, eax
jne 0x402bce
mov eax, dword [0x4139e8]
push eax
push str.Error:_Could_not_grant__s_the_right_to_logon_as_a_service...
jmp 0x402bda
mov ecx, dword [0x4139e8]
push ecx
push str.User__s_has_been_granted_the_right_to_logon_as_a_service...
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x10
push 0x415000
push 0x4147e0
push str.Installing_service__s_as__s...
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x14
push 0x200
lea edx, [esp + 0x34]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x402c5c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push 0x415000
push str.Error:_Unable_to_install__s____s
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
push esi
call fcn.00405ba7
add esp, 0x24
pop edi
pop esi
add esp, 0x228
ret
push 0x414c00
call fcn.004010a0
add esp, 4
test eax, eax
jne 0x402c9a
push 0x414c00
push 0x415000
push str.Error:_Unable_to_install__s___Service_configuration_file__s_does_not_exist.
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
push esi
call fcn.00405ba7
add esp, 0x18
pop edi
pop esi
add esp, 0x228
ret
mov eax, dword [esp + 0x238]
mov ecx, dword [eax + 8]
push ecx
lea edx, [esp + 0x34]
push edx
push str._s__run__s
mov eax, edx
push 0x200
push eax
call fcn.004061a8
add esp, 0x14
push 0xf003f
push 0
push 0
mov byte [esp + 0x23b], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
test eax, eax
mov dword [esp + 0xc], eax
je 0x403050
mov ecx, dword [0x4139ec]
mov edx, dword [0x4139e8]
push ecx
push edx
mov edx, dword [0x411430]
push 0x4139f9
push 0
push 0
lea ecx, [esp + 0x44]
push ecx
push 1
push edx
push 0x10
push 0xf01ff
push 0x415000
push 0x4147e0
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
test eax, eax
mov dword [esp + 8], eax
je 0x403016
push ebx
push ebp
push 0x415000
push str.Service__s_installed.
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x10
push str.ADVAPI32.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
je 0x402de2
push str.ChangeServiceConfig2A
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], 0x4143e0
je 0x402da5
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x18]
push ecx
push 1
push edx
call eax
test eax, eax
jne 0x402dd9
call ebp
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push str.ChangeServiceConfig2_failed____s
jmp 0x402dca
push str.Ignore_the_following_error_when_running_on_Windows_NT:
call fcn.004020a0
add esp, 4
call ebp
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push str.GetProcAddress___ChangeServiceConfig2A___failed____s
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x1c
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x402e0f
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push str.LoadLibary___ADVAPI32.DLL___failed____s
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x1c
mov eax, dword [0x4139f0]
test eax, eax
je 0x402ffe
push 0x415000
push str.Starting_service__s...
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
mov ebx, dword [esp + 0x20]
add esp, 0x10
push 0
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x402e7f
call ebp
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push str.StartService_failed____s
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x1c
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x402ffe
lea eax, [esp + 0x1c]
push eax
push ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
call ebx
test eax, eax
jne 0x402ebd
call ebp
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push str.QueryServiceStatus_failed__1_____s
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x1c
jmp 0x402ffe
cmp dword [esp + 0x20], 2
jne 0x402f63
test edi, edi
jne 0x402ee5
push 0x415000
push str.Start_pending_for__s...
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x10
mov eax, 0xcccccccd
mul dword [esp + 0x34]
mov edi, edx
shr edi, 3
cmp edi, 0x3e8
jae 0x402f02
mov edi, 0x3e8
jmp 0x402f0f
cmp edi, 0x2710
jbe 0x402f0f
mov edi, 0x2710
push str.Waiting...
call fcn.004020a0
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x1c]
push ecx
push edx
call ebx
test eax, eax
je 0x402f3c
cmp dword [esp + 0x20], 2
je 0x402ec8
jmp 0x402f63
call ebp
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push str.QueryServiceStatus_failed__2_____s
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x1c
cmp dword [esp + 0x20], 4
jne 0x402f85
push 0x415000
push str.Result_of_starting_service__s:_Success.
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x10
jmp 0x402ffe
push str.Service_not_started.
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
mov eax, dword [esp + 0x2c]
push eax
push str.Current_State:__d
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
mov ecx, dword [esp + 0x44]
push ecx
push str.Exit_Code:__d
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
mov edx, dword [esp + 0x58]
push edx
push str.Service_Specific_Exit_Code:__d
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
mov eax, dword [esp + 0x6c]
push eax
push str.Check_Point:__d
push esi
call fcn.00405e3a
mov ecx, dword [esp + 0x7c]
add esp, 0x48
push ecx
push str.Wait_Hint:__d
push esi
call fcn.00405e3a
add esp, 0xc
mov edx, dword [esp + 0x10]
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edx
call edi
mov eax, dword [esp + 0x14]
push eax
call edi
pop ebp
pop ebx
jmp 0x40307b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push str.CreateService_failed____s
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
push esi
call fcn.00405ba7
add esp, 0x20
pop edi
pop esi
add esp, 0x228
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x100
push 0x413ee0
call fcn.00402a40
push eax
push 0x411958
push esi
call fcn.00405e3a
push esi
call fcn.004020a0
add esp, 0x1c
push esi
call fcn.00405ba7
add esp, 4
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
pop esi
add esp, 0x228
ret