Function at 0x407640
Capabilities:
Accept command line arguments
Create pipe
Read file on windows
Read pipe
Write file on windows
Write pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xec
mov eax, dword [0x424308]
xor eax, ebp
mov dword [ebp - 4], eax
mov al, byte [ebp + 0x10]
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0xc0], edi
mov byte [ebp - 0x90], al
cmp esi, 2
jge 0x40768e
mov ecx, dword [ebp - 0x90]
push ecx
call fcn.00405600
add esp, 4
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004104b1
mov esp, ebp
pop ebp
ret
mov edx, dword [edi + 4]
push 0x41e888
push edx
call fcn.00411acc
add esp, 8
test eax, eax
je 0x407c70
mov eax, dword [edi + 4]
push 0x41e87c
push eax
call fcn.00411acc
add esp, 8
test eax, eax
je 0x407c70
mov ecx, dword [edi + 4]
push 0x41e870
push ecx
call fcn.00411acc
add esp, 8
test eax, eax
je 0x407c70
mov edx, dword [edi + 4]
push 0x41e860
push edx
call fcn.00411acc
add esp, 8
test eax, eax
je 0x407c70
push ebx
push 0x3a
push 0x2f
push edi
push esi
lea ecx, [ebp - 0xb4]
call fcn.00407450
push 0x41e850
lea ecx, [ebp - 0xb4]
call fcn.00406070
xor ebx, ebx
test al, al
je 0x4077b6
push 0xffffffffffffffff
push 0x41e850
lea ecx, [ebp - 0x30]
call fcn.00401300
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0xa4]
call fcn.00406da0
mov eax, dword [eax]
cmp eax, ebx
jne 0x407747
mov eax, 0x421594
push ebx
lea ecx, [ebp - 0xb8]
push ecx
push 0x41e378
push eax
lea ecx, [ebp - 0xbc]
call fcn.00401a30
lea ecx, [ebp - 0x30]
call fcn.00401000
mov eax, dword [ebp - 0xbc]
cmp eax, 0xffffffff
je 0x4077b6
push 0x41e84c
push 1
push eax
call fcn.0041182c
add esp, 8
push eax
call fcn.004112e7
mov esi, eax
mov ecx, 8
lea edi, [ebp - 0xec]
add esp, 8
rep movsd dword es:[edi], dword [esi]
call fcn.00411132
lea edi, [eax + 0x20]
mov ecx, 8
lea esi, [ebp - 0xec]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebp - 0xc0]
mov esi, dword [ebp - 0x90]
push 1
push esi
lea edx, [ebp - 0x94]
push edx
lea ecx, [ebp - 0x8c]
mov dword [ebp - 0x94], 0x8007139f
call fcn.00402a50
lea ecx, [ebp - 0x8c]
call fcn.00405820
test al, al
jne 0x407a8c
mov eax, dword [ebp - 0x94]
cmp eax, 0x80070005
jne 0x407a28
lea eax, [ebp - 0x24]
xor ecx, ecx
mov esi, 1
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x28], esi
mov word [ebp - 0x24], cx
call dword [sym.imp.KERNEL32.DLL_GetCurrentProcessId]
push eax
lea edx, [ebp - 0x30]
push 0x41e808
push edx
call fcn.00405d80
mov eax, dword [ebp - 0x30]
add esp, 0xc
cmp eax, ebx
jne 0x40783a
mov eax, 0x421594
push ebx
push 0x8000
push 0x8000
push ebx
push esi
push ebx
push 3
push eax
call dword [sym.imp.KERNEL32.DLL_CreateNamedPipeW]
mov edi, eax
xor ecx, ecx
lea eax, [ebp - 0x50]
mov dword [ebp - 0x54], esi
mov esi, dword [sym.imp.KERNEL32.DLL_GetCommandLineW]
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], ebx
mov word [ebp - 0x50], cx
cmp edi, 0xffffffff
jne 0x40788e
call esi
push 0x3e
push eax
call fcn.0040ffaa
add esp, 8
test eax, eax
je 0x40788e
call esi
push eax
lea ecx, [ebp - 0x5c]
call fcn.00405310
jmp 0x4078af
mov eax, dword [ebp - 0x30]
cmp eax, ebx
jne 0x40789a
mov eax, 0x421594
push eax
call esi
push eax
lea edx, [ebp - 0x5c]
push 0x41e7e8
push edx
call fcn.00405d80
add esp, 0x10
mov eax, dword [ebp - 0x5c]
cmp eax, ebx
jne 0x4078bb
mov eax, 0x421594
push ebx
lea ecx, [ebp - 0x94]
push ecx
push 0x41e7dc
push eax
lea ecx, [ebp - 0xdc]
call fcn.00406030
mov eax, dword [ebp - 0x94]
cmp eax, ebx
jge 0x407931
push eax
lea edx, [ebp - 0x88]
push edx
call fcn.00401020
mov eax, dword [ebp - 0x88]
add esp, 8
cmp eax, ebx
jne 0x4078fd
mov eax, 0x421594
push eax
push 0x41e7b8
call fcn.004103f4
add esp, 8
lea ecx, [ebp - 0x88]
call fcn.00401000
lea ecx, [ebp - 0xdc]
call fcn.004055b0
lea ecx, [ebp - 0x5c]
call fcn.00401000
lea ecx, [ebp - 0x30]
jmp 0x407a5b
mov eax, dword [ebp - 0xdc]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.DLL_WaitForSingleObject]
push ebx
lea ecx, [ebp - 0x90]
push ecx
push ebx
push ebx
push ebx
push edi
mov dword [ebp - 0x90], ebx
call dword [sym.imp.KERNEL32.DLL_PeekNamedPipe]
mov eax, dword [ebp - 0x90]
cmp eax, ebx
je 0x4079f4
push ebx
push eax
lea ecx, [ebp - 0xcc]
mov dword [ebp - 0xcc], ebx
mov dword [ebp - 0xc8], ebx
mov dword [ebp - 0xc4], ebx
call fcn.004019e0
mov eax, dword [ebp - 0x90]
mov esi, dword [ebp - 0xcc]
push ebx
lea edx, [ebp - 0x90]
push edx
push eax
push esi
push edi
call dword [sym.imp.KERNEL32.DLL_ReadFile]
mov edx, dword [ebp - 0x90]
push ebx
lea ecx, [ebp - 0x90]
push ecx
push edx
push esi
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.DLL_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.DLL_WriteFile]
cmp esi, ebx
je 0x4079ce
push esi
call fcn.0041021f
add esp, 4
push ebx
lea eax, [ebp - 0x90]
push eax
push ebx
push ebx
push ebx
push edi
mov dword [ebp - 0x90], ebx
call dword [sym.imp.KERNEL32.DLL_PeekNamedPipe]
mov eax, dword [ebp - 0x90]
cmp eax, ebx
jne 0x407966
push edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [ebp - 0xdc]
call fcn.004055e0
lea ecx, [ebp - 0xdc]
mov esi, eax
call fcn.004055b0
lea ecx, [ebp - 0x5c]
call fcn.00401000
lea ecx, [ebp - 0x30]
call fcn.00401000
jmp 0x407b7e
push eax
lea ecx, [ebp - 0x88]
push ecx
call fcn.00401020
mov eax, dword [ebp - 0x88]
add esp, 8
cmp eax, ebx
jne 0x407a47
mov eax, 0x421594
push eax
push 0x41e788
call fcn.004103f4
add esp, 8
lea ecx, [ebp - 0x88]
call fcn.00401000
lea ecx, [ebp - 0x8c]
call fcn.00403970
lea ecx, [ebp - 0xb4]
call fcn.00407410
pop ebx
pop edi
mov eax, 1
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004104b1
mov esp, ebp
pop ebp
ret
mov edx, dword [edi + 4]
push 0x41e77c
push edx
call fcn.00411acc
add esp, 8
test eax, eax
jne 0x407ae7
cmp dword [ebp + 8], 3
jl 0x407ad2
mov eax, dword [edi + 8]
push 0x41e768
push eax
call fcn.00411acc
add esp, 8
test eax, eax
jne 0x407ad2
lea ecx, [ebp - 0x8c]
push 1
push ecx
call fcn.00407090
add esp, 8
jmp 0x407b7c
lea edx, [ebp - 0x8c]
push ebx
push edx
call fcn.00407090
add esp, 8
jmp 0x407b7c
mov eax, dword [edi + 4]
push 0x41e750
push eax
call fcn.00411acc
add esp, 8
test eax, eax
jne 0x407b49
push 0x41e734
call fcn.004103f4
add esp, 4
push 0x41e730
lea ecx, [ebp - 0xb8]
push ecx
lea ecx, [ebp - 0x8c]
call fcn.00402970
lea ecx, [ebp - 0x8c]
call fcn.00403970
lea ecx, [ebp - 0xb4]
call fcn.00407410
pop ebx
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004104b1
mov esp, ebp
pop ebp
ret
mov edx, dword [edi + 4]
push 0x41e720
push edx
call fcn.00411acc
add esp, 8
test eax, eax
jne 0x407ba7
cmp dword [ebp + 8], 3
jl 0x407b69
mov edi, dword [edi + 8]
jmp 0x407b6b
xor edi, edi
push ebx
lea eax, [ebp - 0x8c]
push edi
push eax
call fcn.00407160
add esp, 0xc
mov esi, eax
lea ecx, [ebp - 0x8c]
call fcn.00403970
lea ecx, [ebp - 0xb4]
call fcn.00407410
pop ebx
pop edi
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004104b1
mov esp, ebp
pop ebp
ret
mov ecx, dword [edi + 4]
push 0x41e70c
push ecx
call fcn.00411acc
add esp, 8
test eax, eax
jne 0x407beb
cmp dword [ebp + 8], 3
jl 0x407bd7
mov edi, dword [edi + 8]
lea edx, [ebp - 0x8c]
push edi
push edx
call fcn.004072a0
add esp, 8
jmp 0x407b7c
xor edi, edi
lea edx, [ebp - 0x8c]
push edi
push edx
call fcn.004072a0
add esp, 8
jmp 0x407b7c
mov ecx, dword [ebp - 0xb0]
sub ecx, dword [ebp - 0xb4]
mov eax, 0x2e8ba2e9
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 1
jae 0x407c1b
push esi
call fcn.00405600
add esp, 4
jmp 0x407b7c
push 0x41e704
push 0x41e700
push 0x41e6f4
lea ecx, [ebp - 0xb4]
call fcn.00406f30
push eax
call fcn.00411127
add esp, 4
push eax
push ebx
push 1
lea ecx, [ebp - 0xb4]
call fcn.00405960
push eax
push ebx
push ebx
lea ecx, [ebp - 0xb4]
call fcn.00405960
push eax
lea ecx, [ebp - 0x8c]
push ecx
call fcn.00405b30
add esp, 0x10
jmp 0x407b7c
mov edx, dword [ebp - 0x90]
push edx
call fcn.00405600
mov ecx, dword [ebp - 4]
add esp, 4
pop edi
xor ecx, ebp
pop esi
call fcn.004104b1
mov esp, ebp
pop ebp
ret