node/lib/metasm/metasm/exe_format/coff_decode.rb
def fileoff_to_addr(foff)
		if s = @sections.find { |s_| s_.rawaddr <= foff and s_.rawaddr + s_.rawsize > foff }
			s.virtaddr + foff - s.rawaddr + (@load_address ||= @optheader.image_base)
		elsif foff >= 0 and foff < @optheader.headers_size
			foff + (@load_address ||= @optheader.image_base)
		end
	end
# file offset -> memory address
# handles LoadedPE
file offset -> memory address
handles LoadedPE
file offset - > memory address handles LoadedPE
def fileoff_to_addr(foff)
		if s = @sections.find { |s_| s_.rawaddr <= foff and s_.rawaddr + s_.rawsize > foff }
			s.virtaddr + foff - s.rawaddr + (@load_address ||= @optheader.image_base)
		elsif foff >= 0 and foff < @optheader.headers_size
			foff + (@load_address ||= @optheader.image_base)
		end
	end
def fileoff_to_addr ( foff ) if s = @sections . find { | s_ | s_ . rawaddr <= foff and s_ . rawaddr + s_ . rawsize > foff } s . virtaddr + foff - s . rawaddr + ( @load_address ||= @optheader . image_base ) elsif foff >= 0 and foff < @optheader . headers_size foff + ( @load_address ||= @optheader . image_base ) end end
file offset -> memory address
handles LoadedPE
file offset - > memory address handles LoadedPE
foff