Function at 0x1002f7f0
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Execute shell command and capture output
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xd4
mov eax, dword [0x101a49d4]
xor eax, esp
mov dword [esp + 0xd0], eax
push ebx
push esi
push edi
push 0xc
lea eax, [esp + 0x30]
mov esi, edx
push 0
push eax
mov ebx, ecx
call fcn.1011ce00
add esp, 0xc
mov dword [esp + 0x2c], 0xc
lea eax, [esp + 0x2c]
mov dword [esp + 0x34], 1
push 0
push eax
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x1002f87d
push eax
push 0x1018ed8c
mov ecx, ebx
mov dword [ebx], eax
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], 7
call fcn.10051fd0
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xd0]
xor ecx, esp
call fcn.1011a2e1
mov esp, ebp
pop ebp
ret
push 0x44
lea eax, [esp + 0x4c]
push 0
push eax
call fcn.1011ce00
mov eax, dword [esp + 0x34]
mov edi, 0x7ffffffe
mov ecx, dword [esi + 0x10]
add esp, 0xc
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], eax
mov eax, edi
sub eax, ecx
mov dword [esp + 0x48], 0x44
mov dword [esp + 0x74], 0x101
cmp eax, 0xb
jb 0x1002fd94
cmp dword [esi + 0x14], 8
mov eax, esi
jb 0x1002f8cf
mov eax, dword [esi]
push ecx
push eax
push 0xb
push str.cmd.exe__c
push ecx
push dword [esp + 0x2c]
lea ecx, [esp + 0xc4]
call fcn.1005dba0
cmp dword [ebp + 8], 1
jne 0x1002f979
mov eax, dword [esi + 0x10]
sub edi, eax
cmp edi, 0x18
jb 0x1002fd99
cmp dword [esi + 0x14], 8
jb 0x1002f909
mov esi, dword [esi]
push eax
push esi
push 0x18
push str.powershell.exe__Command
push ecx
push dword [esp + 0x2c]
lea ecx, [esp + 0xdc]
call fcn.1005dba0
lea eax, [esp + 0xc4]
push eax
lea ecx, [esp + 0xb0]
call fcn.100522e0
mov edx, dword [esp + 0xd8]
cmp edx, 8
jb 0x1002f979
mov ecx, dword [esp + 0xc4]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x1002f96f
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1002fd9e
push edx
push ecx
call fcn.1011a823
add esp, 8
cmp dword [esp + 0xc0], 8
lea ecx, [esp + 0x38]
push ecx
lea ecx, [esp + 0x4c]
push ecx
push 0
push 0
push 0x8000000
push 1
push 0
lea eax, [esp + 0xc8]
cmovae eax, dword [esp + 0xc8]
push 0
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x1002fa28
push eax
push 0x1018ed8c
mov ecx, ebx
mov dword [ebx], eax
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x14], 7
call fcn.10051fd0
mov edx, dword [esp + 0xc0]
cmp edx, 8
jb 0x1002fa11
mov ecx, dword [esp + 0xac]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x1002fa07
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1002fd8f
push edx
push ecx
call fcn.1011a823
add esp, 8
mov ecx, dword [esp + 0xdc]
mov eax, ebx
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.1011a2e1
mov esp, ebp
pop ebp
ret
push dword [esp + 0x3c]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [esp + 0x28]
call edi
push 0x1000
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 0
call fcn.1005d480
mov esi, dword [esp + 0xc]
push 0x1000
push 0
push esi
call fcn.1011ce00
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x94], 0
add esi, 0x1000
mov dword [esp + 0xa4], 0
mov dword [esp + 0x10], esi
sub esi, eax
mov dword [esp + 0xa8], 0xf
push 0
push ecx
push esi
push eax
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1002fba2
mov edi, dword [esp + 0x1c]
test edi, edi
je 0x1002fb9c
mov edx, dword [esp + 0xa8]
mov eax, edx
mov ecx, dword [esp + 0xa4]
sub eax, ecx
push edi
push dword [esp + 0x10]
cmp edi, eax
ja 0x1002fb14
cmp edx, 0x10
lea esi, [esp + 0x9c]
lea eax, [edi + ecx]
cmovae esi, dword [esp + 0x9c]
add esi, ecx
mov dword [esp + 0xac], eax
push esi
call fcn.1011b630
add esp, 0xc
mov byte [edi + esi], 0
jmp 0x1002fb2a
mov byte [esp + 0x20], 0
lea ecx, [esp + 0x9c]
push dword [esp + 0x20]
push edi
call fcn.1005bbb0
mov esi, dword [esp + 0x10]
mov edi, esi
mov ecx, dword [esp + 0xc]
sub edi, ecx
cmp dword [esp + 0x1c], edi
jne 0x1002fb7f
lea edx, [edi + edi]
cmp edx, edi
jae 0x1002fb48
lea esi, [edx + ecx]
jmp 0x1002fb7b
jbe 0x1002fb7f
mov eax, dword [esp + 0x14]
sub eax, ecx
cmp edx, eax
jbe 0x1002fb69
push ecx
push edx
lea ecx, [esp + 0x14]
call fcn.1005f520
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0xc]
jmp 0x1002fb7f
push edi
push 0
push esi
call fcn.1011ce00
mov ecx, dword [esp + 0x18]
add esp, 0xc
add esi, edi
mov dword [esp + 0x10], esi
push 0
lea eax, [esp + 0x20]
sub esi, ecx
push eax
push esi
push ecx
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1002fac0
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esp + 0x20]
call edi
push dword [esp + 0x38]
call edi
cmp dword [esp + 0xa8], 0x10
lea eax, [esp + 0x94]
push 0
cmovae eax, dword [esp + 0x98]
push 0
push dword [esp + 0xac]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
xor esi, esi
mov dword [esp + 0x24], eax
xor edi, edi
mov dword [esp + 0x18], 0
test eax, eax
je 0x1002fc26
cmp eax, 0x7fffffff
ja 0x1002fda3
push eax
lea ecx, [esp + 0xc8]
call fcn.10055e90
mov edi, eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x18], edi
lea ecx, [eax + eax]
push ecx
push 0
push edi
lea esi, [ecx + edi]
call fcn.1011ce00
add esp, 0xc
push dword [esp + 0x24]
cmp dword [esp + 0xac], 0x10
lea eax, [esp + 0x98]
push edi
push dword [esp + 0xac]
cmovae eax, dword [esp + 0xa0]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push dword [esp + 0x24]
mov ecx, ebx
mov dword [ebx], 0
push dword [esp + 0x1c]
mov dword [ebx + 0x10], 0
mov dword [ebx + 0x14], 7
call fcn.10051fd0
test edi, edi
je 0x1002fcab
sub esi, edi
and esi, 0xfffffffe
cmp esi, 0x1000
jb 0x1002fca1
mov ecx, dword [edi - 4]
add esi, 0x23
sub edi, ecx
lea eax, [edi - 4]
cmp eax, 0x1f
ja 0x1002fd8f
mov edi, ecx
push esi
push edi
call fcn.1011a823
add esp, 8
mov edx, dword [esp + 0xa8]
cmp edx, 0x10
jb 0x1002fce7
mov ecx, dword [esp + 0x94]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x1002fcdd
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1002fd8f
push edx
push ecx
call fcn.1011a823
add esp, 8
mov ecx, dword [esp + 0xc]
mov dword [esp + 0xa4], 0
mov dword [esp + 0xa8], 0xf
mov byte [esp + 0x94], 0
test ecx, ecx
je 0x1002fd4f
mov edx, dword [esp + 0x14]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x1002fd2d
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1002fd8f
push edx
push ecx
call fcn.1011a823
add esp, 8
mov dword [esp + 0xc], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
mov edx, dword [esp + 0xc0]
cmp edx, 8
jb 0x1002fa11
mov ecx, dword [esp + 0xac]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x1002fa07
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x1002fa07
call fcn.10125fc5
call fcn.10021260
call fcn.10021260
call fcn.10125fc5
call fcn.1005d430
int3