- Timestamp:
- Dec 27, 1999, 10:21:33 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/makefile
r2213 r2219 1 # $Id: makefile,v 1.7 2 1999-12-27 18:42:25sandervl Exp $1 # $Id: makefile,v 1.73 1999-12-27 21:20:48 sandervl Exp $ 2 2 3 3 # … … 197 197 $(PDWIN32_INCLUDE)\winimagebase.h \ 198 198 $(PDWIN32_INCLUDE)\winfakepeldr.h \ 199 $(PDWIN32_INCLUDE)\winimagepeldr.h \ 199 200 $(PDWIN32_INCLUDE)\versionos2.h \ 200 201 $(PDWIN32_INCLUDE)\wprocess.h \ -
trunk/src/kernel32/winimagepeldr.cpp
r2138 r2219 1 /* $Id: winimagepeldr.cpp,v 1.2 5 1999-12-19 17:41:15sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.26 1999-12-27 21:20:48 sandervl Exp $ */ 2 2 3 3 /* … … 9 9 * Project Odin Software License can be found in LICENSE.TXT 10 10 * 11 * TODO: Check psh[i].Characteristics for more than only the code section 11 12 * 12 13 * NOTE: RSRC_LOAD is a special flag to only load the resource directory … … 313 314 addSection(SECTION_RELOC, psh[i].PointerToRawData, 314 315 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 315 psh[i].Misc.VirtualSize );316 psh[i].Misc.VirtualSize, psh[i].Characteristics); 316 317 continue; 317 318 } … … 320 321 addSection(SECTION_EXPORT, psh[i].PointerToRawData, 321 322 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 322 psh[i].Misc.VirtualSize );323 psh[i].Misc.VirtualSize, psh[i].Characteristics); 323 324 continue; 324 325 } … … 327 328 addSection(SECTION_RESOURCE, psh[i].PointerToRawData, 328 329 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 329 psh[i].Misc.VirtualSize );330 psh[i].Misc.VirtualSize, psh[i].Characteristics); 330 331 continue; 331 332 } … … 336 337 addSection(SECTION_TLS, psh[i].PointerToRawData, 337 338 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 338 psh[i].Misc.VirtualSize );339 psh[i].Misc.VirtualSize, psh[i].Characteristics); 339 340 } 340 341 continue; … … 345 346 addSection(SECTION_DEBUG, psh[i].PointerToRawData, 346 347 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 347 psh[i].Misc.VirtualSize );348 psh[i].Misc.VirtualSize, psh[i].Characteristics); 348 349 continue; 349 350 } … … 358 359 addSection(type, psh[i].PointerToRawData, 359 360 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 360 psh[i].Misc.VirtualSize );361 psh[i].Misc.VirtualSize, psh[i].Characteristics); 361 362 continue; 362 363 } … … 371 372 addSection(SECTION_CODE, psh[i].PointerToRawData, 372 373 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 373 psh[i].Misc.VirtualSize );374 psh[i].Misc.VirtualSize, psh[i].Characteristics); 374 375 continue; 375 376 } … … 378 379 addSection(SECTION_READONLYDATA, psh[i].PointerToRawData, 379 380 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 380 psh[i].Misc.VirtualSize );381 psh[i].Misc.VirtualSize, psh[i].Characteristics); 381 382 continue; 382 383 } … … 385 386 addSection(SECTION_UNINITDATA, psh[i].PointerToRawData, 386 387 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 387 psh[i].Misc.VirtualSize );388 psh[i].Misc.VirtualSize, psh[i].Characteristics); 388 389 continue; 389 390 } … … 392 393 addSection(SECTION_INITDATA, psh[i].PointerToRawData, 393 394 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 394 psh[i].Misc.VirtualSize );395 psh[i].Misc.VirtualSize, psh[i].Characteristics); 395 396 continue; 396 397 } … … 399 400 addSection(SECTION_UNINITDATA, psh[i].PointerToRawData, 400 401 psh[i].SizeOfRawData, psh[i].VirtualAddress + oh.ImageBase, 401 psh[i].Misc.VirtualSize );402 psh[i].Misc.VirtualSize, psh[i].Characteristics); 402 403 continue; 403 404 } … … 412 413 addSection(SECTION_RESOURCE, sh.PointerToRawData, 413 414 sh.SizeOfRawData, sh.VirtualAddress + oh.ImageBase, 414 sh.Misc.VirtualSize );415 sh.Misc.VirtualSize, sh.Characteristics); 415 416 } 416 417 } … … 659 660 //****************************************************************************** 660 661 //****************************************************************************** 661 void Win32PeLdrImage::addSection(ULONG type, ULONG rawoffset, ULONG rawsize, ULONG virtaddress, ULONG virtsize )662 void Win32PeLdrImage::addSection(ULONG type, ULONG rawoffset, ULONG rawsize, ULONG virtaddress, ULONG virtsize, ULONG flags) 662 663 { 663 664 virtsize = max(rawsize, virtsize); … … 667 668 section[nrsections].rawsize = rawsize; 668 669 section[nrsections].virtaddr = virtaddress; 670 section[nrsections].flags = flags; 669 671 670 672 virtsize = ((virtsize - 1) & ~0xFFF) + PAGE_SIZE; … … 846 848 case (SECTION_CODE | SECTION_IMPORT): 847 849 section[i].pageflags = PAG_EXECUTE | PAG_READ; 850 if(section[i].flags & IMAGE_SCN_MEM_WRITE) 851 section[i].pageflags |= PAG_WRITE; 848 852 break; 849 853 case SECTION_INITDATA:
Note:
See TracChangeset
for help on using the changeset viewer.