node/lib/metasm/metasm/exe_format/pe.rb
# a returns a new PE with only minimal information copied:
#  section name/perm/addr/content
#  exports
#  imports (with boundimport cleared)
#  resources
a returns a new PE with only minimal information copied:
section name/perm/addr/content
exports
imports (with boundimport cleared)
resources
a returns a new PE with only minimal information copied : section name / perm / addr / content exports imports ( with boundimport cleared ) resources
def mini_copy(share_ns=true)
		ret = self.class.new(@cpu)
		ret.share_namespace(self) if share_ns
		ret.header.machine = @header.machine
		ret.header.characteristics = @header.characteristics
		ret.optheader.entrypoint = @optheader.entrypoint
		ret.optheader.image_base = @optheader.image_base
		ret.optheader.subsystem  = @optheader.subsystem
		ret.optheader.dll_characts = @optheader.dll_characts
		@sections.each { |s|
			rs = Section.new
			rs.name = s.name
			rs.virtaddr = s.virtaddr
			rs.characteristics = s.characteristics
			rs.encoded = s.encoded
			ret.sections << s
		}
		ret.resource = resource
		ret.tls = tls
		if imports
			ret.imports = @imports.map { |id| id.dup }
			ret.imports.each { |id|
				id.timestamp = id.firstforwarder =
				id.ilt_p = id.libname_p = nil
			}
		end
		ret.export = export
		ret
	end
def mini_copy ( share_ns = true ) ret = self . class . new ( @cpu ) ret . share_namespace ( self ) if share_ns ret . header . machine = @header . machine ret . header . characteristics = @header . characteristics ret . optheader . entrypoint = @optheader . entrypoint ret . optheader . image_base = @optheader . image_base ret . optheader . subsystem = @optheader . subsystem ret . optheader . dll_characts = @optheader . dll_characts @sections . each { | s | rs = Section . new rs . name = s . name rs . virtaddr = s . virtaddr rs . characteristics = s . characteristics rs . encoded = s . encoded ret . sections << s } ret . resource = resource ret . tls = tls if imports ret . imports = @imports . map { | id | id . dup } ret . imports . each { | id | id . timestamp = id . firstforwarder = id . ilt_p = id . libname_p = nil } end ret . export = export ret end
a returns a new PE with only minimal information copied:
section name/perm/addr/content
exports
imports (with boundimport cleared)
resources
a returns a new PE with only minimal information copied : section name / perm / addr / content exports imports ( with boundimport cleared ) resources
share_ns