Function at 0x413390
Capabilities:
Accept command line arguments
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2fc
mov eax, dword [0x469644]
xor eax, esp
mov dword [esp + 0x2f8], eax
push ebx
push esi
push edi
sub esp, 0x1c
mov esi, esp
xor eax, eax
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], 0
mov dword [esp + 0x30], esp
mov word [esi], ax
push 0xf
mov eax, str.Program_started
call fcn.00404210
call fcn.00410a60
xor eax, eax
add esp, 0x1c
xor ecx, ecx
mov edi, eax
mov dword [esp + 0x88], eax
push 1
mov eax, 0x45deb8
lea esi, [esp + 0x7c]
mov ebx, ecx
mov dword [esp + 0x90], 7
mov word [esp + 0x7c], cx
call fcn.00404210
lea ecx, [esp + 0x20]
call fcn.00405c10
cmp dword [esp + 0x34], 8
mov eax, dword [esp + 0x20]
mov byte [esp + 0x13], bl
jae 0x413428
lea eax, [esp + 0x20]
lea edx, [esp + 0xb0]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
je 0x41344f
mov edi, dword [esp + 0xc4]
mov ebx, dword [esp + 0xc8]
mov byte [esp + 0x13], 1
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [esp + 0x34], 8
jb 0x41346a
mov eax, dword [esp + 0x20]
push eax
call fcn.00426e9f
add esp, 4
cmp byte [esp + 0x13], 0
je 0x41349e
push ebx
push edi
lea ecx, [esp + 0x64]
call fcn.00406d80
add esp, 8
mov edi, eax
lea esi, [esp + 0x78]
call fcn.00404be0
cmp dword [esp + 0x70], 8
jb 0x41349e
mov ecx, dword [esp + 0x5c]
push ecx
call fcn.00426e9f
add esp, 4
sub esp, 0x1c
mov esi, esp
mov dword [esp + 0x30], esp
lea edx, [esp + 0xb0]
push 0x45dec4
push edx
lea ebx, [esp + 0x9c]
call fcn.00404920
push eax
mov eax, 0x45debc
lea ecx, [esp + 0x84]
call fcn.0040f880
mov ecx, eax
add esp, 0xc
mov eax, 0x46c054
lea ebx, [esp + 0x3c]
call fcn.00413010
push eax
mov eax, 0x45d75c
mov ecx, esi
call fcn.0040f880
add esp, 4
call fcn.00410b20
mov edi, 8
add esp, 0x1c
cmp dword [esp + 0x34], edi
jb 0x413515
mov eax, dword [esp + 0x20]
push eax
call fcn.00426e9f
add esp, 4
xor ebx, ebx
xor ecx, ecx
mov esi, 7
mov dword [esp + 0x34], esi
mov dword [esp + 0x30], ebx
mov word [esp + 0x20], cx
cmp dword [esp + 0x70], edi
jb 0x41353e
mov edx, dword [esp + 0x5c]
push edx
call fcn.00426e9f
add esp, 4
xor eax, eax
mov dword [esp + 0x70], esi
mov dword [esp + 0x6c], ebx
mov word [esp + 0x5c], ax
cmp dword [esp + 0xa8], edi
jb 0x413566
mov ecx, dword [esp + 0x94]
push ecx
call fcn.00426e9f
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
xor edx, edx
mov ecx, eax
mov dword [esp + 0x54], esi
mov dword [esp + 0x50], ebx
mov word [esp + 0x40], dx
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x413580
sub ecx, esi
sar ecx, 1
push ecx
lea esi, [esp + 0x44]
call fcn.00404210
sub esp, 0x1c
mov eax, esp
mov dword [esp + 0x30], esp
push str.CMD:
push eax
mov ebx, esi
call fcn.00404920
add esp, 8
call fcn.00410b20
add esp, 0x1c
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea ecx, [esp + 0x98]
push ecx
call fcn.004063a0
sub esp, 0x14
mov ecx, esp
mov dword [esp + 0x30], esp
push eax
mov edx, str.PID:
mov eax, ecx
call fcn.00404a00
add esp, 4
call fcn.00410b20
add esp, 0x1c
cmp dword [esp + 0xa8], edi
jb 0x413608
mov edx, dword [esp + 0x94]
push edx
call fcn.00426e9f
add esp, 4
mov eax, dword [esp + 0x40]
xor edi, edi
mov ebx, 8
mov byte [esp + 0x13], 0
mov dword [esp + 0x1c], edi
cmp dword [esp + 0x54], ebx
jae 0x413626
lea eax, [esp + 0x40]
lea ecx, [esp + 0x1c]
push ecx
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x18], eax
cmp dword [esp + 0x1c], edi
jle 0x413876
mov edx, dword [esp + 0x14]
mov eax, dword [edx + eax*4]
xor ecx, ecx
mov word [esp + 0x20], cx
mov ecx, eax
mov dword [esp + 0x34], 7
mov dword [esp + 0x30], edi
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, di
jne 0x413665
sub ecx, esi
sar ecx, 1
push ecx
lea esi, [esp + 0x24]
call fcn.00404210
mov esi, dword [esp + 0x30]
mov edx, esi
cmp esi, 0xc
jb 0x41368e
mov edx, 0xc
mov ecx, dword [esp + 0x20]
cmp dword [esp + 0x34], ebx
jae 0x41369c
lea ecx, [esp + 0x20]
mov eax, str._servicename
cmp edx, edi
jbe 0x4136c2
mov bx, word [ecx]
cmp bx, word [eax]
jne 0x4136b8
add ecx, 2
add eax, 2
dec edx
jne 0x4136a5
jmp 0x4136c2
sbb eax, eax
and eax, 0xfffffffe
inc eax
cmp eax, edi
jne 0x41370e
cmp esi, 0xc
jb 0x41370e
xor eax, eax
cmp esi, 0xc
setne al
cmp eax, edi
jne 0x41370e
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
inc eax
mov dword [esp + 0x18], eax
mov eax, dword [ecx + eax*4]
mov ecx, eax
lea esi, [ecx + 2]
jmp 0x4136f0
mov dx, word [ecx]
add ecx, 2
cmp dx, di
jne 0x4136f0
sub ecx, esi
sar ecx, 1
push ecx
mov esi, 0x46c6c8
call fcn.00404210
mov esi, dword [esp + 0x30]
mov edx, esi
cmp esi, 9
jb 0x41371a
mov edx, 9
cmp dword [esp + 0x34], 8
mov ecx, dword [esp + 0x20]
jae 0x413729
lea ecx, [esp + 0x20]
mov eax, str._debuglog
cmp edx, edi
jbe 0x41374f
mov bx, word [ecx]
cmp bx, word [eax]
jne 0x413745
add ecx, 2
add eax, 2
dec edx
jne 0x413732
jmp 0x41374f
sbb eax, eax
and eax, 0xfffffffe
inc eax
cmp eax, edi
jne 0x413765
cmp esi, 9
jb 0x41376a
xor eax, eax
cmp esi, 9
setne al
cmp eax, edi
jne 0x413765
mov byte [esp + 0x13], 1
cmp esi, 9
jae 0x41376e
mov edx, esi
jmp 0x413773
mov edx, 9
cmp dword [esp + 0x34], 8
mov ecx, dword [esp + 0x20]
jae 0x413782
lea ecx, [esp + 0x20]
mov eax, str._debugbox
cmp edx, edi
jbe 0x4137ad
jmp 0x413790
mov bx, word [ecx]
cmp bx, word [eax]
jne 0x4137a3
add ecx, 2
add eax, 2
dec edx
jne 0x413790
jmp 0x4137ad
sbb eax, eax
and eax, 0xfffffffe
inc eax
cmp eax, edi
jne 0x4137d0
cmp esi, 9
jb 0x4137d0
xor eax, eax
cmp esi, 9
setne al
cmp eax, edi
jne 0x4137d0
push edi
push str.Service_Manager
push str.Debug
push edi
call dword [sym.imp.USER32.dll_MessageBoxW]
mov ebx, 8
cmp dword [esp + 0x34], ebx
jb 0x4137e8
mov edx, dword [esp + 0x20]
push edx
call fcn.00426e9f
add esp, 4
xor eax, eax
mov word [esp + 0x20], ax
mov eax, dword [esp + 0x18]
inc eax
mov dword [esp + 0x34], 7
mov dword [esp + 0x30], edi
mov dword [esp + 0x18], eax
cmp eax, dword [esp + 0x1c]
jl 0x413646
cmp byte [esp + 0x13], 0
je 0x413876
mov eax, dword [0x4722c8]
cmp eax, edi
jne 0x41383f
push 0x1f0
call fcn.00427438
add esp, 4
cmp eax, edi
je 0x413838
mov edi, eax
call fcn.004111d0
jmp 0x41383a
xor eax, eax
mov dword [0x4722c8], eax
sub esp, 0x1c
mov esi, esp
mov ebx, eax
mov byte [ebx + 1], 1
mov dword [esp + 0x30], esp
xor ecx, ecx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], 0
push 0x13
mov eax, str.Debug_Log_aktiviert
mov word [esi], cx
call fcn.00404210
mov ecx, ebx
call fcn.00411850
xor edi, edi
sub esp, 0x1c
mov esi, esp
mov dword [esp + 0x30], esp
xor edx, edx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], edi
push 0x1d
mov eax, str.Windowns_service_access_check
mov word [esi], dx
call fcn.00404210
call fcn.00410a60
add esp, 0x1c
push 0xf003f
push edi
push edi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
sub esp, 0x1c
mov ebx, eax
mov dword [esp + 0x30], esp
mov esi, esp
cmp ebx, edi
je 0x4138eb
xor eax, eax
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], edi
mov word [esi], ax
push 0xa
mov eax, str.Successful
call fcn.00404210
call fcn.00410b20
add esp, 0x1c
mov esi, 8
jmp 0x413970
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0xb4]
push ecx
call fcn.004063a0
push eax
mov edx, str.OpenSCManager_failed__ErrorCode:
lea eax, [esp + 0x84]
call fcn.00404a00
add esp, 0xc
push eax
mov eax, 0x45d75c
mov ecx, esi
call fcn.0040f880
add esp, 4
call fcn.00410b20
mov esi, 8
add esp, 0x1c
cmp dword [esp + 0x70], esi
jb 0x413944
mov edx, dword [esp + 0x5c]
push edx
call fcn.00426e9f
add esp, 4
xor eax, eax
mov dword [esp + 0x70], 7
mov dword [esp + 0x6c], edi
mov word [esp + 0x5c], ax
cmp dword [esp + 0xa8], esi
jb 0x413970
mov ecx, dword [esp + 0x94]
push ecx
call fcn.00426e9f
add esp, 4
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call fcn.00414390
test al, al
je 0x4139bd
cmp dword [esp + 0x54], esi
jb 0x413993
mov edx, dword [esp + 0x40]
push edx
call fcn.00426e9f
add esp, 4
xor eax, eax
mov dword [esp + 0x54], 7
mov dword [esp + 0x50], edi
mov word [esp + 0x40], ax
cmp dword [esp + 0x8c], esi
jb 0x413ac5
mov ecx, dword [esp + 0x78]
push ecx
jmp 0x413abd
mov byte [0x4722a4], 0
call fcn.00413da0
test al, al
jne 0x413a03
sub esp, 0x1c
mov esi, esp
mov dword [esp + 0x30], esp
xor edx, edx
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], edi
push 0xe
mov eax, str.StartType:_EXE
mov word [esi], dx
call fcn.00404210
call fcn.00410a60
add esp, 0x1c
push 1
call fcn.00414130
add esp, 4
sub esp, 0x1c
mov esi, esp
xor eax, eax
mov dword [esi + 0x14], 7
mov dword [esi + 0x10], edi
mov dword [esp + 0x30], esp
mov word [esi], ax
push 0xc
mov eax, str.Program_quit
call fcn.00404210
call fcn.00410a60
mov edi, dword [0x4722c8]
xor ebx, ebx
add esp, 0x1c
cmp edi, ebx
jne 0x413a5f
push 0x1f0
call fcn.00427438
add esp, 4
cmp eax, ebx
je 0x413a55
mov edi, eax
call fcn.004111d0
jmp 0x413a57
xor eax, eax
mov edi, eax
mov dword [0x4722c8], edi
call fcn.004121d0
mov eax, dword [0x4722c8]
mov esi, eax
cmp eax, ebx
je 0x413a7e
push eax
call fcn.00411690
push esi
call fcn.00426e9f
add esp, 4
mov esi, 8
mov dword [0x4722c8], ebx
cmp dword [esp + 0x54], esi
jb 0x413a9c
mov ecx, dword [esp + 0x40]
push ecx
call fcn.00426e9f
add esp, 4
xor edx, edx
mov dword [esp + 0x54], 7
mov dword [esp + 0x50], ebx
mov word [esp + 0x40], dx
cmp dword [esp + 0x8c], esi
jb 0x413ac5
mov eax, dword [esp + 0x78]
push eax
call fcn.00426e9f
add esp, 4
mov ecx, dword [esp + 0x304]
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0042575d
mov esp, ebp
pop ebp
ret 0x10