disasm gains a -o option to provide arguments to objdump. The argument
to -o gets interpreted by the shell, allowing multiple arguments to be
passed to objdump.
gccrun now passes parameters past the first to gcc, requiring you to
quote the code to be compiled. It also allows the wrapper to be
interpreted by the shell, allowing a wrapper with arguments.
+case "$1" in
+ -o) args="$2"
+ shift 2;;
+esac
+
file=$(mktemp)
echo "$*" | xxd -r -p > "$file"
file=$(mktemp)
echo "$*" | xxd -r -p > "$file"
-objdump -D -b binary -m i386 "$file" | tail -n +7
+objdump -D -b binary -m i386 $args "$file" | tail -n +7
#include <sys/mman.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
#include <sys/mman.h>
#include <sys/ptrace.h>
#include <sys/syscall.h>
+#include <arpa/inet.h>
+#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
int
main(int argc, char *argv[], char *envp[])
{
int
main(int argc, char *argv[], char *envp[])
{
-if ! gcc -o "$f/command" "$f/command.c"; then
+shift
+if ! gcc -o "$f/command" "$f/command.c" $@; then
exit 1
fi
if [ -n "$wrapper" ]; then
exit 1
fi
if [ -n "$wrapper" ]; then
- "$wrapper" "$f/command"