Skip to content
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

Add change binhex format and add disassembly result tester #2

Merged
merged 2 commits into from
Mar 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions disass_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

if [ "x$1" == "x" ]; then
echo "Please provide an argument or two"
return 1;
fi

TARGET=$2

if [ "x$TARGET" == "x" ]; then
TARGET=`basename "$1"`.objdump
fi

TMPFILE=`mktemp`

objdump -j .text -d $1 |grep "^ " > ${TMPFILE}

diff ${TMPFILE} ${TARGET}

rm ${TMPFILE}
5 changes: 3 additions & 2 deletions img_create.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
if [ "x$1" == "x" ]; then
echo "Please provide an argument or two"
return 1;
Expand All @@ -15,4 +15,5 @@ TMPFILE=`mktemp`
echo "Converting $1 to $TARGET"

objcopy -j.text -O binary "$1" "$TMPFILE"
hexdump -v -e '"0x%08x\n"' "$TMPFILE" > "$TARGET"
readelf -h "$1" | grep "Entry point address:"| awk '{printf "0x%08x\n", strtonum($NF)}' > "$TARGET"
hexdump -v -e '"0x%08x\n"' "$TMPFILE" >> "$TARGET"