Function at 0x404807
Capabilities:
Create pipe
Create process on windows
Get common file path
Read file on windows
Terminate process

Disassembly:
mov eax, 0x17e4
call fcn.00413d20
mov eax, dword [0x455834]
xor eax, esp
mov dword [esp + 0x17e0], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x17f4]
lea eax, [esp + 0x2c]
push edi
push 0xc
pop edi
push edi
xor ebx, ebx
push ebx
push eax
call fcn.00415560
add esp, 0xc
mov dword [esp + 0x30], edi
lea eax, [esp + 0x30]
xor ebp, ebp
inc ebp
mov dword [esp + 0x38], ebp
push ebx
push eax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_CreatePipe]
test eax, eax
jne 0x40487b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreatePipe_error___d_
call fcn.0040f3f5
xor eax, eax
jmp 0x404a2d
push ebx
push ebp
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_SetHandleInformation]
test eax, eax
jne 0x404899
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetHandleInformation_error___d_
jmp 0x40486f
push 0x10
lea eax, [esp + 0x24]
push ebx
push eax
call fcn.00415560
push 0x44
pop edi
push edi
lea eax, [esp + 0x4c]
push ebx
push eax
call fcn.00415560
mov eax, dword [esp + 0x2c]
or dword [esp + 0x80], 0x100
push 0x2ee0
mov dword [esp + 0x58], edi
mov dword [esp + 0x98], eax
mov dword [esp + 0x94], eax
mov dword [esp + 0x90], ebx
call fcn.004137f4
add esp, 0x1c
mov ebp, eax
push 0x1770
push ebp
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push esi
push str._system32cmd.exe__C_for___I_in____s___do__echo___sI
push ebp
call fcn.0041f337
pop ecx
lea eax, [eax*2]
add eax, ebp
push eax
call fcn.00403b2b
push ebp
push str.executing__s
call fcn.0040f3f5
add esp, 0x14
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x40]
push eax
push ebx
push ebx
push 0x8000000
push 1
push ebx
push ebx
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x404965
push str.could_not_execute_cmd.exe
call fcn.0040f3f5
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ecx
push dword [esp + 0x14]
call esi
push dword [esp + 0x10]
call esi
jmp 0x404a23
push dword [esp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push ebx
lea eax, [esp + 0x1c]
mov esi, ebx
push eax
push 0x1770
lea eax, [esp + 0x8c]
jmp 0x4049ac
cmp dword [esp + 0x18], ebx
je 0x4049bb
mov ecx, 0x1770
cmp esi, ecx
jae 0x4049bb
add esi, dword [esp + 0x18]
lea eax, [esp + 0x18]
push ebx
push eax
sub ecx, esi
lea eax, [esp + 0x88]
push ecx
add eax, esi
push eax
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x404987
lea eax, [esp + 0x80]
push eax
push esi
push str.finished_reading_from_cmd.exe__d___S_
call fcn.0040f3f5
add esp, 0xc
push dword [esp + 0x10]
call edi
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
push dword [esp + 0x1c]
push str.Exit_Code__d
call fcn.0040f3f5
cmp dword [esp + 0x24], 0x103
pop ecx
pop ecx
jne 0x404a48
push str.Terminating_process
call fcn.0040f3f5
pop ecx
push 1
push dword [esp + 0x24]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push dword [esp + 0x20]
call edi
push dword [esp + 0x24]
call edi
push 2
push ebp
call fcn.004137e6
mov eax, ebx
pop ecx
pop ecx
mov ecx, dword [esp + 0x17f0]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00413c4b
add esp, 0x17e4
ret
cmp dword [esp + 0x1c], ebx
jne 0x404a17
cmp esi, 5
jbe 0x404a17
mov eax, ebx
mov cl, byte [esp + eax + 0x80]
cmp cl, 0xa
je 0x404a6d
cmp cl, 0xd
je 0x404a6d
inc eax
cmp eax, esi
jb 0x404a55
jmp 0x404a17
cmp eax, 0x1770
jae 0x404aa5
mov byte [esp + eax + 0x80], bl
inc eax
push eax
call fcn.004137f4
mov ebx, eax
lea eax, [esp + 0x84]
push eax
push ebx
call fcn.0041f650
push ebx
push str.Using__S
call fcn.0040f3f5
add esp, 0x14
jmp 0x404a17
call fcn.00413b70
int3