node/lib/metasm/metasm/main.rb
# replace a portion of self
# from/to may be Integers (offsets) or labels (from self.export)
# content is a String or an EncodedData, which will be inserted in the specified location (padded if necessary)
# raise if the string does not fit in.
replace a portion of self
from/to may be Integers (offsets) or labels (from self.export)
content is a String or an EncodedData, which will be inserted in the specified location (padded if necessary)
raise if the string does not fit in.
replace a portion of self from / to may be Integers ( offsets ) or labels ( from self . export ) content is a String or an EncodedData which will be inserted in the specified location ( padded if necessary ) raise if the string does not fit in .
def patch(from, to, content)
		from = @export[from] || from
		raise "invalid offset specification #{from}" if not from.kind_of? Integer
		to = @export[to] || to
		raise "invalid offset specification #{to}" if not to.kind_of? Integer
		raise EncodeError, 'cannot patch data: new content too long' if to - from < content.length
		self[from, content.length] = content
	end
def patch ( from , to , content ) from = @export [ from ] || from raise "invalid offset specification #{from}" if not from . kind_of? Integer to = @export [ to ] || to raise "invalid offset specification #{to}" if not to . kind_of? Integer raise EncodeError , 'cannot patch data: new content too long' if to - from < content . length self [ from , content . length ] = content end
replace a portion of self
from/to may be Integers (offsets) or labels (from self.export)
content is a String or an EncodedData, which will be inserted in the specified location (padded if necessary)
raise if the string does not fit in.
replace a portion of self from / to may be Integers ( offsets ) or labels ( from self . export ) content is a String or an EncodedData which will be inserted in the specified location ( padded if necessary ) raise if the string does not fit in .
from
to
content