Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to determine file offset of each section using RVA in pe file ?

How to determine file offset of each section using RVA in pe file ?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 12509112
    wrote on last edited by
    #1

    How to determine file offset of each section using RVA in pe file ?

    L B 2 Replies Last reply
    0
    • U User 12509112

      How to determine file offset of each section using RVA in pe file ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Quote from Visual Studio, Microsoft Portable Executable and Common Object File Format Specification

      RVA Relative virtual address. In an image file, the address of an item after it is loaded into memory, with the base address of the image file subtracted from it. The RVA of an item almost always differs from its position within the file on disk (file pointer). In an object file, an RVA is less meaningful because memory locations are not assigned. In this case, an RVA would be an address within a section (described later in this table), to which a relocation is later applied during linking. For simplicity, a compiler should just set the first RVA in each section to zero.

      1 Reply Last reply
      0
      • U User 12509112

        How to determine file offset of each section using RVA in pe file ?

        B Offline
        B Offline
        Bram van Kampen
        wrote on last edited by
        #3

        I recommend that you read the many books written by Matt Pietreck on the subject. Even books about Win98 or XP will do. They are Classics, but, explain the lot, in your case in particular, how executable files are mapped to memory. I think that this forms part of the foundation every software engineer should have at his finger tips. Matt wrote several books about spelunking in the bowels of the various windows versions. However User Beware! If you are just interested in how your windows version on your computer does things, read, spelunk, and learn! If you start writing software on the basis of what you learn there, BEWARE! It will work, without doubt on Your computer(where you did the Spelunking!) There is absolutely no guarantee that it will work on any other computer, nor, that it will work after the next windows update! Microsoft provides a large API (Application Program Interface), which Microsoft guarantees to support over the various upgrades. Doing things outside this interface, will sooner or later lead to disaster. Regards, :)

        Bram van Kampen

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups