Thread: PIMAGE_SECTION_HEADER VirtualAddress and PointerToRawData fields

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    385

    PIMAGE_SECTION_HEADER VirtualAddress and PointerToRawData fields

    I am reading this article and I can't understand what is the diffence between the VirtualAddress and PointerToRawData fields of IMAGE_SECTION_HEADER structure in a Portable Executable?? Why do we have these two different fields anyways, and what do they really mean??

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Suppose you only had VirtualAddress. In that case, the file would have to contain padding in order to place sections at the proper virtual addresses. Not all executables are packed full of initialized data. Sometimes there may be big blocks of uninitialized data as well. It would be wasteful to store, say, 8 megabytes of zeros in an executable just to avoid the need for a PointerToRawData field in the header.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bit fields
    By Edelweiss in forum C Programming
    Replies: 5
    Last Post: 08-23-2011, 10:01 AM
  2. Bit fields
    By Perspektyva in forum C++ Programming
    Replies: 13
    Last Post: 11-22-2008, 02:38 PM
  3. bit fields before non-bit fields . . .
    By dwks in forum C Programming
    Replies: 10
    Last Post: 10-13-2005, 02:36 AM
  4. bit-fields
    By kps in forum C Programming
    Replies: 9
    Last Post: 09-25-2002, 08:25 PM
  5. Bit fields
    By GaPe in forum C Programming
    Replies: 8
    Last Post: 01-22-2002, 02:01 PM