Changeset 85 for trunk/kLdr/kLdrModPE.c
- Timestamp:
- Sep 6, 2016, 5:21:04 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/kLdrModPE.c
r81 r85 336 336 pMod->aSegments[i + 1].pchName = pch = (const char *)&pModPE->aShdrs[i].Name[0]; 337 337 cb = IMAGE_SIZEOF_SHORT_NAME; 338 while ( 339 && 338 while ( cb > 0 339 && (pch[cb - 1] == ' ' || pch[cb - 1] == '\0')) 340 340 cb--; 341 341 pMod->aSegments[i + 1].cchName = cb; … … 344 344 if (!(pModPE->aShdrs[i].Characteristics & IMAGE_SCN_TYPE_NOLOAD)) 345 345 { 346 /* Kluge to deal with wlink ".reloc" sections that has a VirtualSize of 0 bytes. */ 347 KU32 cb = pModPE->aShdrs[i].Misc.VirtualSize; 348 if (!cb) 349 cb = K_ALIGN_Z(pModPE->aShdrs[i].SizeOfRawData, pModPE->Hdrs.OptionalHeader.SectionAlignment); 346 350 pMod->aSegments[i + 1].cb = pModPE->aShdrs[i].Misc.VirtualSize; 347 351 pMod->aSegments[i + 1].LinkAddress = pModPE->aShdrs[i].VirtualAddress 348 352 + pModPE->Hdrs.OptionalHeader.ImageBase; 349 353 pMod->aSegments[i + 1].RVA = pModPE->aShdrs[i].VirtualAddress; 350 pMod->aSegments[i + 1].cbMapped = pModPE->aShdrs[i].Misc.VirtualSize;354 pMod->aSegments[i + 1].cbMapped = cb; 351 355 if (i + 2 < pMod->cSegments) 352 356 pMod->aSegments[i + 1].cbMapped= pModPE->aShdrs[i + 1].VirtualAddress … … 363 367 /* file location */ 364 368 pMod->aSegments[i + 1].offFile = pModPE->aShdrs[i].PointerToRawData; 365 pMod->aSegments[i + 1].cbFile = pModPE->aShdrs[i].SizeOfRawData;369 pMod->aSegments[i + 1].cbFile = pModPE->aShdrs[i].SizeOfRawData; 366 370 if ( pMod->aSegments[i + 1].cbMapped > 0 /* if mapped */ 367 371 && (KLDRSIZE)pMod->aSegments[i + 1].cbFile > pMod->aSegments[i + 1].cbMapped)
Note:
See TracChangeset
for help on using the changeset viewer.