Here is a way to do this with radare2
program rasm2
rasm2 -a x86 -b 32 -d 7406
je 0x8
This has obviously already been established as je
from the other answers.
But for arguments sake, say you wanted to decode all instructions starting with 0x74 for one additional byte, you could then run the above in a loop and try and find all valid instructions. This example is for Linux or a Unix shell of some kind, I presume you could achieve the similar with mingw
or Powershell:
for x in `seq 0 255`;do printf "74%02x " $x;rasm2 -a x86 -b 32 -d 74`printf "%02x" $x`;done
Produces:
7400 je 0x2
7401 je 0x3
7402 je 0x4
7403 je 0x5
(etc...)
Another example:
for x in `seq 0 255`;do printf "33%02x " $x;rasm2 -a x86 -b 32 -d 33`printf "%02x" $x`;done
gives
3300 xor eax, [eax]
3301 xor eax, [ecx]
3302 xor eax, [edx]
3303 xor eax, [ebx]
3304 disassemble error at offset 0
invalid
3305 disassemble error at offset 0
invalid
3306 xor eax, [esi]
(etc)
You could then write a script to grep out the errors and just show valid codes (or the opposite even if you wanted)
0x74
is alwaysjz
/je
(they're synonymous). In Linux you can generate all byte sequences you're interested of, pipe them to some disassembler (I like udcli) andgrep
the output for valid instructions, like this (to get all 2-byte x86-64 instructions that begin with0f
):bytes='0f'; bytes_wo_spaces=$(echo $bytes | tr -d ' '); for i in {0..255}; do printf "$bytes %x\n" $i | udcli -x -64; done | grep $bytes_wo_spaces | grep -v '\<invalid\>'
. This can be extended to longer instructions too (to some limit). It can probably be done in Windows console too.