node/lib/metasm/metasm/exe_format/coff_encode.rb
def invalidate_header
		# set those values to nil, they will be
		# recomputed during encode_header
		[:code_size, :data_size, :udata_size, :base_of_code, :base_of_data,
		 :sect_align, :file_align, :image_size, :headers_size, :checksum].each { |m| @optheader.send("#{m}=", nil) }
		[:num_sect, :ptr_sym, :num_sym, :size_opthdr].each { |m| @header.send("#{m}=", nil) }
	end
# resets the values in the header that may have been
# modified by your script (eg section count, size, imagesize, etc)
# call this whenever you decode a file, modify it, and want to reencode it later
resets the values in the header that may have been
modified by your script
call this whenever you decode a file, modify it, and want to reencode it later
resets the values in the header that may have been modified by your script call this whenever you decode a file modify it and want to reencode it later
def invalidate_header
		[:code_size, :data_size, :udata_size, :base_of_code, :base_of_data,
		 :sect_align, :file_align, :image_size, :headers_size, :checksum].each { |m| @optheader.send("#{m}=", nil) }
		[:num_sect, :ptr_sym, :num_sym, :size_opthdr].each { |m| @header.send("#{m}=", nil) }
	end
def invalidate_header [ :code_size , :data_size , :udata_size , :base_of_code , :base_of_data , :sect_align , :file_align , :image_size , :headers_size , :checksum ] . each { | m | @optheader . send ( "#{m}=" , nil ) } [ :num_sect , :ptr_sym , :num_sym , :size_opthdr ] . each { | m | @header . send ( "#{m}=" , nil ) } end
resets the values in the header that may have been
modified by your script (eg section count, size, imagesize, etc)
call this whenever you decode a file, modify it, and want to reencode it later
resets the values in the header that may have been modified by your script ( eg section count size imagesize etc ) call this whenever you decode a file modify it and want to reencode it later
# set those values to nil, they will be # recomputed during encode_header