change offset_to_rva into file_offset_to_va, add comments
git-svn-id: file:///home/svn/framework3/trunk@9242 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
e70dabf3e3
commit
cd213c29c5
|
@ -184,10 +184,16 @@ class Pe < PeBase
|
||||||
(ptr_32?) ? ("0x%.8x" % va) : ("0x%.16x" % va)
|
(ptr_32?) ? ("0x%.8x" % va) : ("0x%.16x" % va)
|
||||||
end
|
end
|
||||||
|
|
||||||
def offset_to_rva(offset)
|
#
|
||||||
image_base + offset
|
# Converts a file offset into a virtual address
|
||||||
|
#
|
||||||
|
def file_offset_to_va(offset)
|
||||||
|
image_base + file_offset_to_rva(offset)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Read raw bytes from the specified offset in the underlying file
|
||||||
|
#
|
||||||
def read(offset, len)
|
def read(offset, len)
|
||||||
_isource.read(offset, len)
|
_isource.read(offset, len)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue