node/lib/metasm/metasm/exe_format/serialstruct.rb
def decode(exe, *args)
		struct_fields(exe).each { |f|
			case d = f[DECODE]
			when Symbol; val = exe.send(d, *args)
			when Array; val = exe.send(*d)
			when Proc; val = d[exe, self]
			when nil; next
			end
			next if not f[NAME]
			if h = f[ENUM]; h = h[exe, self] if h.kind_of? Proc; val = int_to_hash( val, h) end
			if h = f[BITS]; h = h[exe, self] if h.kind_of? Proc; val = bits_to_hash(val, h) end
			instance_variable_set(f[NAME], val)
		}
	end
# decodes the fields from the exe
decodes the fields from the exe
decodes the fields from the exe
def decode(exe, *args)
		struct_fields(exe).each { |f|
			case d = f[DECODE]
			when Symbol; val = exe.send(d, *args)
			when Array; val = exe.send(*d)
			when Proc; val = d[exe, self]
			when nil; next
			end
			next if not f[NAME]
			if h = f[ENUM]; h = h[exe, self] if h.kind_of? Proc; val = int_to_hash( val, h) end
			if h = f[BITS]; h = h[exe, self] if h.kind_of? Proc; val = bits_to_hash(val, h) end
			instance_variable_set(f[NAME], val)
		}
	end
def decode ( exe , * args ) struct_fields ( exe ) . each { | f | case d = f [ DECODE ] when Symbol ; val = exe . send ( d , * args ) when Array ; val = exe . send ( * d ) when Proc ; val = d [ exe , self ] when nil ; next end next if not f [ NAME ] if h = f [ ENUM ] ; h = h [ exe , self ] if h . kind_of? Proc ; val = int_to_hash ( val , h ) end if h = f [ BITS ] ; h = h [ exe , self ] if h . kind_of? Proc ; val = bits_to_hash ( val , h ) end instance_variable_set ( f [ NAME ] , val ) } end
decodes the fields from the exe
decodes the fields from the exe
exe
args