Skip to content

Commit

Permalink
Fix jcxz to jecxz for x86_64 in metasm
Browse files Browse the repository at this point in the history
This fixes "invalid opcode near 'jecxz'" for x64 metasm encoding.
  • Loading branch information
wchen-r7 committed Dec 19, 2014
1 parent 723998e commit 650a68c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/metasm/metasm/cpu/x86_64/opcodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def init_x8664_only

addop('movq', [0x0F, 0x6E], :mrmmmx, {:d => [1, 4]}) { |o| o.args = [:modrm, :regmmx] ; o.props[:opsz] = o.props[:argsz] = 64 }
addop('movq', [0x0F, 0x6E], :mrmxmm, {:d => [1, 4]}) { |o| o.args = [:modrm, :regxmm] ; o.props[:opsz] = o.props[:argsz] = 64 ; o.props[:needpfx] = 0x66 }
addop('jcxz', [0xE3], nil, :setip, :i8) { |o| o.props[:adsz] = 32 } # actually 16 (cx), but x64 in general says pfx 0x67 => adsz = 32
addop('jecxz', [0xE3], nil, :setip, :i8) { |o| o.props[:adsz] = 32 } # actually 16 (cx), but x64 in general says pfx 0x67 => adsz = 32
addop('jrcxz', [0xE3], nil, :setip, :i8) { |o| o.props[:adsz] = 64 }
end

Expand Down

0 comments on commit 650a68c

Please sign in to comment.