node/lib/metasm/metasm/exe_format/coff_decode.rb
def decode_header
		@cursection ||= self
		@encoded.ptr ||= 0
		@sections = []
		@header.decode(self)
		optoff = @encoded.ptr
		@optheader.decode(self)
		decode_symbols if @header.num_sym != 0 and not @header.characteristics.include? 'DEBUG_STRIPPED'
		curencoded.ptr = optoff + @header.size_opthdr
		decode_sections
		if sect_at_rva(@optheader.entrypoint)
			curencoded.add_export new_label('entrypoint')
		end
		(DIRECTORIES - ['certificate_table']).each { |d|
			if @directory[d] and sect_at_rva(@directory[d][0])
				curencoded.add_export new_label(d)
			end
		}
	end
# decodes the COFF header, optional header, section headers
# marks entrypoint and directories as edata.expord
decodes the COFF header, optional header, section headers
marks entrypoint and directories as edata.expord
decodes the COFF header optional header section headers marks entrypoint and directories as edata . expord
def decode_header
		@cursection ||= self
		@encoded.ptr ||= 0
		@sections = []
		@header.decode(self)
		optoff = @encoded.ptr
		@optheader.decode(self)
		decode_symbols if @header.num_sym != 0 and not @header.characteristics.include? 'DEBUG_STRIPPED'
		curencoded.ptr = optoff + @header.size_opthdr
		decode_sections
		if sect_at_rva(@optheader.entrypoint)
			curencoded.add_export new_label('entrypoint')
		end
		(DIRECTORIES - ['certificate_table']).each { |d|
			if @directory[d] and sect_at_rva(@directory[d][0])
				curencoded.add_export new_label(d)
			end
		}
	end
def decode_header @cursection ||= self @encoded . ptr ||= 0 @sections = [ ] @header . decode ( self ) optoff = @encoded . ptr @optheader . decode ( self ) decode_symbols if @header . num_sym != 0 and not @header . characteristics . include? 'DEBUG_STRIPPED' curencoded . ptr = optoff + @header . size_opthdr decode_sections if sect_at_rva ( @optheader . entrypoint ) curencoded . add_export new_label ( 'entrypoint' ) end ( DIRECTORIES - [ 'certificate_table' ] ) . each { | d | if @directory [ d ] and sect_at_rva ( @directory [ d ] [ 0 ] ) curencoded . add_export new_label ( d ) end } end
decodes the COFF header, optional header, section headers
marks entrypoint and directories as edata.expord
decodes the COFF header optional header section headers marks entrypoint and directories as edata . expord