Function at 0x5089d0
Capabilities:
Create pipe

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x14c
mov eax, dword [sym.imp.kernel32.dll_CreateNamedPipeA]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x400
mov dword [esp + 0x10], 0x400
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp + 4], 3
mov dword [esp], str..PiPe_tests_pipe.c
mov dword [ebp - 0x130], eax
call eax
sub esp, 0x20
mov edi, eax
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x987
xor eax, eax
cmp edi, 0xffffffff
setne al
mov dword [esp + 4], str.cf_failed_n
mov dword [esp], eax
mov esi, dword fs:[0x18]
call fcn.004f6800
mov eax, dword [sym.imp.kernel32.dll_GetNamedPipeHandleStateA]
mov dword [esp], edi
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [ebp - 0x128], eax
call eax
sub esp, 0x1c
mov ebx, eax
mov eax, 0x989
call fcn.004f6080
mov eax, dword [esi + 0x34]
mov dword [esp], ebx
mov dword [esp + 4], str.GetNamedPipeHandleState_failed:__ld_n
mov dword [esp + 8], eax
call fcn.004f6800
lea ecx, [ebp - 0x11c]
mov dword [esp], edi
mov dword [esp + 8], ecx
lea ecx, [ebp - 0x120]
mov dword [esp + 4], ecx
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov eax, dword [ebp - 0x128]
call eax
sub esp, 0x1c
mov ebx, eax
mov eax, 0x98c
call fcn.004f6080
mov eax, dword [esi + 0x34]
mov dword [esp + 4], str.GetNamedPipeHandleState_failed:__ld_n
mov dword [esp], ebx
mov dword [esp + 8], eax
call fcn.004f6800
test ebx, ebx
jne 0x5090f8
lea eax, [ebp - 0x110]
mov ebx, dword fs:[0x18]
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x114]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x118]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x11c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x120]
mov dword [esp + 0x18], 0x104
mov dword [esp + 4], eax
mov dword [esp], edi
mov eax, dword [ebp - 0x128]
call eax
mov ecx, dword [0x8f0770]
sub esp, 0x1c
mov esi, eax
mov dword [ebp - 0x124], ecx
call fcn.0057d110
mov ecx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
lea edx, [ecx + ecx]
mov ecx, dword [ebp - 0x124]
test ecx, ecx
setne cl
movzx ecx, cl
or edx, ecx
mov dword [eax + 0x10], edx
jmp 0x508bff
call fcn.0057d110
mov dword [eax], 0x5ead94
mov dword [eax + 4], 0x999
xor eax, eax
mov edx, dword [ebx + 0x34]
test esi, esi
jne 0x508be3
xor eax, eax
cmp edx, 0x57
sete al
mov dword [esp + 8], edx
mov dword [esp], eax
mov dword [esp + 4], 0x5edf00
call fcn.004f6800
call fcn.0057d110
shr dword [eax + 0x10], 1
call fcn.0057d110
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x508bc0
lea eax, [ebp - 0x120]
mov dword [ebp - 0x12c], edx
mov dword [ebp - 0x120], 2
mov esi, dword fs:[0x18]
mov dword [esi + 0x34], 0xdeadbeef
mov dword [esp + 4], eax
mov eax, dword [sym.imp.kernel32.dll_SetNamedPipeHandleState]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp], edi
mov dword [ebp - 0x124], eax
call eax
sub esp, 0x10
mov ebx, eax
mov eax, 0x99f
call fcn.004f6080
xor eax, eax
test ebx, ebx
mov ecx, dword [esi + 0x34]
mov edx, dword [ebp - 0x12c]
jne 0x508c80
xor eax, eax
cmp ecx, 0x57
sete al
mov dword [ebp - 0x138], edx
mov dword [esp + 8], ecx
mov dword [esp], eax
mov dword [esp + 4], 0x5edf00
call fcn.004f6800
mov eax, dword [sym.imp.kernel32.dll_CreateFileA]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xc0000000
mov dword [esp], str..PiPe_tests_pipe.c
mov dword [ebp - 0x12c], eax
call eax
sub esp, 0x1c
mov ebx, eax
mov eax, 0x9a4
call fcn.004f6080
xor eax, eax
cmp ebx, 0xffffffff
mov dword [esp + 4], str.cf_failed_n
setne al
mov dword [esp], eax
mov esi, dword fs:[0x18]
call fcn.004f6800
lea eax, [ebp - 0x120]
mov dword [ebp - 0x120], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], ebx
mov eax, dword [ebp - 0x124]
call eax
sub esp, 0x10
mov dword [ebp - 0x134], eax
mov eax, 0x9a8
call fcn.004f6080
mov eax, dword [esi + 0x34]
mov dword [esp + 4], str.SetNamedPipeHandleState_failed:__ld_n
mov dword [esp + 8], eax
mov ecx, dword [ebp - 0x134]
mov dword [esp], ecx
call fcn.004f6800
lea ecx, [ebp - 0x120]
mov dword [ebp - 0x120], 2
mov dword [esi + 0x34], 0xdeadbeef
mov dword [esp + 4], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp], edi
mov eax, dword [ebp - 0x124]
call eax
mov dword [ebp - 0x134], eax
sub esp, 0x10
mov eax, 0x9ad
call fcn.004f6080
mov ecx, dword [ebp - 0x134]
mov eax, dword [esi + 0x34]
mov edx, dword [ebp - 0x138]
test ecx, ecx
jne 0x508dcf
xor edx, edx
cmp eax, 0x57
sete dl
mov dword [esp], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 0x5edf00
call fcn.004f6800
mov dword [esp], ebx
mov esi, dword [sym.imp.kernel32.dll_CloseHandle]
call esi
sub esp, 4
mov dword [esp], edi
call esi
sub esp, 4
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x400
mov dword [esp + 0x10], 0x400
mov dword [esp + 0xc], 1
mov dword [esp + 8], 4
mov dword [esp + 4], 3
mov dword [esp], str..PiPe_tests_pipe.c
mov eax, dword [ebp - 0x130]
call eax
sub esp, 0x20
mov ebx, eax
mov eax, 0x9ba
call fcn.004f6080
xor eax, eax
cmp ebx, 0xffffffff
mov dword [esp + 4], str.cf_failed_n
setne al
mov dword [esp], eax
call fcn.004f6800
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
mov eax, dword [ebp - 0x128]
call eax
sub esp, 0x1c
mov edi, eax
mov eax, 0x9bc
call fcn.004f6080
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x34]
mov dword [ebp - 0x130], edx
mov dword [esp], edi
lea edi, [ebp - 0x11c]
mov dword [esp + 8], eax
mov dword [esp + 4], str.GetNamedPipeHandleState_failed:__ld_n
call fcn.004f6800
mov dword [esp + 8], edi
lea edi, [ebp - 0x120]
mov dword [esp + 4], edi
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp], ebx
mov eax, dword [ebp - 0x128]
call eax
sub esp, 0x1c
mov edi, eax
mov eax, 0x9bf
call fcn.004f6080
mov edx, dword [ebp - 0x130]
mov eax, dword [edx + 0x34]
mov dword [esp + 4], str.GetNamedPipeHandleState_failed:__ld_n
mov dword [esp], edi
mov dword [esp + 8], eax
call fcn.004f6800
test edi, edi
jne 0x509160
mov dword [ebp - 0x120], 0
lea eax, [ebp - 0x120]
mov dword [esp], ebx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x124]
call eax
sub esp, 0x10
mov edi, eax
mov eax, 0x9ca
call fcn.004f6080
mov ecx, dword fs:[0x18]
mov eax, dword [ecx + 0x34]
mov dword [ebp - 0x128], ecx
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.SetNamedPipeHandleState_failed:__ld_n
call fcn.004f6800
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xc0000000
mov dword [esp], str..PiPe_tests_pipe.c
mov edi, dword [ebp - 0x12c]
call edi
sub esp, 0x1c
mov edi, eax
mov eax, 0x9ce
call fcn.004f6080
xor eax, eax
cmp edi, 0xffffffff
mov dword [esp + 4], str.cf_failed_n
setne al
mov dword [esp], eax
call fcn.004f6800
lea ecx, [ebp - 0x120]
mov dword [ebp - 0x120], 2
mov dword [esp + 4], ecx
mov dword [esp], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x124]
call eax
sub esp, 0x10
mov dword [ebp - 0x12c], eax
mov eax, 0x9d2
call fcn.004f6080
mov ecx, dword [ebp - 0x128]
mov eax, dword [ecx + 0x34]
mov dword [esp + 4], str.SetNamedPipeHandleState_failed:__ld_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x12c]
mov dword [esp], edx
call fcn.004f6800
lea ecx, [ebp - 0x120]
mov dword [ebp - 0x120], 0
mov dword [esp + 4], ecx
mov dword [esp], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x124]
call eax
sub esp, 0x10
mov dword [ebp - 0x124], eax
mov eax, 0x9d7
call fcn.004f6080
mov ecx, dword [ebp - 0x128]
mov eax, dword [ecx + 0x34]
mov dword [esp + 4], str.SetNamedPipeHandleState_failed:__ld_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x124]
mov dword [esp], edx
call fcn.004f6800
mov dword [esp], edi
call esi
sub esp, 4
mov dword [esp], ebx
call esi
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0x98f
call fcn.004f6080
mov eax, dword [ebp - 0x120]
mov dword [esp + 4], str.unexpected_state__08lx_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x990
call fcn.004f6080
mov eax, dword [ebp - 0x11c]
mov dword [esp + 4], str.expected_1_instances__got__ld_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
jmp 0x508b31
mov eax, 0x9c2
call fcn.004f6080
mov eax, dword [ebp - 0x120]
mov dword [esp + 4], str.unexpected_state__08lx_n
test eax, eax
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
mov eax, 0x9c3
call fcn.004f6080
mov eax, dword [ebp - 0x11c]
mov dword [esp + 4], str.expected_1_instances__got__ld_n
cmp eax, 1
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.004f6800
jmp 0x508f48