metasm/exe_format/main.rb in metasm-1.0.3 vs metasm/exe_format/main.rb in metasm-1.0.4

- old
+ new

@@ -215,9 +215,11 @@ foff end def shortname; self.class.name.split('::').last.downcase; end + def inspect; "<Metasm::ExeFormat %s @%x>" % [shortname, object_id]; end + module IntToHash # converts a constant name to its numeric value using the hash # {1 => 'toto', 2 => 'tata'}: 'toto' => 1, 42 => 42, 'tutu' => raise def int_from_hash(val, hash) val.kind_of?(Integer) ? hash.index(val) || val : hash.index(val) or raise "unknown constant #{val.inspect}"