node/lib/metasm/metasm/exe_format/pe.rb
def decode_header
		@cursection ||= self
		@encoded.ptr = 0x3c
		@encoded.ptr = decode_word(@encoded)
		@signature = @encoded.read(4)
		raise InvalidExeFormat, "Invalid PE signature #{@signature.inspect}" if @signature != MAGIC
		@coff_offset = @encoded.ptr
		if @mz.encoded.empty?
			@mz.encoded << @encoded[0, @coff_offset-4]
			@mz.encoded.ptr = 0
			@mz.decode_header
		end
		super()
	end
# overrides COFF#decode_header
# simply sets the offset to the PE pointer before decoding the COFF header
# also checks the PE signature
overrides COFF#decode_header
simply sets the offset to the PE pointer before decoding the COFF header
also checks the PE signature
overrides COFF#decode_header simply sets the offset to the PE pointer before decoding the COFF header also checks the PE signature
def decode_header
		@cursection ||= self
		@encoded.ptr = 0x3c
		@encoded.ptr = decode_word(@encoded)
		@signature = @encoded.read(4)
		raise InvalidExeFormat, "Invalid PE signature #{@signature.inspect}" if @signature != MAGIC
		@coff_offset = @encoded.ptr
		if @mz.encoded.empty?
			@mz.encoded << @encoded[0, @coff_offset-4]
			@mz.encoded.ptr = 0
			@mz.decode_header
		end
		super()
	end
def decode_header @cursection ||= self @encoded . ptr = 0x3c @encoded . ptr = decode_word ( @encoded ) @signature = @encoded . read ( 4 ) raise InvalidExeFormat , "Invalid PE signature #{@signature.inspect}" if @signature != MAGIC @coff_offset = @encoded . ptr if @mz . encoded . empty? @mz . encoded << @encoded [ 0 , @coff_offset - 4 ] @mz . encoded . ptr = 0 @mz . decode_header end super ( ) end
overrides COFF#decode_header
simply sets the offset to the PE pointer before decoding the COFF header
also checks the PE signature
overrides COFF#decode_header simply sets the offset to the PE pointer before decoding the COFF header also checks the PE signature