Function at 0x4fa560
Capabilities:
Access peb ldr_data
Create pipe
Get process heap flags
Get process heap force flags
Read file on windows
Write file on windows
Write pipe

Disassembly:
push ebp
mov eax, 0x611
mov ebp, esp
push edi
push esi
lea esi, [ebp - 0x3c]
push ebx
lea ebx, [ebp - 0x40]
sub esp, 0x5c
mov dword [0x7efa14], 0
call fcn.004f6080
mov dword [esp + 8], 0
mov dword [esp + 4], 0xfffffffe
mov dword [esp], 0x4f5d90
call dword [sym.imp.kernel32.dll_QueueUserAPC]
sub esp, 0xc
mov dword [esp], eax
mov dword [esp + 4], str.couldnt_create_user_apc_n
call fcn.004f6800
mov eax, 0x616
mov dword [ebp - 0x38], 0xc
mov dword [ebp - 0x30], 1
mov dword [ebp - 0x34], 0
call fcn.004f6080
lea eax, [ebp - 0x38]
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
lea eax, [ebp - 0x44]
mov dword [esp + 4], eax
lea eax, [ebp - 0x48]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_CreatePipe]
mov dword [ebp - 0x4c], eax
call eax
sub esp, 0x10
test eax, eax
setne al
mov dword [esp + 4], str.CreatePipe_failed_n
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov ecx, 1
mov eax, 0x617
mov dword [esp + 8], 1
mov dword [esp + 4], 0x1000
mov dword [esp], 0x1000
mov edx, dword [ebp - 0x48]
call fcn.004fa410
mov dword [esp + 8], 1
xor ecx, ecx
mov eax, 0x618
mov dword [esp + 4], 0x1000
mov dword [esp], 0x1000
mov edx, dword [ebp - 0x44]
call fcn.004fa410
mov edx, dword [ebp - 0x48]
mov ecx, 0x120189
mov eax, 0x619
call fcn.004fa360
mov edx, dword [ebp - 0x44]
mov ecx, 0x120196
mov eax, 0x61b
call fcn.004fa360
mov eax, 0x61f
call fcn.004f6080
mov ecx, dword [sym.imp.kernel32.dll_WriteFile]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x16
mov dword [esp + 4], str..PiPe_tests_pipe.c
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
mov dword [ebp - 0x54], ecx
call ecx
sub esp, 0x14
mov dword [esp], eax
mov dword [esp + 4], str.Write_to_anonymous_pipe_failed_n
call fcn.004f6800
mov eax, 0x620
call fcn.004f6080
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.Write_to_anonymous_pipe_wrote__ld_bytes_n
cmp eax, 0x16
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x621
call fcn.004f6080
mov dword [esp + 0xc], esi
lea esi, [ebp - 0x2c]
mov edi, dword [sym.imp.kernel32.dll_ReadFile]
mov dword [esp + 4], esi
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x20
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
mov dword [ebp - 0x50], edi
call edi
sub esp, 0x14
mov dword [esp], eax
mov dword [esp + 4], str.Read_from_non_empty_pipe_failed_n
call fcn.004f6800
mov eax, 0x622
call fcn.004f6080
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], str.Read_from__anonymous_pipe_got__ld_bytes_n
cmp eax, 0x16
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x623
call fcn.004f6080
mov eax, dword [ebp - 0x44]
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
mov dword [esp + 4], str.CloseHandle_for_the_write_pipe_failed_n
call fcn.004f6800
mov eax, 0x624
call fcn.004f6080
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
mov dword [esp + 4], str.CloseHandle_for_the_read_pipe_failed_n
call fcn.004f6800
mov eax, 0x627
call fcn.004f6080
lea edx, [ebp - 0x38]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
lea edx, [ebp - 0x44]
mov dword [esp + 4], edx
lea edx, [ebp - 0x48]
mov dword [esp], edx
mov eax, dword [ebp - 0x4c]
call eax
sub esp, 0x10
test eax, eax
setne al
mov dword [esp + 4], str.CreatePipe_failed_n
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x628
call fcn.004f6080
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x16
mov dword [esp + 4], str..PiPe_tests_pipe.c
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
mov ecx, dword [ebp - 0x54]
call ecx
sub esp, 0x14
mov dword [esp], eax
mov dword [esp + 4], str.Write_to_anonymous_pipe_failed_n
call fcn.004f6800
mov eax, 0x629
call fcn.004f6080
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.Write_to_anonymous_pipe_wrote__ld_bytes_n
cmp eax, 0x16
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x62b
call fcn.004f6080
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
mov dword [esp + 4], str.CloseHandle_for_the_Write_Pipe_failed_n
call fcn.004f6800
mov eax, 0x62c
call fcn.004f6080
lea eax, [ebp - 0x3c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 8], 0x20
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call edi
sub esp, 0x14
mov dword [esp], eax
mov dword [esp + 4], str.Read_from_broken_pipe_with_pending_data_failed_n
call fcn.004f6800
mov eax, 0x62d
call fcn.004f6080
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], str.Read_from_anonymous_pipe_got__ld_bytes_n
cmp eax, 0x16
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x62f
call fcn.004f6080
lea eax, [ebp - 0x3c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 8], 0x20
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call edi
sub esp, 0x14
test eax, eax
sete al
mov dword [esp + 4], str.Broken_pipe_not_detected_n
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x630
call fcn.004f6080
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
mov dword [esp + 4], str.CloseHandle_for_the_read_pipe_failed_n
call fcn.004f6800
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov edi, eax
sub esp, 0xc
xor eax, eax
nop
mov byte [edi + eax], al
add eax, 1
cmp eax, 0x8000
jne 0x4fa9a0
mov eax, 0x636
call fcn.004f6080
lea eax, [ebp - 0x38]
mov dword [esp + 0xc], 0x8018
mov dword [esp + 8], eax
lea eax, [ebp - 0x44]
mov dword [esp + 4], eax
lea eax, [ebp - 0x48]
mov dword [esp], eax
mov eax, dword [ebp - 0x4c]
call eax
sub esp, 0x10
test eax, eax
setne al
mov dword [esp + 4], str.CreatePipe_failed_n
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x637
call fcn.004f6080
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x8000
mov dword [esp + 4], edi
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
mov eax, dword [ebp - 0x54]
call eax
sub esp, 0x14
mov dword [esp], eax
mov dword [esp + 4], str.Write_to_anonymous_pipe_failed_n
call fcn.004f6800
mov eax, 0x638
call fcn.004f6080
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], str.Write_to_anonymous_pipe_wrote__ld_bytes_n
cmp eax, 0x8000
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x63a
call fcn.004f6080
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
mov dword [esp + 4], str.CloseHandle_for_the_Write_Pipe_failed_n
call fcn.004f6800
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov dword [esp], edi
call sub.msvcrt.dll_memset
mov eax, 0x63c
call fcn.004f6080
lea eax, [ebp - 0x3c]
mov dword [esp + 4], edi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x8000
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
mov eax, dword [ebp - 0x50]
call eax
sub esp, 0x14
mov dword [esp], eax
mov dword [esp + 4], str.Read_from_broken_pipe_with_pending_data_failed_n
call fcn.004f6800
mov eax, 0x63d
call fcn.004f6080
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], str.Read_from_anonymous_pipe_got__ld_bytes_n
cmp eax, 0x8000
mov dword [esp + 8], eax
sete al
xor ebx, ebx
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
lea esi, [esi]
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x63e
movzx edx, byte [edi + ebx]
mov dword [esp + 0xc], ebx
cmp dl, bl
mov dword [esp + 8], edx
sete al
mov dword [esp + 4], str.invalid_data__x_at__lx_n
add ebx, 1
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
cmp ebx, 0x8000
jne 0x4fab10
mov eax, 0x640
call fcn.004f6080
lea eax, [ebp - 0x3c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 8], 0x20
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
mov eax, dword [ebp - 0x50]
call eax
sub esp, 0x14
test eax, eax
sete al
mov dword [esp + 4], str.Broken_pipe_not_detected_n
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x641
call fcn.004f6080
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
mov dword [esp + 4], str.CloseHandle_for_the_read_pipe_failed_n
call fcn.004f6800
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, 0x644
sub esp, 0xc
call fcn.004f6080
mov dword [esp + 4], str.user_apc_ran__pipe_using_alertable_io_mode_n
xor eax, eax
mov edx, dword [0x7efa14]
test edx, edx
sete al
mov dword [esp], eax
call fcn.004f6800
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_SleepEx]
mov eax, 0x647
sub esp, 8
call fcn.004f6080
lea eax, [ebp - 0x38]
mov dword [esp + 0xc], 1
mov dword [esp + 8], eax
lea eax, [ebp - 0x44]
mov dword [esp + 4], eax
lea eax, [ebp - 0x48]
mov dword [esp], eax
mov eax, dword [ebp - 0x4c]
call eax
sub esp, 0x10
test eax, eax
setne al
mov dword [esp + 4], str.CreatePipe_failed_n
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov ecx, 1
mov eax, 0x648
mov dword [esp + 8], 1
mov dword [esp + 4], 1
mov dword [esp], 1
mov edx, dword [ebp - 0x48]
call fcn.004fa410
mov dword [esp + 8], 1
xor ecx, ecx
mov eax, 0x649
mov dword [esp + 4], 1
mov dword [esp], 1
mov edx, dword [ebp - 0x44]
call fcn.004fa410
mov eax, 0x64a
call fcn.004f6080
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp], eax
mov dword [esp + 4], str.CloseHandle_for_the_Write_Pipe_failed_n
call fcn.004f6800
mov eax, 0x64b
call fcn.004f6080
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp + 4], str.CloseHandle_for_the_read_pipe_failed_n
mov dword [esp], eax
call fcn.004f6800
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret