Function at 0x46718b
Capabilities:
Create pipe
Create process on windows
Create thread
Query environment variable
Terminate process
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push edi
push ebx
sub esp, 0xb0
mov dword [ebp - 0xc], 0
lea edx, [ebp - 0x6c]
mov eax, 0
mov ecx, 0x11
mov edi, edx
rep stosd dword es:[edi], eax
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 0
mov dword [ebp - 0x70], 0
mov dword [ebp - 0x84], 0
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
cmp dword [ebp + 0x18], 0
je 0x4673a2
mov dword [esp + 4], 1
mov dword [esp], 0x1800
call sym._calloc
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x467258
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp], eax
call sym._strerror
mov ebx, eax
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x4fa6ac
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x40
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._merror_exit
mov dword [esp], 0x4fa6e1
call sym._getenv
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x467291
mov eax, dword [ebp + 0x18]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.PATH_s
mov dword [esp + 4], 0x17ff
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._snprintf_41
jmp 0x4672f9
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._strlen
cmp eax, 0x17ff
jbe 0x4672d0
mov dword [esp + 0xc], str.at_wm_exec__:_PATH_environment_variable_too_large.
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x46
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._merror
mov dword [ebp - 0x10], 0xffffffff
jmp 0x4672f9
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x18]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.PATH_s__s
mov dword [esp + 4], 0x17ff
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._snprintf_41
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__putenv]
call eax
test eax, eax
jns 0x46734a
mov eax, dword [sym.imp.msvcrt.dll__errno]
call eax
mov eax, dword [eax]
mov dword [esp], eax
call sym._strerror
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.at_wm_exec__:_Unable_to_set_new_PATH_environment_variable___s_.
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x4e
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._merror
mov dword [ebp - 0x10], 0xffffffff
mov dword [esp], 0x4fa6e1
call sym._getenv
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x46738a
mov eax, dword [ebp - 0x20]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.New_PATH_environment_variable_set:__s
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x54
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._mdebug1
cmp dword [ebp - 0x18], 0
je 0x4673a2
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._free
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x6c], 0x44
cmp dword [ebp + 0xc], 0
je 0x4674b4
mov dword [ebp - 0x40], 0x100
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
lea eax, [ebp - 0x6c]
add eax, 0x3c
mov dword [esp + 4], eax
lea eax, [ebp - 0x84]
add eax, 4
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CreatePipe]
call eax
sub esp, 0x10
test eax, eax
jne 0x46743c
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call dbg.win_strerror
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.at_wm_exec__:_CreatePipe__d_:__s
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x62
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._merror
mov eax, 0xffffffff
jmp 0x4677f4
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], 1
mov dword [esp + 4], 1
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_SetHandleInformation]
call eax
sub esp, 0xc
test eax, eax
jne 0x4674b4
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call dbg.win_strerror
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.at_wm_exec__:_SetHandleInformation__d_:__s
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x6a
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._merror
mov eax, 0xffffffff
jmp 0x4677f4
mov eax, dword [0x588a88]
cmp eax, 0xfffffff6
jl 0x4674f6
mov eax, dword [0x588a88]
test eax, eax
js 0x4674ef
mov eax, dword [0x588a88]
test eax, eax
je 0x4674e8
mov eax, dword [0x588a88]
cmp eax, 9
jg 0x4674e1
mov eax, 0x4000
jmp 0x4674fb
mov eax, 0x40
jmp 0x4674fb
mov eax, 0x20
jmp 0x4674fb
mov eax, 0x8000
jmp 0x4674fb
mov eax, pe_nt_image_headers32
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x7c]
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x6c]
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov eax, dword [ebp - 0x24]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov dword [esp], 0
mov eax, dword [sym.imp.KERNEL32.dll_CreateProcessA]
call eax
sub esp, 0x28
test eax, eax
jne 0x4675a5
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call dbg.win_strerror
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.at_wm_exec__:_CreateProcess__d_:__s
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x79
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._merror
mov eax, 0xffffffff
jmp 0x4677f4
cmp dword [ebp + 0xc], 0
je 0x467629
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x84]
mov dword [esp + 0xc], eax
mov dword [esp + 8], dbg.Reader
mov dword [esp + 4], 0
mov dword [esp], 0
mov eax, dword [sym.imp.KERNEL32.dll_CreateThread]
call eax
sub esp, 0x18
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x467623
mov dword [esp + 0xc], 0x4fa814
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x82
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._merror_exit
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0xc], eax
cmp dword [ebp + 0x14], 0
je 0x46763c
mov eax, dword [ebp + 0x14]
imul eax, eax, 0x3e8
mov edx, eax
jmp 0x467641
mov edx, 0xffffffff
mov eax, dword [ebp - 0x7c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call eax
sub esp, 8
test eax, eax
je 0x467662
cmp eax, 0x102
je 0x467698
jmp 0x4676b9
cmp dword [ebp + 0x10], 0
je 0x46771e
mov eax, dword [ebp - 0x7c]
lea edx, [ebp - 0x88]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
call eax
sub esp, 8
mov eax, dword [ebp - 0x88]
mov edx, eax
mov eax, dword [ebp + 0x10]
mov dword [eax], edx
jmp 0x46771e
mov eax, dword [ebp - 0x7c]
mov dword [esp + 4], 1
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TerminateProcess]
call eax
sub esp, 8
mov dword [ebp - 0x10], 1
jmp 0x46771f
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call dbg.win_strerror
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.at_wm_exec__:_WaitForSingleObject__d_:__s
mov dword [esp + 8], global___func__.138
mov dword [esp + 4], 0x96
mov dword [esp], str.wazuh_modules_wm_exec.c
call dbg._merror
mov eax, dword [ebp - 0x7c]
mov dword [esp + 4], 1
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TerminateProcess]
call eax
sub esp, 8
mov dword [ebp - 0x10], 0xffffffff
jmp 0x46771f
nop
cmp dword [ebp + 0xc], 0
je 0x4677d1
mov dword [esp + 4], 0x3e8
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call eax
sub esp, 8
cmp eax, 0x102
jne 0x467778
mov dword [esp + 4], 1
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TerminateThread]
call eax
sub esp, 8
mov dword [esp + 4], 0xffffffff
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call eax
sub esp, 8
cmp dword [ebp - 0x10], 0
js 0x4677a3
mov eax, dword [ebp - 0x84]
test eax, eax
je 0x467790
mov eax, dword [ebp - 0x84]
jmp 0x46779c
mov dword [esp], 0x4fa866
call sym._strdup
mov edx, dword [ebp + 0xc]
mov dword [edx], eax
jmp 0x4677b1
mov eax, dword [ebp - 0x84]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x80]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x7c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x78]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x10]
lea esp, [ebp - 8]
pop ebx
pop edi
pop ebp
ret