Changeset 4440 for trunk/src/kernel32/winimagepeldr.cpp
- Timestamp:
- Oct 6, 2000, 1:04:02 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/winimagepeldr.cpp
r4422 r4440 1 /* $Id: winimagepeldr.cpp,v 1.5 5 2000-10-04 19:36:25sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.56 2000-10-06 11:04:02 sandervl Exp $ */ 2 2 3 3 /* … … 287 287 if ((psh = (PIMAGE_SECTION_HEADER)SECTIONHDROFF (win32file)) != NULL) { 288 288 dprintf((LOG, "*************************PE SECTIONS START**************************" )); 289 for (i=0; i<nSections; i++) { 289 for (i=0; i<nSections; i++) 290 { 290 291 dprintf((LOG, "Raw data size: %x", psh[i].SizeOfRawData )); 291 292 dprintf((LOG, "Virtual Address: %x", psh[i].VirtualAddress )); … … 295 296 dprintf((LOG, "Pointer to raw data: %x", psh[i].PointerToRawData )); 296 297 dprintf((LOG, "Section flags: %x\n\n", psh[i].Characteristics )); 297 if(strcmp(psh[i].Name, ".reloc") == 0) { 298 299 if(IsSectionType(win32file, &psh[i], IMAGE_DIRECTORY_ENTRY_BASERELOC)) 300 { 298 301 dprintf((LOG, ".reloc" )); 299 302 addSection(SECTION_RELOC, psh[i].PointerToRawData, … … 302 305 continue; 303 306 } 304 if(strcmp(psh[i].Name, ".edata") == 0) { 307 if(IsSectionType(win32file, &psh[i], IMAGE_DIRECTORY_ENTRY_EXPORT)) 308 { 305 309 dprintf((LOG, ".edata" )); 306 310 addSection(SECTION_EXPORT, psh[i].PointerToRawData, … … 309 313 continue; 310 314 } 311 if(strcmp(psh[i].Name, ".rsrc") == 0) { 315 if(IsSectionType(win32file, &psh[i], IMAGE_DIRECTORY_ENTRY_RESOURCE)) 316 { 312 317 dprintf((LOG, ".rsrc" )); 313 318 addSection(SECTION_RESOURCE, psh[i].PointerToRawData, … … 316 321 continue; 317 322 } 318 if(strcmp(psh[i].Name, ".tls") == 0)323 if(IsSectionType(win32file, &psh[i], IMAGE_DIRECTORY_ENTRY_TLS)) 319 324 { 320 325 tlsDir = (IMAGE_TLS_DIRECTORY *)ImageDirectoryOffset(win32file, IMAGE_DIRECTORY_ENTRY_TLS); … … 326 331 continue; 327 332 } 328 329 if(strcmp(psh[i].Name, ".debug") == 0){333 if(IsSectionType(win32file, &psh[i], IMAGE_DIRECTORY_ENTRY_DEBUG)) 334 { 330 335 dprintf((LOG, ".rdebug" )); 331 336 addSection(SECTION_DEBUG, psh[i].PointerToRawData, … … 334 339 continue; 335 340 } 336 if(Is ImportSection(win32file, &psh[i]))341 if(IsSectionType(win32file, &psh[i], IMAGE_DIRECTORY_ENTRY_IMPORT)) 337 342 { 338 int type = SECTION_IMPORT; 343 int type = SECTION_IMPORT; 344 339 345 dprintf((LOG, "Import Data Section" )); 340 346 if(psh[i].Characteristics & IMAGE_SCN_CNT_CODE) { … … 348 354 } 349 355 350 351 if( 352 353 356 //KSO Sun 1998-08-09: Borland does not alway set the CODE flag for its "CODE" section 357 if(psh[i].Characteristics & IMAGE_SCN_CNT_CODE || 358 (psh[i].Characteristics & IMAGE_SCN_MEM_EXECUTE && 359 !(psh[i].Characteristics & (IMAGE_SCN_CNT_UNINITIALIZED_DATA | IMAGE_SCN_CNT_INITIALIZED_DATA))) //KSO: make sure its not marked as a datasection 354 360 ) 355 361 { … … 394 400 } 395 401 else { 396 if(GetSectionHdrByName (win32file, &sh, ".rsrc"))402 if(GetSectionHdrByImageDir(win32file, IMAGE_DIRECTORY_ENTRY_RESOURCE, &sh)) 397 403 { 398 404 addSection(SECTION_RESOURCE, sh.PointerToRawData, … … 539 545 //PH: get pResRootDir pointer correct first, since processImports may 540 546 // implicitly call functions depending on it. 541 if(GetSectionHdrBy Name (win32file, &sh, ".rsrc")) {547 if(GetSectionHdrByImageDir(win32file, IMAGE_DIRECTORY_ENTRY_RESOURCE, &sh)) { 542 548 //get offset in resource object of directory entry 543 549 pResRootDir = (PIMAGE_RESOURCE_DIRECTORY)(sh.VirtualAddress + realBaseAddress);
Note:
See TracChangeset
for help on using the changeset viewer.