Function at 0x409c70
Capabilities:
Connect pipe
Create pipe
Read file on windows
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40a1d0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xf8
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x28], ebx
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov ebx, dword [ebp + 8]
push dword [ebx + 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
pxor xmm0, xmm0
movq qword [ebp - 0x88], xmm0
movq qword [ebp - 0x80], xmm0
mov dword [ebp - 0x78], 0
lea eax, [ebp - 0x88]
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
lea edx, [ebp - 0x88]
xor eax, eax
push eax
push eax
push 1
push edx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
xor eax, eax
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x5c], 0xc
lea eax, [ebp - 0x88]
mov dword [ebp - 0x58], eax
push str.CtrlCmdEvent
lea edx, [ebp - 0x5c]
push 1
push 0
push edx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebx + 0x50], eax
lea eax, [ebx + 8]
mov edx, dword [eax + 0x18]
cmp edx, 8
jb 0x409d25
mov esi, dword [ebx + 0xc]
jmp 0x409d28
lea esi, [ebx + 0xc]
pxor xmm0, xmm0
movq qword [ebp - 0x9c], xmm0
movq qword [ebp - 0x94], xmm0
mov dword [ebp - 0x8c], 0
lea eax, [ebp - 0x9c]
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
lea edx, [ebp - 0x9c]
xor eax, eax
push eax
push eax
push 1
push edx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
xor eax, eax
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x68], 0xc
lea eax, [ebp - 0x9c]
xor edx, edx
mov dword [ebp - 0x64], eax
lea ecx, [ebp - 0x68]
push esi
push edx
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebx + 0x54], eax
mov eax, dword [ebx + 0x44]
mov dword [ebp - 0x18], eax
pxor xmm0, xmm0
movq qword [ebp - 0xb0], xmm0
movq qword [ebp - 0xa8], xmm0
mov dword [ebp - 0xa0], 0
lea eax, [ebp - 0xb0]
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
lea edx, [ebp - 0xb0]
xor eax, eax
push eax
push eax
push 1
push edx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
xor eax, eax
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x6c], eax
mov dword [ebp - 0x74], 0xc
lea eax, [ebp - 0xb0]
xor edx, edx
mov dword [ebp - 0x70], eax
lea ecx, [ebp - 0x74]
push edx
push edx
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebx + 0x4c], 0
mov dword [ebp - 0x14], eax
lea eax, [ebx + 0x28]
mov dword [ebp - 0x24], eax
mov eax, dword [ebx + 0x4c]
test eax, eax
je 0x40a0e6
lea eax, [ebp - 0x18]
push 0xffffffffffffffff
push 0
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
je 0x409fbe
cmp eax, 1
jne 0x409e15
mov eax, dword [ebx]
test eax, eax
je 0x40a09f
mov dword [ebp - 4], 1
xor eax, eax
mov dword [ebp - 0xcc], eax
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xec], eax
mov dword [ebp - 0xd4], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], eax
lea edx, [ebp - 0xd0]
lea eax, [ebp - 0x1c]
push 0
push eax
push 8
push edx
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a036
mov esi, dword [ebp - 0xcc]
test esi, esi
jbe 0x409f23
mov eax, dword [ebp - 0xb4]
test eax, eax
je 0x409ec8
lea edx, [ebp - 0xc8]
cmp eax, edx
je 0x409ec8
lea eax, [ebp - 0xb4]
add esp, 0xfffffff8
mov dword [esp], eax
mov dword [esp + 4], esi
call fcn.0040a200
add esp, 8
cmp esi, 0x14
ja 0x40a0c6
lea eax, [ebp - 0xc8]
mov dword [ebp - 0xb4], eax
mov dword [ebp - 0xcc], esi
xor edi, edi
mov eax, 0x10000
mov ecx, dword [ebp - 0xb4]
lea edx, [ebp - 0x1c]
add ecx, edi
sub esi, edi
cmp esi, 0x10000
cmovae esi, eax
push 0
push edx
push esi
push ecx
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40a02a
add edi, dword [ebp - 0x1c]
mov esi, dword [ebp - 0xcc]
cmp edi, esi
jb 0x409ee5
lea edx, [ebp - 0xd0]
lea eax, [ebp - 0xf0]
push eax
push edx
push dword [ebx + 4]
call dword [ebx]
lea edx, [ebp - 0xf0]
lea eax, [ebp - 0x20]
push 0
push eax
push 8
push edx
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a036
mov eax, dword [ebp - 0xec]
test eax, eax
jbe 0x409fad
mov edx, dword [ebp - 0xd4]
test edx, edx
je 0x40a03c
xor esi, esi
mov edx, 0x10000
mov edi, dword [ebp - 0xd4]
lea ecx, [ebp - 0x20]
add edi, esi
sub eax, esi
cmp eax, 0x10000
cmovae eax, edx
push 0
push ecx
push eax
push edi
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a0d5
add esi, dword [ebp - 0x20]
mov eax, dword [ebp - 0xec]
cmp esi, eax
jb 0x409f70
mov eax, dword [ebp - 0xf0]
cmp eax, 2
je 0x409e6e
jmp 0x40a036
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x14]
mov dword [ebx + 0x4c], 0
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebx + 0x54]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebx + 0x50]
mov dword [ebx + 0x54], 0
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x30]
mov esi, dword [ebp - 0x2c]
mov dword [ebx + 0x50], 0
xor eax, eax
mov ebx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
cmp edi, dword [ebp - 0xcc]
jae 0x409f23
mov edx, dword [ebp - 0xd4]
mov dword [ebp - 4], 0
test edx, edx
je 0x40a06f
lea eax, [ebp - 0xe8]
cmp edx, eax
je 0x40a06f
mov edx, dword [ebp - 0xec]
lea eax, [ebp - 0xd4]
add esp, 0xfffffff8
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.0040a200
add esp, 8
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0xb4]
test eax, eax
je 0x40a09f
lea edx, [ebp - 0xc8]
cmp eax, edx
je 0x40a09f
push dword [ebp - 0xcc]
lea eax, [ebp - 0xb4]
push eax
call fcn.0040a200
add esp, 8
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebx + 0x4c], 0
jmp 0x409e15
push edi
mov dword [esp], esi
call fcn.00405340
pop ecx
jmp 0x409edd
cmp esi, dword [ebp - 0xec]
jb 0x40a036
jmp 0x409fad
mov eax, dword [ebx + 0x3c]
cmp eax, 8
jb 0x40a0f3
mov esi, dword [ebx + 0x28]
jmp 0x40a0f6
mov esi, dword [ebp - 0x24]
pxor xmm0, xmm0
movq qword [ebp - 0x50], xmm0
movq qword [ebp - 0x48], xmm0
mov dword [ebp - 0x40], 0
lea eax, [ebp - 0x50]
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
lea edx, [ebp - 0x50]
xor eax, eax
push eax
push eax
push 1
push edx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
xor eax, eax
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x3c], 0xc
lea eax, [ebp - 0x50]
mov dword [ebp - 0x38], eax
mov ecx, 0x10000
lea edx, [ebp - 0x3c]
push edx
push 0x1f4
push ecx
push ecx
push 1
push 0
push 0xc0000003
push esi
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov dword [ebx + 0x4c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe7
jne 0x40a17c
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40a0e6
pxor xmm0, xmm0
movq qword [ebp - 0x104], xmm0
movq qword [ebp - 0xfc], xmm0
mov dword [ebp - 0xf4], 0
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0xf4], eax
lea edx, [ebp - 0x104]
push edx
push dword [ebx + 0x4c]
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
push dword [ebx + 0x54]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x409e20