Function at 0x405fe0
Capabilities:
Create process on windows
Create thread
Set environment variable

Disassembly:
mov eax, 0x20094
call fcn.00414e40
mov eax, dword [0x428930]
xor eax, esp
mov dword [esp + 0x20090], eax
mov eax, dword [esp + 0x2003f]
mov ecx, dword [esp + 0x200a0]
mov edx, dword [esp + 0x200a4]
push ebx
mov ebx, dword [esp + 0x200a0]
push ebp
push edi
mov edi, dword [esp + 0x200b4]
push 0x58
push 8
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], edx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebp, eax
test ebp, ebp
jne 0x406076
push eax
push str.nssm_hook__
push str.hook
push 0xc00003eb
push 1
call fcn.00402230
add esp, 0x14
pop edi
lea eax, [ebp + 0x64]
pop ebp
pop ebx
mov ecx, dword [esp + 0x20090]
xor ecx, esp
call fcn.00414adc
add esp, 0x20094
ret
push esi
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
lea eax, [ebx + 0x70508]
push eax
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push ebx
call fcn.0040c9d0
push 1
push 0x421de0
push 0xffffffffffffffff
lea ecx, [esp + 0x90]
push 0x10
push ecx
call fcn.0041453f
mov esi, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
add esp, 0x18
lea edx, [esp + 0x80]
push edx
push str.NSSM_HOOK_VERSION
call esi
mov eax, dword [esp + 0x10]
push eax
push str.NSSM_EVENT
call esi
mov ecx, dword [esp + 0x14]
push ecx
push str.NSSM_ACTION
call esi
test edi, edi
je 0x4060f3
mov edx, dword [edi]
push edx
call fcn.0040e870
add esp, 4
push eax
jmp 0x4060f8
push 0x42196c
push str.NSSM_TRIGGER
call esi
mov eax, dword [ebx + 0x70554]
push eax
call fcn.0040e870
add esp, 4
push eax
push str.NSSM_LAST_CONTROL
call esi
call fcn.004087f0
push eax
push str.NSSM_EXE
call esi
push str.32_bit
push str.NSSM_CONFIGURATION
call esi
push 0x421cdc
push str.NSSM_VERSION
call esi
push str.2017_04_26
push str.NSSM_BUILD_DATE
call esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 0x421de0
push 0xffffffffffffffff
lea ecx, [esp + 0x8c]
push 0x10
push ecx
call fcn.0041453f
add esp, 0x14
lea edx, [esp + 0x80]
push edx
push str.NSSM_PID
call esi
lea eax, [ebx + 0x70538]
push eax
lea ecx, [esp + 0x34]
mov edi, str.NSSM_RUNTIME
call fcn.004059f0
mov eax, dword [ebx + 0x704d8]
add esp, 4
test eax, eax
je 0x4061e3
push eax
push 0x421de0
push 0xffffffffffffffff
lea ecx, [esp + 0x8c]
push 0x10
push ecx
call fcn.0041453f
add esp, 0x14
lea edx, [esp + 0x80]
push edx
push str.NSSM_APPLICATION_PID
call esi
lea eax, [ebx + 0x70540]
push eax
lea ecx, [esp + 0x34]
mov edi, str.NSSM_APPLICATION_RUNTIME
call fcn.004059f0
add esp, 4
push 0x42196c
jmp 0x40626d
push 0x42196c
push str.NSSM_APPLICATION_PID
call esi
mov ecx, dword [esp + 0x10]
push str.Start
push ecx
call fcn.004082b0
add esp, 8
test eax, eax
je 0x40622e
mov edx, dword [esp + 0x14]
push 0x4217dc
push edx
call fcn.004082b0
add esp, 8
test eax, eax
je 0x40622e
push 0x42196c
push str.NSSM_APPLICATION_RUNTIME
call esi
push 0x42196c
jmp 0x40626d
lea eax, [ebx + 0x70540]
lea ecx, [ebx + 0x70548]
push eax
mov edi, str.NSSM_APPLICATION_RUNTIME
call fcn.004059f0
mov ecx, dword [ebx + 0x704e0]
push ecx
push 0x421de0
push 0xffffffffffffffff
lea edx, [esp + 0x90]
push 0x10
push edx
call fcn.0041453f
add esp, 0x18
lea eax, [esp + 0x80]
push eax
push str.NSSM_EXITCODE
call esi
mov ecx, dword [esp + 0x200bc]
push ecx
push 0x421de0
push 0xffffffffffffffff
lea edx, [esp + 0x8c]
push 0x10
push edx
call fcn.0041453f
add esp, 0x14
lea eax, [esp + 0x80]
push eax
push str.NSSM_DEADLINE
call esi
lea edi, [ebx + 2]
push edi
push str.NSSM_SERVICE_NAME
call esi
lea ecx, [ebx + 0x202]
push ecx
push str.NSSM_SERVICE_DISPLAYNAME
call esi
mov edx, dword [ebx + 0x70558]
push edx
push 0x421de0
push 0xffffffffffffffff
lea eax, [esp + 0x8c]
push 0x10
push eax
call fcn.0041453f
add esp, 0x14
lea ecx, [esp + 0x80]
push ecx
push str.NSSM_START_REQUESTED_COUNT
call esi
mov edx, dword [ebx + 0x7055c]
push edx
push 0x421de0
push 0xffffffffffffffff
lea eax, [esp + 0x8c]
push 0x10
push eax
call fcn.0041453f
add esp, 0x14
lea ecx, [esp + 0x80]
push ecx
push str.NSSM_START_COUNT
call esi
mov edx, dword [ebx + 0x70560]
push edx
push 0x421de0
push 0xffffffffffffffff
lea eax, [esp + 0x8c]
push 0x10
push eax
call fcn.0041453f
add esp, 0x14
lea ecx, [esp + 0x80]
push ecx
push str.NSSM_EXIT_COUNT
call esi
mov edx, dword [ebx + 0x704e8]
push edx
push 0x421de0
push 0xffffffffffffffff
lea eax, [esp + 0x8c]
push 0x10
push eax
call fcn.0041453f
add esp, 0x14
lea ecx, [esp + 0x80]
push ecx
push str.NSSM_THROTTLE_COUNT
call esi
lea edx, [ebx + 0x28414]
push edx
lea eax, [ebx + 0x18416]
push eax
push str.__s___s
push 0xffffffffffffffff
lea ecx, [esp + 0x100b0]
push 0x8000
push ecx
call fcn.0041453f
add esp, 0x18
lea edx, [esp + 0x100a0]
push edx
push str.NSSM_COMMAND_LINE
call esi
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
push 0x10000
lea eax, [esp + 0xa4]
push eax
push ecx
push esi
push edi
call fcn.0040b1b0
add esp, 0x14
test eax, eax
je 0x406419
mov edx, dword [esp + 0x14]
push 0
push edi
push edx
push esi
push 0x40000439
push 1
call fcn.00402230
push ebx
call fcn.0040ca20
mov eax, dword [esp + 0x34]
add esp, 0x1c
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, 0x64
jmp 0x4066c2
lea eax, [esp + 0xa0]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406423
sub eax, edx
sar eax, 1
jne 0x406462
push ebx
call fcn.0040ca20
mov ecx, dword [esp + 0x1c]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, 1
jmp 0x4066c2
push 0x44
lea edx, [esp + 0x40]
push 0
push edx
call fcn.00414af0
xor eax, eax
add esp, 0xc
mov dword [esp + 0x3c], 0x44
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
cmp byte [ebx + 0x70470], al
je 0x4064a3
lea eax, [esp + 0x3c]
push eax
push ebx
call fcn.004072f0
add esp, 8
xor al, al
test dword [esp + 0x68], 0x100
je 0x4064b1
mov al, 1
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x40]
push edx
lea ecx, [ebx + 0x30412]
push ecx
push 0
push 0x400
movzx edx, al
push edx
push 0
push 0
lea eax, [esp + 0xc0]
push eax
push 0
mov dword [esp + 0x38], 0x65
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40665d
lea ecx, [esp + 0x3c]
push ecx
call fcn.00407390
add esp, 4
push 0x400
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp], eax
test eax, eax
je 0x406535
mov edx, dword [esp + 0x14]
push edx
push esi
push edi
push str._s___s__s_
push 0xffffffffffffffff
push 0x200
push eax
call fcn.0041453f
add esp, 0x1c
mov eax, dword [esp + 0x20]
mov esi, dword [esp + 0x200bc]
lea edi, [ebp + 0x10]
mov dword [ebp + 4], eax
mov ecx, dword [esp + 0x28]
mov edx, eax
push edi
push edx
mov dword [ebp + 8], ecx
mov dword [ebp + 0xc], esi
call fcn.00409000
add esp, 8
test eax, eax
je 0x406567
push edi
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
lea eax, [esp + 0x38]
push eax
push 0
push ebp
push fcn.004058d0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov edi, eax
test edi, edi
je 0x40660f
cmp byte [esp + 0x200c0], 0
je 0x4065c8
mov edx, dword [ebx + 0x704d0]
mov esi, dword [esp + 0x1c]
push 0
lea ecx, [ebx + 0x704b4]
push ecx
push edx
push esi
mov dword [esp + 0x20], 0
call fcn.00405e00
mov eax, dword [ebp]
push eax
push edi
mov edi, esi
call fcn.00405a80
add esp, 0x18
jmp 0x4066aa
mov ecx, dword [ebp]
mov eax, dword [ebx + 0x704d0]
add esi, 0x4e20
push esi
push str.nssm_hook
push ecx
push edi
lea edx, [ebx + 0x704b4]
push edx
push eax
call fcn.0040ee30
add esp, 0x18
lea ecx, [esp + 0x1c]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
mov edx, dword [esp + 0x1c]
push edi
mov dword [esp + 0x14], edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4066aa
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004020f0
add esp, 4
push eax
push 0xc0000424
push 1
call fcn.00402230
add esp, 0x10
push ebp
call fcn.004058d0
mov eax, dword [ebp]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
je 0x40664f
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call esi
jmp 0x4066aa
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004020f0
mov ecx, dword [esp + 0x1c]
add esp, 4
push eax
lea eax, [esp + 0xa8]
push eax
push edi
push ecx
push esi
push 0x40000438
push 1
call fcn.00402230
add esp, 0x20
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea edx, [esp + 0x3c]
push edx
call fcn.00407390
add esp, 4
push ebx
call fcn.0040ca20
mov eax, dword [esp + 0x1c]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x200a0]
pop esi
pop edi
pop ebp
pop ebx
xor ecx, esp
call fcn.00414adc
add esp, 0x20094
ret