Hi,

what is the best method to retirve a console child application output, is it with using the CreatePipe or _pipe function (or are they, the same ?) ?

I've create two pipes with the CreatePipe Api. One for reading the input and the other one for the output..., and test it on a small program, ( a program that use printf to display something on the screen and wait for the char 'q' to quit) but it didn't work, though it work on "ml.exe" the masm assembler, like the iczelion tut, how this could be happen ...?

Or can someone give me an example, to how to deal with input and output, 'cause the iczelion deal only with the output...

thanks,
Posted on 2001-08-16 19:09:40 by BlackHorus
it's all pretty straight forward... redirect the stdout/stderr handles to one pipe and stdin to the other... the read from the pipe that does stdout/stderr and write to the other one... but my tip would be to run two threads.. one that does the input and one that does the output... that way you can do it a bit more continuosly (sp?) when i get home i could post the source to a backdoor kind thing ,based on tini.exe by arne widstrom (or whateverhis name is) from ntsecurity.nu, it uses pipes to read and write from/to a cmd.exe or command.com run on a remote machine over the network of your choice... it was origianlly ment to be a telnet server but i kinda lost interest...
Posted on 2001-08-17 05:09:38 by NervGaz
>Or can someone give me an example, to how to deal with input >and output, 'cause the iczelion deal only with the output...

What's your email:confused:

vesa
Posted on 2001-08-17 05:34:38 by vesa

>Or can someone give me an example, to how to deal with input >and output, 'cause the iczelion deal only with the output...

What's your email:confused:

vesa


settle down... when i get home i'll post the source... it's uncommented put pretty staright forward... i guess if you would wait a few days ('til i get time that is) i could comment it too
Posted on 2001-08-17 06:50:06 by NervGaz
NervGaz,
actually I replied to BlackHorus and offered him
a sample of pipe. I didn't quote his text clearly enough.

vesa
Posted on 2001-08-17 07:33:06 by vesa
ok... i suppose i got a bit confused 'cause i see that now... hehe shit happens or so they say... :)
Posted on 2001-08-17 07:55:37 by NervGaz
thanks for all,

i was asking what's the best method to use to create pipes
is it by using the _pipe() function, or the Api one CreatPipe()...?

How does it come, that the iczelion' prog (tut21) don't retrive the output of my little test proggie though it capture the output of "ml.exe" ?



My e-mail is :
BlackHorus@caramail.com
Posted on 2001-08-17 18:25:56 by Black Horus
If I know my stuff right :), _pipe is a libc function that wraps around
CreatePipe. So, use CreatePipe. In you C printf app, the problem
might be the lack of a \n in your output string. If you do NOT want
a \n, try doing a fflush(stdout).
Posted on 2001-08-17 20:33:53 by f0dder
Could you vesa and/or NervGaz mail me the example of using pipe or post it here?

my mail is: sami.paju@raa.to

Thanks.
Posted on 2001-08-29 00:13:40 by SamiP
heh... w00ps... i was supposed to do that wasn't i?.. hmmm I forgot.. oh well i'll try to remeber to post it tonight...
Posted on 2001-08-29 01:52:42 by NervGaz
here we go... the code loks like sh*t and is far from finished... but i think you'll understand the pipe part... oh yeah no comments either
Posted on 2001-08-29 14:45:35 by NervGaz