- // Create Page Listing\r
- count = (peSections[i].RawSize + 0xFFF) >> 12;\r
- for(k=0;k<count;k++)\r
- {\r
- ret->Pages[j+k].Virtual = iVA + (k<<12);\r
- ret->Pages[j+k].Physical = peSections[i].RawOffs + (k<<12); // Store the offset in the physical address\r
- if(k == count-1 && (peSections[i].RawSize & 0xFFF))\r
- ret->Pages[j+k].Size = peSections[i].RawSize & 0xFFF; // Byte count in page\r
- else\r
- ret->Pages[j+k].Size = 4096;\r
- ret->Pages[j+k].Flags = iFlags;\r
- }\r
- count = (peSections[i].VirtualSize + 0xFFF) >> 12;\r
- for(;k<count;k++)\r
- {\r
- ret->Pages[j+k].Virtual = iVA + (k<<12);\r
- ret->Pages[j+k].Physical = -1; // -1 = Fill with zeros\r
- if(k == count-1 && (peSections[i].VirtualSize & 0xFFF))\r
- ret->Pages[j+k].Size = peSections[i].VirtualSize & 0xFFF; // Byte count in page\r
- else\r
- ret->Pages[j+k].Size = 4096;\r
- ret->Pages[j+k].Flags = iFlags;\r
- }\r
- j += count;\r
+ sect->Virtual = iVA;\r
+ sect->Offset = peSections[i].RawOffs;\r
+ sect->FileSize = peSections[i].RawSize;\r
+ sect->MemSize = peSections[i].VirtualSize;\r
+ sect->Flags = iFlags;\r
+ j ++;\r