RPM: PE RVA to raw virtual offset address and file physical offset address

Source: Internet
Author: User


+---------+---------+---------+---------+---------+---------+
| Segment name virtual address virtual size Physical Address physical size Flag |
+---------+---------+---------+---------+---------+---------+
| Name VOffset vsize roffset rsize Flags |
+---------+---------+---------+---------+---------+---------+
|. Text 00001000 00000092 00000400 00000200 60000020|
|. rdata 00002000 000000F6 00000600 00000200 40000040|
|. Data 00003000 0000018E 00000800 00000200 c0000040|
|. rsrc 00004000 000003a0 00000a00 00000400 c0000040|
+---------+---------+---------+---------+---------+---------+
The virtual offset address and the file physical offset address are calculated as follows:

>>>>>>>vatofileoffset (virtual address goto file offset address)
such as VA = 00401000 (virtual address)
ImageBase = 00400000 (base address)
VRk = Voffset-roffset = 00001000-00000400 (the VRk value between the file virtual address and the file's physical site)
Fileoffset = Va-imagebase-vrk = 00401000-00400000-VRK = 400 (offset address of the physical address of the file)

If VA = 00401325, then:
Fileoffset = Va-imagebase-vrk = 00401325-00400000-vrk = 725

>>>>>>fileoffsettova (file offset address to virtual address)
such as Fileoffset = 435 (file offset address)
VA = fileoffset + ImageBase + VRk = 435 + 00400000 + VRk = 00401035 (virtual address)

RPM: PE RVA to raw virtual offset address and file physical offset address

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.