node/lib/metasm/metasm/exe_format/coff_decode.rb
def sect_at_rva(rva)
		return if not rva or rva <= 0
		if sections and not @sections.empty?
			if s = @sections.find { |s_| s_.virtaddr <= rva and s_.virtaddr + EncodedData.align_size((s_.virtsize == 0 ? s_.rawsize : s_.virtsize), @optheader.sect_align) > rva }
				s.encoded.ptr = rva - s.virtaddr
				@cursection = s
			elsif rva < @sections.map { |s_| s_.virtaddr }.min
				@encoded.ptr = rva
				@cursection = self
			end
		elsif rva <= @encoded.length
			@encoded.ptr = rva
			@cursection = self
		end
	end
# converts an RVA (offset from base address of file when loaded in memory) to the section containing it using the section table
# updates @cursection and @cursection.encoded.ptr to point to the specified address
# may return self when rva points to the coff header
# returns nil if none match, 0 never matches
converts an RVA (offset from base address of file when loaded in memory) to the section containing it using the section table
updates @cursection and @cursection.encoded.ptr to point to the specified address
may return self when rva points to the coff header
returns nil if none match, 0 never matches
converts an RVA ( offset from base address of file when loaded in memory ) to the section containing it using the section table updates @cursection and @cursection . encoded . ptr to point to the specified address may return self when rva points to the coff header returns nil if none match 0 never matches
def sect_at_rva(rva)
		return if not rva or rva <= 0
		if sections and not @sections.empty?
			if s = @sections.find { |s_| s_.virtaddr <= rva and s_.virtaddr + EncodedData.align_size((s_.virtsize == 0 ? s_.rawsize : s_.virtsize), @optheader.sect_align) > rva }
				s.encoded.ptr = rva - s.virtaddr
				@cursection = s
			elsif rva < @sections.map { |s_| s_.virtaddr }.min
				@encoded.ptr = rva
				@cursection = self
			end
		elsif rva <= @encoded.length
			@encoded.ptr = rva
			@cursection = self
		end
	end
def sect_at_rva ( rva ) return if not rva or rva <= 0 if sections and not @sections . empty? if s = @sections . find { | s_ | s_ . virtaddr <= rva and s_ . virtaddr + EncodedData . align_size ( ( s_ . virtsize == 0 ? s_ . rawsize : s_ . virtsize ) , @optheader . sect_align ) > rva } s . encoded . ptr = rva - s . virtaddr @cursection = s elsif rva < @sections . map { | s_ | s_ . virtaddr } . min @encoded . ptr = rva @cursection = self end elsif rva <= @encoded . length @encoded . ptr = rva @cursection = self end end
converts an RVA (offset from base address of file when loaded in memory) to the section containing it using the section table
updates @cursection and @cursection.encoded.ptr to point to the specified address
may return self when rva points to the coff header
returns nil if none match, 0 never matches
converts an RVA ( offset from base address of file when loaded in memory ) to the section containing it using the section table updates @cursection and @cursection . encoded . ptr to point to the specified address may return self when rva points to the coff header returns nil if none match 0 never matches
rva