From 873f8bd1ed1aa4763cd4c55cdb52d914254d4397 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Wed, 5 May 2010 20:07:15 +0000 Subject: [PATCH] added a couple of convenience methods not sure if these are correct, but they worked for me git-svn-id: file:///home/svn/framework3/trunk@9230 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rex/peparsey/pe.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/rex/peparsey/pe.rb b/lib/rex/peparsey/pe.rb index 2b48175443..5f9b056b56 100644 --- a/lib/rex/peparsey/pe.rb +++ b/lib/rex/peparsey/pe.rb @@ -143,7 +143,7 @@ class Pe < PeBase self.hdr.config = self._config_header self.hdr.tls = self._tls_header self.hdr.exceptions = self._exception_header - + # We load the exception directory last as it relies on hdr.file to be created above. self._exception_header = _load_exception_directory() end @@ -184,5 +184,13 @@ class Pe < PeBase (ptr_32?) ? ("0x%.8x" % va) : ("0x%.16x" % va) end -end end end + def offset_to_rva(offset) + image_base + offset + end + def read(offset, len) + _isource.read(offset, len) + end + + +end end end