metasm/cpu/x86_64/parse.rb in metasm-1.0.3 vs metasm/cpu/x86_64/parse.rb in metasm-1.0.4
- old
+ new
@@ -47,10 +47,10 @@
super(i)
end
# check if the argument matches the opcode's argument spec
def parse_arg_valid?(o, spec, arg)
- return if arg.kind_of? ModRM and ((arg.b and arg.b.val == 16 and arg.i) or (arg.i and arg.i.val == 16 and (arg.b or arg.s != 1)))
+ return if arg.kind_of? ModRM and ((arg.b and arg.b.val == 16 and arg.i) or (arg.i and arg.i.val == 16 and (arg.b or arg.s != 1))) # cannot encode [rip+base], only [rip+imm]
return if arg.kind_of? Reg and arg.sz >= 32 and arg.val == 16 # eip/rip only in modrm
return if o.props[:auto64] and arg.respond_to? :sz and arg.sz == 32
# vex c4/c5
return if o.fields[:vex_r] and not o.fields[:vex_b] and (spec == :modrm or spec == :modrmxmm or spec == :modrmymm) and (((arg.kind_of?(SimdReg) or arg.kind_of?(Reg)) and arg.val >= 8) or (arg.kind_of?(ModRM) and ((arg.b and arg.b.val >= 8) or (arg.i and arg.i.val >= 8))))
if o.name == 'movsxd'