node/lib/metasm/metasm/parse_c.rb
# find a Struct/Union object from a struct name/typedef name
# raises if it cant find it
find a Struct/Union object from a struct name/typedef name
raises if it cant find it
find a Struct / Union object from a struct name / typedef name raises if it cant find it
def decode_c_value(str, type, off=0)
			type = type.type if type.kind_of? Variable
			type = type.untypedef
			if type.kind_of? C::Union or type.kind_of? C::Array
				return AllocCStruct.new(self, type, str, off)
			end
			val = Expression.decode_immediate(str, sizeof(type), @endianness, off)
			val = Expression.make_signed(val, sizeof(type)*8) if type.integral? and type.signed?
			val = nil if val == 0 and type.pointer?
			val
		end
def decode_c_value ( str , type , off = 0 ) type = type . type if type . kind_of? Variable type = type . untypedef if type . kind_of? C :: Union or type . kind_of? C :: Array return AllocCStruct . new ( self , type , str , off ) end val = Expression . decode_immediate ( str , sizeof ( type ) , @endianness , off ) val = Expression . make_signed ( val , sizeof ( type ) * 8 ) if type . integral? and type . signed? val = nil if val == 0 and type . pointer? val end
find a Struct/Union object from a struct name/typedef name
raises if it cant find it
find a Struct / Union object from a struct name / typedef name raises if it cant find it
str
type
off