Function at 0x474c70
Capabilities:
Create pipe
Create process on windows
Read file on windows
Resolve function by parsing pe exports
Terminate process

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x204c
call sym.__alloca
mov eax, dword [0x506418]
mov dword [esp + 0x2c], eax
shr eax, 1
and eax, 0x40000000
xor eax, 0x40080001
sub esp, 0x20
movaps xmm0, xmmword [0x4f7ad0]
movups xmmword [esp + 8], xmm0
mov dword [esp + 4], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp], str..pipeLOCAL_
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov edi, eax
cmp eax, 0xffffffff
je 0x47514c
mov dword [esp + 0x30], 0xc
mov dword [esp + 0x34], 0
mov dword [esp + 0x38], 1
lea eax, [esp + 0x30]
push 0
push 0
push 3
push eax
push 0
push 0x40000000
push str..pipeLOCAL_
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x475153
mov dword [esp + 0x24], edi
movzx ecx, byte [esp + 0x2068]
mov edi, dword [esp + 0x2064]
xorps xmm0, xmm0
movups xmmword [esp + 0x3c], xmm0
movups xmmword [esp + 0x70], xmm0
movups xmmword [esp + 0x80], xmm0
movups xmmword [esp + 0x60], xmm0
movups xmmword [esp + 0x50], xmm0
mov dword [esp + 0x4c], 0x44
mov dword [esp + 0x78], 0x100
movzx ecx, cl
mov dword [esp + 0x1c], eax
mov dword [esp + ecx*4 + 0x88], eax
mov eax, dword [edi]
sub esp, 0xc
mov dword [esp + 8], eax
lea eax, [esp + 0x14]
mov dword [esp], eax
call dbg.ffStrbufCreateF
add esp, 0xc
cmp dword [edi + 4], 0
je 0x474f19
add edi, 4
jmp 0x474db1
mov ecx, dword [esp + 0x10]
add ebp, ecx
push ebx
push esi
push ebp
call sym._memcpy
add esp, 0xc
add ebx, dword [esp + 0xc]
mov dword [esp + 0xc], ebx
mov eax, dword [esp + 0x10]
mov byte [eax + ebx], 0
cmp dword [edi + 4], 0
lea edi, [edi + 4]
je 0x474f19
mov eax, dword [esp + 8]
mov esi, dword [esp + 0xc]
test eax, eax
je 0x474dc4
lea ecx, [esi + 1]
cmp eax, ecx
jne 0x474e10
cmp eax, 2
mov ecx, eax
mov edx, 0x20
cmovb ecx, edx
lea edx, [esi + 2]
nop word cs:[eax + eax]
mov ebp, ecx
add ecx, ecx
cmp edx, ebp
ja 0x474de0
test eax, eax
je 0x474e20
push ebp
push dword [esp + 0x14]
call sym._realloc
add esp, 8
mov ebx, eax
mov dword [esp + 0x10], eax
mov esi, dword [esp + 0xc]
jmp 0x474e49
mov ebx, dword [esp + 0x10]
jmp 0x474e50
push ebp
call sym._malloc
add esp, 4
mov ebx, eax
test esi, esi
je 0x474e42
lea eax, [esi + 1]
push eax
push dword [esp + 0x14]
push ebx
call sym._memcpy
add esp, 0xc
jmp 0x474e45
mov byte [ebx], 0
mov dword [esp + 0x10], ebx
mov dword [esp + 8], ebp
lea ecx, [esi + 1]
mov dword [esp + 0xc], ecx
mov byte [ebx + esi], 0x20
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov byte [ecx + eax], 0
mov esi, dword [edi]
test esi, esi
je 0x474da4
push esi
call sym._strlen
add esp, 4
test eax, eax
je 0x474da4
mov ebx, eax
mov eax, dword [esp + 8]
mov ebp, dword [esp + 0xc]
test eax, eax
je 0x474e9b
mov ecx, ebp
not ecx
add ecx, eax
cmp ecx, ebx
jae 0x474d83
cmp eax, 2
mov ecx, eax
mov edx, 0x20
cmovb ecx, edx
mov dword [esp + 4], ebp
lea edx, [ebx + ebp]
inc edx
mov ebp, ecx
add ecx, ecx
cmp edx, ebp
ja 0x474eb0
test eax, eax
je 0x474ed9
push ebp
push dword [esp + 0x14]
call sym._realloc
add esp, 8
mov ecx, eax
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0xc]
mov dword [esp + 4], eax
jmp 0x474f0c
push ebp
call sym._malloc
add esp, 4
mov ecx, eax
mov eax, dword [esp + 4]
test eax, eax
je 0x474f05
inc eax
push eax
push dword [esp + 0x14]
push ecx
mov dword [esp + 0xc], ecx
call sym._memcpy
mov ecx, dword [esp + 0xc]
add esp, 0xc
jmp 0x474f08
mov byte [ecx], 0
mov dword [esp + 0x10], ecx
mov dword [esp + 8], ebp
mov ebp, dword [esp + 4]
jmp 0x474d87
mov eax, dword [esp + 0x10]
sub esp, 0x28
lea ecx, [esp + 0x64]
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x74]
mov dword [esp + 0x20], ecx
movaps xmm0, xmmword [0x4f7ae0]
movups xmmword [esp + 8], xmm0
mov dword [esp + 4], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
mov ebx, eax
cmp dword [esp + 8], 0
mov dword [esp + 0xc], 0
je 0x474f82
mov dword [esp + 8], 0
push dword [esp + 0x10]
call sym._free
add esp, 4
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
mov edi, dword [esp + 0x24]
je 0x47515a
mov ebp, dword [esp + 0x2060]
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], 0
xorps xmm0, xmm0
movups xmmword [esp + 8], xmm0
mov dword [esp + 0x18], 0
lea ebx, [esp + 0x4c]
jmp 0x475012
mov dword [esp + 4], ebp
mov dword [esp], 0
mov ebp, dword [esp + 0x2060]
mov ebx, dword [ebp + 8]
mov eax, dword [esp + 4]
add eax, ebx
push esi
lea ebx, [esp + 0x50]
push ebx
push eax
call sym._memcpy
add esp, 0xc
add esi, dword [ebp + 4]
mov dword [ebp + 4], esi
mov eax, dword [ebp + 8]
mov byte [eax + esi], 0
cmp dword [esp + 0x20], 0
je 0x475191
lea eax, [esp + 8]
push eax
lea eax, [esp + 0x24]
push eax
push 0x2000
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x475081
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x47516a
mov esi, str.WaitForSingleObject_hChildPipeRead__failed_or_timeout
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x47517b
mov dword [esp], 0
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x47517b
push 0
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x10]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x4751d6
mov esi, dword [esp + 0x20]
test esi, esi
je 0x475161
mov eax, dword [ebp]
mov ebp, dword [ebp + 4]
test eax, eax
je 0x4750a5
mov ecx, ebp
not ecx
add ecx, eax
cmp ecx, esi
jae 0x474fd0
cmp eax, 2
mov ecx, eax
mov edx, 0x20
cmovb ecx, edx
lea edx, [esi + ebp]
inc edx
nop word cs:[eax + eax]
mov edi, ecx
add ecx, ecx
cmp edx, edi
ja 0x4750c0
test eax, eax
je 0x475100
mov dword [esp], 0
push edi
mov ebp, dword [esp + 0x2064]
push dword [ebp + 8]
call sym._realloc
add esp, 8
mov ebx, eax
mov dword [ebp + 8], eax
mov eax, dword [ebp + 4]
mov dword [esp + 4], eax
jmp 0x475140
mov dword [esp], 0
push edi
call sym._malloc
add esp, 4
mov ebx, eax
test ebp, ebp
mov dword [esp + 4], ebp
je 0x475133
lea eax, [ebp + 1]
push eax
mov ebp, dword [esp + 0x2064]
push dword [ebp + 8]
push ebx
call sym._memcpy
add esp, 0xc
jmp 0x47513d
mov byte [ebx], 0
mov ebp, dword [esp + 0x2060]
mov dword [ebp + 8], ebx
mov dword [ebp], edi
mov edi, dword [esp + 0x24]
jmp 0x474fe5
mov esi, str.CreateNamedPipeW_L_.pipeLOCAL___failed
jmp 0x4751ba
mov esi, str.CreateFileW_L_.pipeLOCAL___failed
jmp 0x4751ba
mov esi, str.CreateProcessA___failed
jmp 0x4751ba
mov dword [esp], 0
jmp 0x475191
mov dword [esp], 0
mov esi, str.ReadFile_hChildPipeRead__failed
cmp eax, 0x6d
je 0x475191
push edi
call dword [sym.imp.KERNEL32.dll_CancelIo]
push 1
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov dword [esp], esi
mov ecx, dword [esp + 0x28]
lea eax, [ecx + 1]
cmp eax, 2
jb 0x4751a4
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x1c]
lea eax, [ecx + 1]
cmp eax, 2
jb 0x4751b7
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp]
mov eax, edi
inc eax
cmp eax, 2
jb 0x4751c9
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
add esp, 0x204c
pop esi
pop edi
pop ebx
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, str.GetOverlappedResult_hChildPipeRead__failed
cmp eax, 0x6d
jne 0x47517b
jmp 0x475191