New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream based input #627

Open
deepgray opened this Issue Nov 20, 2017 · 11 comments

Comments

Projects
None yet
3 participants
@deepgray

deepgray commented Nov 20, 2017

i have not been able to read from stdin or another other stream based input.

the normal operations would be:

program-1 | program-2

program-2 is the target i am trying to debug.

@eteran

This comment has been minimized.

Show comment
Hide comment
@eteran

eteran Nov 20, 2017

Owner

Fair enough, given the current UI / command line options; what do you think would be a user-friendly way to specify the source of input for the debugged program?

Owner

eteran commented Nov 20, 2017

Fair enough, given the current UI / command line options; what do you think would be a user-friendly way to specify the source of input for the debugged program?

@deepgray

This comment has been minimized.

Show comment
Hide comment
@deepgray

deepgray Nov 21, 2017

maybe in the options where there are arguments, have a stream option? maybe a cli field where the instruction is for stdin via a pipe?

i'm not sure of how you would implement that...

the other aspect is if i am debugging a app that reads a file...don't know if the debugger would handle that in the same fashion since files and pipes are all streams.

in gdb, you would:

run < file.txt but run < $(python -c '"A"*1024') doesn't work...most likely issues with command substation and streams.

deepgray commented Nov 21, 2017

maybe in the options where there are arguments, have a stream option? maybe a cli field where the instruction is for stdin via a pipe?

i'm not sure of how you would implement that...

the other aspect is if i am debugging a app that reads a file...don't know if the debugger would handle that in the same fashion since files and pipes are all streams.

in gdb, you would:

run < file.txt but run < $(python -c '"A"*1024') doesn't work...most likely issues with command substation and streams.

@10110111

This comment has been minimized.

Show comment
Hide comment
@10110111

10110111 Nov 21, 2017

Contributor

Well command substitution doesn't work in GDB because GDB isn't Bash. The < syntax is explicitly supported for files (and, I'd guess, some resources as named pipes).
I think it's a good idea for EDB to get some options like --stdin filename and --stdout[-append] filename (which would need to precede --run option on the command line).

Contributor

10110111 commented Nov 21, 2017

Well command substitution doesn't work in GDB because GDB isn't Bash. The < syntax is explicitly supported for files (and, I'd guess, some resources as named pipes).
I think it's a good idea for EDB to get some options like --stdin filename and --stdout[-append] filename (which would need to precede --run option on the command line).

@deepgray

This comment has been minimized.

Show comment
Hide comment
@deepgray

deepgray Nov 21, 2017

that would work...

with regard to bash, i found that:

command1 | command2

works the same as

command2 < <(command1)

but

command 2 <(command1)

doesn't...

deepgray commented Nov 21, 2017

that would work...

with regard to bash, i found that:

command1 | command2

works the same as

command2 < <(command1)

but

command 2 <(command1)

doesn't...

@deepgray

This comment has been minimized.

Show comment
Hide comment
@deepgray

deepgray Nov 21, 2017

and command2 < $(command1) doesn't work either

deepgray commented Nov 21, 2017

and command2 < $(command1) doesn't work either

@deepgray

This comment has been minimized.

Show comment
Hide comment
@deepgray

deepgray Nov 21, 2017

but i also want to take the chance to thank you for developing and maintaining the visual debugger...

deepgray commented Nov 21, 2017

but i also want to take the chance to thank you for developing and maintaining the visual debugger...

@deepgray

This comment has been minimized.

Show comment
Hide comment
@deepgray

deepgray Nov 21, 2017

as a side note i tried this...

ladmin@ubuntu14-i386:/Desktop$ python -c 'print "A"*64 + "\x24\x84\x04\x08"' | ./stack3
calling function pointer, jumping to 0x08048424
code flow successfully changed
ladmin@ubuntu14-i386:
/Desktop$ ./stack3 < <(python -c 'print "A"*64 + "\x24\x84\x04\x08"')
calling function pointer, jumping to 0x08048424
code flow successfully changed
ladmin@ubuntu14-i386:/Desktop$ edb --run ./stack3 < <(python -c 'print "A"*64 + "\x24\x84\x04\x08"')
Starting edb version: 0.9.22
Please Report Bugs & Requests At: https://github.com/eteran/edb-debugger/issues
Running Terminal: "/usr/bin/xterm"
Terminal Args: ("-title", "edb output", "-hold", "-e", "sh", "-c", "tty > /tmp/edb_temp_file_1232312080_30242;trap "" INT QUIT TSTP;exec<&-; exec>&-;while :; do sleep 3600; done")
Terminal process has TTY: "/dev/pts/6"
Loading session file
Loading plugin-data
restoreComments
comparing versions: [2325] [2326]
Saving session file
ladmin@ubuntu14-i386:
/Desktop$

edb didn't process it correctly...so not sure if there is a way ahead...

deepgray commented Nov 21, 2017

as a side note i tried this...

ladmin@ubuntu14-i386:/Desktop$ python -c 'print "A"*64 + "\x24\x84\x04\x08"' | ./stack3
calling function pointer, jumping to 0x08048424
code flow successfully changed
ladmin@ubuntu14-i386:
/Desktop$ ./stack3 < <(python -c 'print "A"*64 + "\x24\x84\x04\x08"')
calling function pointer, jumping to 0x08048424
code flow successfully changed
ladmin@ubuntu14-i386:/Desktop$ edb --run ./stack3 < <(python -c 'print "A"*64 + "\x24\x84\x04\x08"')
Starting edb version: 0.9.22
Please Report Bugs & Requests At: https://github.com/eteran/edb-debugger/issues
Running Terminal: "/usr/bin/xterm"
Terminal Args: ("-title", "edb output", "-hold", "-e", "sh", "-c", "tty > /tmp/edb_temp_file_1232312080_30242;trap "" INT QUIT TSTP;exec<&-; exec>&-;while :; do sleep 3600; done")
Terminal process has TTY: "/dev/pts/6"
Loading session file
Loading plugin-data
restoreComments
comparing versions: [2325] [2326]
Saving session file
ladmin@ubuntu14-i386:
/Desktop$

edb didn't process it correctly...so not sure if there is a way ahead...

@deepgray

This comment has been minimized.

Show comment
Hide comment
@deepgray

deepgray Nov 21, 2017

don't know why gtihub put the strike through lines...

deepgray commented Nov 21, 2017

don't know why gtihub put the strike through lines...

@10110111

This comment has been minimized.

Show comment
Hide comment
@10110111

10110111 Nov 21, 2017

Contributor

Because you failed to use triple backticks to make the text pre-formatted. And in Markdown, double tildes mean strike through. See the reference.

Contributor

10110111 commented Nov 21, 2017

Because you failed to use triple backticks to make the text pre-formatted. And in Markdown, double tildes mean strike through. See the reference.

@deepgray

This comment has been minimized.

Show comment
Hide comment
@deepgray

deepgray Nov 21, 2017

ok...

back on the stream input, what would happen if i executed this:

command1 | edb --run command2

could the fileIO from command1 bepassed in to the command2 being executed?

deepgray commented Nov 21, 2017

ok...

back on the stream input, what would happen if i executed this:

command1 | edb --run command2

could the fileIO from command1 bepassed in to the command2 being executed?

@10110111

This comment has been minimized.

Show comment
Hide comment
@10110111

10110111 Nov 21, 2017

Contributor

I don't think so. And implementing it in this way would be no good if EDB ever decides to get a command-line interface.

Contributor

10110111 commented Nov 21, 2017

I don't think so. And implementing it in this way would be no good if EDB ever decides to get a command-line interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment