Function at 0x406190
Capabilities:
Check for time delay via gettickcount
Create service
Delete service
Query service configuration
Query service status
Start service
Stop service
Terminate process

Disassembly:
sub esp, 0x360
push ebx
push ebp
mov ebp, dword [sym.imp.MSVCRT.dll_strrchr]
push esi
mov esi, dword [esp + 0x374]
xor eax, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0xc], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov eax, dword [esi]
push edi
mov ebx, 0x65
push 0x5c
push eax
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], 2
mov dword [esp + 0x48], 0x4200cc
mov dword [esp + 0x4c], 0x407e90
call ebp
mov edi, eax
add esp, 8
test edi, edi
je 0x4061f1
inc edi
jmp 0x4061f3
mov edi, dword [esi]
push 7
push str.tbmux32
push edi
call dword [sym.imp.MSVCRT.dll__strnicmp]
add esp, 0xc
test eax, eax
je 0x40623d
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x2e
mov edx, ecx
mov esi, edi
mov edi, 0x4200cc
push 0x4200cc
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call ebp
add esp, 8
test eax, eax
je 0x406270
mov byte [eax], 0
jmp 0x406270
push str.SERVICENAME
call fcn.004187e0
add esp, 4
test eax, eax
je 0x406295
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, 0x4200cc
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x4200cc
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, str.TransBase_Dienst
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push str.DISPLAYNAME
call fcn.004187e0
add esp, 4
test eax, eax
je 0x4062c8
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, str.TransBase_Dienst
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.00408e80
test eax, 0xff000
mov ecx, 1
je 0x4062dd
mov dword [esp + 0x1c], ecx
mov eax, dword [esp + 0x378]
mov edx, dword [eax]
mov eax, dword [esp + 0x1c]
test eax, eax
mov dword [0x45897c], edx
je 0x4065d4
mov ebp, dword [esp + 0x374]
cmp ebp, 2
jle 0x4063a2
mov eax, dword [esp + 0x378]
mov esi, dword [eax + 4]
mov eax, 0x420a90
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40633b
test cl, cl
je 0x406337
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40633b
add eax, 2
add esi, 2
test cl, cl
jne 0x406317
xor eax, eax
jmp 0x406340
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4063a2
mov edx, dword [esp + 0x378]
or ecx, 0xffffffff
mov edi, dword [edx + 8]
add edx, 8
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov dword [esp + 0x378], edx
mov eax, ecx
mov esi, edi
mov edi, 0x4200cc
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [edx]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, str.TransBase_Dienst
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
sub ebp, 2
rep movsb byte es:[edi], byte [esi]
mov dword [esp + 0x374], ebp
cmp ebp, 1
jle 0x40658a
mov ecx, dword [esp + 0x378]
mov esi, str.stop
mov edi, dword [ecx + 4]
mov eax, edi
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4063e0
test cl, cl
je 0x4063dc
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4063e0
add eax, 2
add esi, 2
test cl, cl
jne 0x4063bc
xor eax, eax
jmp 0x4063e5
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4063f7
mov ebx, 0x68
mov dword [esp + 0x14], ebx
jmp 0x4064ff
mov esi, str.start
mov eax, edi
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x406422
test cl, cl
je 0x40641e
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x406422
add eax, 2
add esi, 2
test cl, cl
jne 0x4063fe
xor eax, eax
jmp 0x406427
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x406439
mov ebx, 0x69
mov dword [esp + 0x14], ebx
jmp 0x4064ff
mov esi, str.query
mov eax, edi
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x406464
test cl, cl
je 0x406460
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x406464
add eax, 2
add esi, 2
test cl, cl
jne 0x406440
xor eax, eax
jmp 0x406469
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40647b
mov ebx, 0x6d
mov dword [esp + 0x14], ebx
jmp 0x4064ff
mov esi, str.remove
mov eax, edi
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4064a6
test cl, cl
je 0x4064a2
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4064a6
add eax, 2
add esi, 2
test cl, cl
jne 0x406482
xor eax, eax
jmp 0x4064ab
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4064ba
mov ebx, 0x6a
mov dword [esp + 0x14], ebx
jmp 0x4064ff
mov esi, str.install
mov eax, edi
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4064e5
test cl, cl
je 0x4064e1
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4064e5
add eax, 2
add esi, 2
test cl, cl
jne 0x4064c1
xor eax, eax
jmp 0x4064ea
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4064ff
mov ebx, 0x6b
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], ebx
mov esi, str.manual
mov eax, edi
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40652a
test cl, cl
je 0x406526
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40652a
add eax, 2
add esi, 2
test cl, cl
jne 0x406506
xor eax, eax
jmp 0x40652f
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x406549
mov ebx, 0x6b
mov dword [esp + 0x18], 3
mov dword [esp + 0x14], ebx
jmp 0x406658
mov esi, str.noservice
mov eax, edi
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x406574
test cl, cl
je 0x406570
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x406574
add eax, 2
add esi, 2
test cl, cl
jne 0x406550
xor eax, eax
jmp 0x406579
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x406646
mov ebx, 0x6c
mov dword [esp + 0x14], ebx
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x20]
lea eax, [ebx - 0x68]
cmp eax, 5
ja case.0x4065a4.108
mov esi, dword [sym.imp.MSVCRT.dll_printf]
jmp dword [eax*4 + 0x406d30]
lea ecx, [esp + 0x24]
push ecx
push ebp
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x4066ce
push eax
push eax
call fcn.00402bc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
cmp dword [esp + 0x374], ecx
jle 0x406581
mov eax, dword [esp + 0x378]
mov esi, str.noservice
mov eax, dword [eax + 4]
mov dl, byte [eax]
mov bl, byte [esi]
mov cl, dl
cmp dl, bl
jne 0x406614
test cl, cl
je 0x406610
mov dl, byte [eax + 1]
mov bl, byte [esi + 1]
mov cl, dl
cmp dl, bl
jne 0x406614
add eax, 2
add esi, 2
test cl, cl
jne 0x4065ec
xor eax, eax
jmp 0x406619
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x406581
mov eax, dword [esp + 0x374]
dec eax
mov dword [esp + 0x374], eax
mov eax, dword [esp + 0x378]
add eax, 4
mov dword [esp + 0x378], eax
jmp 0x406581
cmp ebx, 0x65
je 0x40658a
cmp ebx, 0x6c
je 0x40658a
push 0x40000000
push 0
push 0
mov dword [0x446704], 1
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
test edi, edi
jne 0x40668c
push eax
push eax
call fcn.00402bc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
cmp ebx, 0x6b
je 0x4066c5
push 0xf01ff
push 0x4200cc
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x10], ebp
jne 0x406592
push eax
push eax
call fcn.00402bc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
mov ebp, dword [esp + 0x10]
jmp 0x406592
cmp dword [esp + 0x28], 1
je 0x4067eb
lea edx, [esp + 0x50]
push edx
push 1
push ebp
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x406700
push eax
push eax
call fcn.00402bc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
mov ebp, eax
call esi
sub eax, ebp
cmp eax, 0x4e20
jae 0x40676f
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, 7
xor eax, eax
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x24]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x406a5e
mov eax, dword [esp + 0x28]
mov edi, 1
cmp eax, edi
je 0x40677a
push str.Waiting_.....__r
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 4
push 0x3e8
call ebx
call esi
sub eax, ebp
cmp eax, 0x4e20
jb 0x40671b
jmp 0x406774
mov edi, 1
cmp dword [esp + 0x28], edi
jne 0x4067c8
push str.TransBase_Dienst
push str.Service__s_stopped_n
call dword [sym.imp.MSVCRT.dll_printf]
mov eax, dword [esp + 0x1c]
add esp, 8
cmp eax, 0x68
je 0x406bc7
cmp dword [esp + 0x28], edi
jne 0x406bc7
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x406813
push eax
push eax
call fcn.00402bc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
push str.TransBase_Dienst
push str.Unable_to_stop_Service__s_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 8
mov eax, 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
cmp ebx, 0x68
jne 0x4067a4
push str.TransBase_Dienst
push str.Service__s_not_running_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
push str.TransBase_Dienst
push str.Service__s_removed_n
call dword [sym.imp.MSVCRT.dll_printf]
push str.Service_removed
push 4
call fcn.00408090
add esp, 0x10
call fcn.00408e80
test ah, 0x30
je 0x406841
call fcn.00407da0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x360
ret
lea eax, [esp + 0x6c]
push 0x101
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [esp + 0x6c]
push 0x22
push ecx
push 0x22
lea edx, [esp + 0x17c]
push str._c_s_c
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x14
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x170]
push 0
push 0
push str.Tcpip
push 0
push 0
push eax
push 1
push ecx
push 0x110
push 0xf01ff
push str.TransBase_Dienst
push 0x4200cc
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x10], ebp
je 0x406a5e
push str.TransBase_Dienst
push str.Service__s_installed_n
call esi
lea edx, [esp + 0x74]
push edx
call fcn.00407de0
push str.Service_installed
push 4
call fcn.00408090
add esp, 0x14
lea eax, [esp + 0x24]
push eax
push ebp
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x40690e
push eax
push eax
call fcn.00402bc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
cmp dword [esp + 0x28], 4
je 0x406a08
mov ecx, dword [esp + 0x374]
lea edx, [ecx - 2]
test edx, edx
je 0x406933
mov eax, dword [esp + 0x378]
add eax, 8
jmp 0x406935
xor eax, eax
add ecx, 0xfffffffe
push eax
push ecx
push ebp
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x40695a
push eax
push eax
call fcn.00402bc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
mov ebp, eax
call esi
sub eax, ebp
cmp eax, 0x4e20
jae 0x4069be
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esp + 0x10]
mov ecx, 7
xor eax, eax
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x24]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x406a5e
cmp dword [esp + 0x28], 4
je 0x4069c5
push str.Waiting_.....__r
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 4
push 1
call ebx
call esi
sub eax, ebp
cmp eax, 0x4e20
jb 0x406975
cmp dword [esp + 0x28], 4
jne 0x4069e5
push str.TransBase_Dienst
push str.Service__s_started_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
push str.TransBase_Dienst
push str.Unable_to_start_Service__s_n
call dword [sym.imp.MSVCRT.dll_printf]
add esp, 8
mov eax, 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
push str.TransBase_Dienst
push str.Service__s_already_running_n
call esi
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
mov ecx, dword [esp + 0x1c]
mov edi, dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
lea eax, [esp + 0x18]
push eax
push 0
push ecx
push ebp
call edi
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.MSVCRT.dll_malloc]
mov ecx, dword [esp + 0x1c]
add esp, 4
mov esi, eax
lea eax, [esp + 0x18]
push eax
push ecx
push esi
push ebp
call edi
test eax, eax
jne 0x406a75
push 0
push 0
call fcn.00402bc0
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
mov edi, dword [sym.imp.MSVCRT.dll_printf]
push 0x4200cc
push str._________Service:__s_n
call edi
mov edx, dword [esi]
push edx
push str._____ServiceType:__lu_n
call edi
mov eax, dword [esi + 4]
add esp, 0x10
cmp eax, 2
jne 0x406aa3
mov eax, str.auto
jmp 0x406abe
cmp eax, 3
jne 0x406aaf
mov eax, str.manual
jmp 0x406abe
cmp eax, 4
mov eax, str.disabled
je 0x406abe
mov eax, 0x4208e8
push eax
push str._______StartType:__s_n
call edi
mov eax, dword [esi + 8]
push eax
push str.____ErrorControl:__lu_n
call edi
mov eax, dword [esi + 0xc]
add esp, 0x10
test eax, eax
jne 0x406ae0
mov eax, 0x446718
push eax
push str.________Pathname:__s_n
call edi
mov eax, dword [esi + 0x10]
add esp, 8
test eax, eax
jne 0x406af7
mov eax, 0x446718
push eax
push str.__LoadOrderGroup:__s_n
call edi
mov ecx, dword [esi + 0x14]
push ecx
push str.___________TagId:__lu_n
call edi
mov eax, dword [esi + 0x18]
add esp, 0x10
test eax, eax
jne 0x406b19
mov eax, 0x446718
push eax
push str.____Dependencies:__s_n
call edi
mov eax, dword [esi + 0x1c]
add esp, 8
test eax, eax
jne 0x406b30
mov eax, 0x446718
push eax
push str.ServiceStartName:__s_n
call edi
mov esi, dword [esi + 0x20]
add esp, 8
test esi, esi
jne 0x406b47
mov esi, 0x446718
push esi
push str._____DisplayName:__s_n
call edi
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x406b6c
push edi
call esi
test ebp, ebp
je 0x406b73
push ebp
call esi
cmp ebx, 0x65
jne 0x406bd4
lea edx, [esp + 0x40]
mov dword [0x4466c8], 1
push edx
call dword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherA]
test eax, eax
jne 0x406bbe
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x427
jne 0x406baa
mov dword [0x4466c8], 0
jmp 0x406c06
cmp eax, 1
je 0x406bbe
push str._StartServiceCtrlDispatcher_failed
push 1
call fcn.00408090
add esp, 8
mov eax, dword [0x4466c8]
test eax, eax
je 0x406c06
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x360
ret
mov eax, dword [esp + 0x1c]
mov dword [0x4466c8], 0
test eax, eax
je 0x406c06
mov ecx, dword [esp + 0x378]
mov eax, dword [esp + 0x374]
add ecx, 4
dec eax
mov dword [esp + 0x378], ecx
mov dword [esp + 0x374], eax
push str.Server
call fcn.00408780
mov esi, eax
lea eax, [esp + 0x174]
push eax
push str.TransBase_Multiplexer
call fcn.00408c80
mov edx, dword [sym.imp.MSVCRT.dll__iob]
mov edi, dword [sym.imp.MSVCRT.dll_fprintf]
lea ecx, [esp + 0x17c]
add edx, 0x40
push ecx
push 0x420560
push edx
call edi
add esp, 0x18
test esi, esi
je 0x406c66
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push esi
add eax, 0x40
push 0x4207ec
push eax
call edi
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov ecx, dword [esp + 0x378]
mov edx, dword [esp + 0x374]
push ecx
push edx
call fcn.00406e60
add esp, 8
test eax, eax
je 0x406cab
call fcn.0040a3b0
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x40
push 0x420560
push eax
call edi
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x360
ret
mov eax, dword [0x446704]
test eax, eax
jne 0x406ccf
mov eax, dword [0x446708]
test eax, eax
jne 0x406ccf
mov dword [0x4466c8], 1
call dword [sym.imp.KERNEL32.dll_FreeConsole]
jmp 0x406ce7
lea ecx, [esp + 0x1c]
push ecx
push 0
push 0
push 0x406d50
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
call section..text
mov esi, eax
test esi, esi
je 0x406d0c
call fcn.0040a3b0
mov edx, dword [sym.imp.MSVCRT.dll__iob]
push eax
add edx, 0x40
push 0x420560
push edx
call edi
add esp, 0xc
mov dword [0x4466d8], 1
call fcn.00407c00
xor eax, eax
pop edi
test esi, esi
pop esi
pop ebp
setne al
pop ebx
add esp, 0x360
ret