flat assembler
Message board for the users of flat assembler.

Index > Linux > [solved] Returning data from a called executable

Author
Thread Post new topic Reply to topic
eilenbeb



Joined: 17 Feb 2010
Posts: 21
eilenbeb 15 Oct 2017, 04:36
-- edit SOLVED... subject line out of chars.

Sorry, the subject line can't say enough. Out of space.
Oh yeah, hello everyone. Forgot me manners.

I'm looking to call one exec from another (both mine) and want to 'ret' a(n) (possibly sizeable) amount of data. I'm also looking to Keep It Simple. Syscalls only, most likely, don't want to pull in too many deps.

One of my more promising ideas was to use one of my libs to expose a 'get/set/clear' function to handle the data transfer then tell the callee when to terminate. Kinda hack-ish, I know. Deps, yep, but they're my deps.

Still, I'm looking for a more convienient method. Lotsa good minds out there, surely someone's come across something like this before.
And I'm not gonna stop looking. Not a help vamp, fyi, i just gotta be missing something obvious.

Ears open, gimme a shout.
laters,
b

--edit small typo


Last edited by eilenbeb on 16 Oct 2017, 00:51; edited 1 time in total
Post 15 Oct 2017, 04:36
View user's profile Send private message Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 430
Location: Australia
redsock 15 Oct 2017, 21:49
I do similar parent/child interprocess communication using the socketpair syscall. When the parent forks you can remap stdin/stdout and crosswire them, or just use standalone socketpairs, etc. Between socketpair and dup2 you have some good options IMO. I suppose it all depends on how much control you have of your child program/exec environment as to how it needs to be put together.

$0.02 thusly Smile

_________________
2 Ton Digital - https://2ton.com.au/
Post 15 Oct 2017, 21:49
View user's profile Send private message Reply with quote
eilenbeb



Joined: 17 Feb 2010
Posts: 21
eilenbeb 16 Oct 2017, 00:41
Interesting. Thanks, redsock that might be just what I'm after
Post 16 Oct 2017, 00:41
View user's profile Send private message Reply with quote
eilenbeb



Joined: 17 Feb 2010
Posts: 21
eilenbeb 16 Oct 2017, 00:54
I cannot mark this as solved. Perhaps a forum moderator could do so for me?
Post 16 Oct 2017, 00:54
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20333
Location: In your JS exploiting you and your system
revolution 16 Oct 2017, 02:18
eilenbeb: I just removed the last part of the title "looking for options" and prepended "[solved]". If this is not to your liking you can always edit the title to something else.
Post 16 Oct 2017, 02:18
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.