Sha256: f1eef6956465fc7be7a5cd778e96fb2dd429e1609a59cd57f47dcd13f1b8996e

Contents?: true

Size: 656 Bytes

Versions: 2

Compression:

Stored size: 656 Bytes

Contents

#    This file is part of Metasm, the Ruby assembly manipulation suite
#    Copyright (C) 2006-2010 Yoann GUILLOT
#
#    Licence is LGPL, see LICENCE in the top-level directory

require 'metasm/main'

module Metasm
class Python < CPU
	def initialize(prog = nil)
		super()
		@program = prog
		@endianness = (prog.respond_to?(:endianness) ? prog.endianness : :little)
		@size = (prog.respond_to?(:size) ? prog.size : 32)
	end

	class Var
		include Renderable

		attr_accessor :i

		def initialize(i); @i = i end

		def ==(o)
			o.class == self.class and o.i == i
		end

		def symbolic; "var_#{@i}".to_sym end

		def render
			["var_#@i"]
		end

	end
end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
metasm-1.0.3 metasm/cpu/python/main.rb
metasm-1.0.2 metasm/cpu/python/main.rb