Function at 0x4010e0
Capabilities:
Create pipe
Create process on windows
Read file on windows
Write and execute a file
Write file on windows
Write pipe

Disassembly:
sub esp, 0x840
mov eax, dword [esp + 0x844]
push ebx
mov ebx, 1
push esi
cmp eax, 3
push edi
mov dword [esp + 0x2c], 0xc
mov dword [esp + 0x34], ebx
mov dword [esp + 0x30], 0
je 0x401113
call fcn.004010d0
mov esi, dword [esp + 0x854]
mov eax, dword [esi + 4]
push eax
push 0
push 0xf001f
call dword [sym.imp.KERNEL32.dll_OpenFileMappingA]
test eax, eax
mov dword [0x408678], eax
jne 0x40113e
call fcn.004010d0
mov eax, dword [0x408678]
push 0
push 0
push 0
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
test eax, eax
mov dword [0x40866c], eax
jne 0x401163
call fcn.004010d0
mov eax, dword [0x40866c]
mov byte [eax + 1], 0xf6
mov ecx, dword [esi + 8]
push ecx
call fcn.0040143b
add esp, 4
mov dword [0x408670], eax
test eax, eax
jne 0x40118a
mov edx, dword [0x40866c]
mov byte [edx], 0xfc
call fcn.004010d0
lea eax, [esp + 0x2c]
push 0
lea ecx, [esp + 0x1c]
push eax
lea edx, [esp + 0x1c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x4011b2
mov eax, dword [0x40866c]
mov byte [eax], 0xfc
call fcn.004010d0
mov edx, dword [0x40866c]
xor eax, eax
mov cl, byte [edx + 3]
cmp cl, 0xa
je 0x4011d0
mov byte [esp + eax + 0x7c], cl
mov cl, byte [edx + eax + 4]
inc eax
cmp cl, 0xa
jne 0x4011c2
xor ecx, ecx
mov byte [esp + eax + 0x7c], 0
mov dword [esp + 0x1c], ecx
xor eax, eax
mov dword [esp + 0x20], ecx
lea edi, [esp + 0x38]
mov dword [esp + 0x24], ecx
push 0xfffffffffffffff6
mov dword [esp + 0x2c], ecx
mov ecx, 0x11
rep stosd dword es:[edi], eax
mov dword [esp + 0x3c], 0x44
mov dword [esp + 0x68], 0x100
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x18]
push 0
push 0
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
lea edx, [esp + 0x1c]
lea eax, [esp + 0x38]
push edx
push eax
push 0
push 0
push 0x200
push ebx
push 0
lea ecx, [esp + 0x98]
push 0
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
mov edx, dword [esp + 0x18]
mov esi, eax
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x40126f
mov eax, dword [0x40866c]
mov byte [eax], 0xfd
call fcn.004010d0
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x17]
push ebx
push edx
push eax
call esi
cmp dword [esp + 0x10], ebx
jne 0x4012dc
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov bl, 0x78
mov eax, dword [0x408670]
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x17]
push 1
push edx
push eax
call edi
mov ecx, dword [0x40866c]
mov dword [esp + 0x10], 0
cmp byte [ecx + 2], bl
je 0x4012f6
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x10]
push 0
push edx
lea eax, [esp + 0x17]
push 1
push eax
push ecx
call esi
cmp dword [esp + 0x10], 1
je 0x401297
mov edx, dword [0x40866c]
mov byte [edx], 0
call fcn.004010c0
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x840
ret
mov edx, dword [esp + 0x24]
mov edi, dword [sym.imp.KERNEL32.dll_GenerateConsoleCtrlEvent]
mov ebx, 1
push edx
push ebx
call edi
mov eax, dword [esp + 0x24]
push eax
push 0
call edi
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x17]
push ebx
push edx
push eax
call esi
test eax, eax
je 0x401348
cmp dword [esp + 0x10], ebx
jne 0x401348
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x17]
push ebx
push edx
push eax
call esi
test eax, eax
jne 0x40132a
mov esi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, 9
mov ecx, dword [esp + 0x1c]
push 0xc8
push ecx
call esi
test eax, eax
je 0x401387
mov edx, edi
dec edi
test edx, edx
jg 0x401353
test eax, eax
je 0x401387
mov eax, dword [0x40866c]
mov byte [eax], 0xfb
call fcn.004010c0
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x840
ret
mov ecx, dword [0x40866c]
mov byte [ecx], 0xfe
call fcn.004010c0
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x840
ret