Title opcodes fun revised
Author irql
Link http://thunked.org/p/view/pub/
Created 2012-01-23 02:53:54
Expires never
Filename opcodes.sh
Language BASH
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
#!/bin/sh

# ./opcodes.sh 88 95
# ./opcodes.sh $((0x58)) $((0x5F))

test()
{
    echo -ne "$1" | ndisasm -u - | cut -c 11-
}

if [ -z $1 ];
then
    echo "Please provide two numbers";
    exit 1;
fi;

OPCODE=$1
OPSEC=$2

while [ $OPCODE -le $OPSEC ];
do
    test "\\x"`printf "%x" $OPCODE`
    let OPCODE=$OPCODE+1;
done