A kind of workaround is using tee. So to disassemble a file named input use
cat input | tee a.out | objdump -d
And, to give an example for passing some bytes with the echo command, the following should be a good example (The parameters are described in this good SO answer):
You can't. There is no way around that, you will have to use the temporary file.
Source file readelf.c has this unconditional check (in binutils 2.22-8 at least) before even attempting to open the file:
So if the file is anything but regular file (like symlink, or char device as in case of
/dev/stdin
,/proc/self/fd/*
, etc.) it won't work.Alternatively, you could modify the source and use modified objdump, but there goes your portability.
you can always do
or
sample
I used
ndisasm -b 64 -
as a workaround.e.g. I wanted:
echo 41 89 1b | xxd -r -p | objdump -d -
But the above doesn't work. This does work though:
echo 41 89 1b | xxd -r -p | ndisasm -b 64 -
A kind of workaround is using
tee
. So to disassemble a file namedinput
useAnd, to give an example for passing some bytes with the
echo
command, the following should be a good example (The parameters are described in this good SO answer):To disassemble the x86 code byte sequence
prefix it with
0:
and use the commandIts output is:
which is just the assembly code for exiting an i386 linux program with the exit code 0xA.