- Timestamp:
- Jul 23, 2002, 3:51:49 PM (23 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/mmap.cpp
r8877 r8913 1 /* $Id: mmap.cpp,v 1.5 8 2002-07-15 14:28:51sandervl Exp $ */1 /* $Id: mmap.cpp,v 1.59 2002-07-23 13:51:47 sandervl Exp $ */ 2 2 3 3 /* … … 434 434 } 435 435 } 436 mapview = new Win32MemMapView(this, offset, (size == 0) ? mSize: size, fdwAccess);436 mapview = new Win32MemMapView(this, offset, (size == 0) ? (mSize - offset) : size, fdwAccess); 437 437 if(mapview == NULL) { 438 438 goto fail; -
trunk/src/kernel32/mmap.h
r8900 r8913 1 /* $Id: mmap.h,v 1.2 3 2002-07-21 09:20:56sandervl Exp $ */1 /* $Id: mmap.h,v 1.24 2002-07-23 13:51:48 sandervl Exp $ */ 2 2 3 3 /* … … 122 122 DWORD getAccessFlags() { return mfAccess; }; 123 123 DWORD getSize() { return mSize; }; 124 LPVOID getViewAddr() { return pMapView; };125 124 ULONG getOffset() { return mOffset; }; 125 LPVOID getViewAddr() { return (LPVOID)((char *)pMapView + getOffset()); }; 126 126 127 127 BOOL everythingOk() { return errorState == 0; }; -
trunk/src/kernel32/windllpeldr.cpp
r8885 r8913 1 /* $Id: windllpeldr.cpp,v 1.1 0 2002-07-18 11:52:56 achimhaExp $ */1 /* $Id: windllpeldr.cpp,v 1.11 2002-07-23 13:51:48 sandervl Exp $ */ 2 2 3 3 /* … … 34 34 #include "dbglocal.h" 35 35 36 //******************************************************************************37 // Design information on PE DLL memory layout - AH 2002-07-1838 //39 // We are currently using (high) private memory for all PE objects, including the40 // read/execute code segments, constant data segments and global data segments.41 // Global data segments might not be implemented correctly at all as we've never42 // encountered any applictions making use of them. Therefore we are actually43 // wasting memory when running multiple processes using the same PE DLLs.44 //45 // There are several reasons for this design decisions. Both OS/2 (LX) and46 // Windows NT put all DLL segments into the shared arena. What they do for47 // instance data is map it for each process to read-only pages initially. When48 // a write attempt is made by a process, an exception will be triggered. This49 // makes the operating system to copy the data to a new page that is read/write50 // and change the page table of the process to map the linear process in the51 // shared arena to private memory (this is called "copy-on-write").52 // Even though an application is not guaranteed any virtual address for instance53 // data segments, they always end up in the shared region and the virtual addreses54 // are contiguous. An application could therefore make nasty assumptions.55 // Unfortunately, it is not possible for us from ring 3 to replicate the behavior56 // for our PE loader. While we can make the page read only and catch the57 // exception, we have no method to remap the pages to private memory.58 //59 // One solution would be to create another reagion with the private region,60 // i.e. define some address space range as reserved in Odin (configurable to61 // workaround issues with certain PE images requiring those addresses). We62 // could then load the instance data segments of PE DLLs into this private63 // memory arena and still guarantee identical virtual addresses for each64 // process.65 //66 // While the above method should work fine (assuming an application does not67 // make any nasty assumptions), there is one major problem. If we enable the68 // PE on-demand loader (i.e. the mmap loads each page from the PE file when69 // it is accesses for the first time - very much like NT), then we would have70 // nasty concurrency issues. A process could access a page for the first time71 // and the exception is triggered. We commit the page read the data in using72 // a call to DosRead. If the very same page is accessed from a different73 // process after we have committed it but before we have finished the DosRead,74 // we would run into problems. Unfortunately, there does not seem to be any75 // solution for this.76 //77 // The bottomline is that we put everything into private memory and accept the78 // drawback of wasting memory.79 //******************************************************************************80 81 36 82 37 //****************************************************************************** … … 98 53 //****************************************************************************** 99 54 //****************************************************************************** 100 BOOL Win32PeLdrDll::init(ULONG reservedMem )55 BOOL Win32PeLdrDll::init(ULONG reservedMem, ULONG ulPEOffset) 101 56 { 102 57 char modname[CCHMAXPATH]; -
trunk/src/kernel32/windllpeldr.h
r6015 r8913 1 /* $Id: windllpeldr.h,v 1. 2 2001-06-15 09:42:49 birdExp $ */1 /* $Id: windllpeldr.h,v 1.3 2002-07-23 13:51:48 sandervl Exp $ */ 2 2 3 3 /* … … 22 22 virtual ~Win32PeLdrDll(); 23 23 24 virtual BOOL init(ULONG reservedMem );24 virtual BOOL init(ULONG reservedMem, ULONG ulPEOffset = 0); 25 25 26 26 BOOL isLxDll() const; -
trunk/src/kernel32/winexepeldr.cpp
r8910 r8913 1 /* $Id: winexepeldr.cpp,v 1.1 8 2002-07-23 13:25:34sandervl Exp $ */1 /* $Id: winexepeldr.cpp,v 1.19 2002-07-23 13:51:48 sandervl Exp $ */ 2 2 3 3 /* … … 135 135 136 136 OS2SetExceptionHandler(&exceptFrame); 137 if(WinExe->init(reservedMem ) == FALSE)137 if(WinExe->init(reservedMem, ulPEOffset) == FALSE) 138 138 { 139 139 if(szErrorModule[0] != 0) { … … 185 185 //****************************************************************************** 186 186 //****************************************************************************** 187 BOOL Win32PeLdrExe::init(ULONG reservedMem)188 {189 BOOL rc;190 191 rc = Win32PeLdrImage::init(reservedMem);192 return rc;193 }194 //******************************************************************************195 //****************************************************************************** -
trunk/src/kernel32/winexepeldr.h
r8910 r8913 1 /* $Id: winexepeldr.h,v 1. 6 2002-07-23 13:25:34sandervl Exp $ */1 /* $Id: winexepeldr.h,v 1.7 2002-07-23 13:51:48 sandervl Exp $ */ 2 2 3 3 /* … … 25 25 virtual ~Win32PeLdrExe(); 26 26 27 virtual BOOL init(ULONG reservedMem);28 29 27 protected: 30 28 private: -
trunk/src/kernel32/winimagepeldr.cpp
r8883 r8913 1 /* $Id: winimagepeldr.cpp,v 1.9 8 2002-07-17 21:09:20 achimhaExp $ */1 /* $Id: winimagepeldr.cpp,v 1.99 2002-07-23 13:51:49 sandervl Exp $ */ 2 2 3 3 /* … … 21 21 * So an instance of this type can't be used for anything but resource lookup! 22 22 * 23 * NOTE: File pointer operations relative to the start of the file must add 24 * ulPEOffset (in case PE image start != file start) 23 25 * 24 26 */ … … 118 120 nrOrdExportsRegistered(0) 119 121 { 120 HFILE dllfile;122 HFILE dllfile; 121 123 122 124 fIsPEImage = TRUE; … … 173 175 //****************************************************************************** 174 176 //****************************************************************************** 175 BOOL Win32PeLdrImage::init(ULONG reservedMem )177 BOOL Win32PeLdrImage::init(ULONG reservedMem, ULONG ulPEOffset) 176 178 { 177 179 LPVOID win32file = NULL; … … 184 186 IMAGE_DOS_HEADER doshdr; 185 187 ULONG signature; 188 189 //offset in executable image where real PE file starts (default 0) 190 this->ulPEOffset = ulPEOffset; 186 191 187 192 hFile = OSLibDosOpen(szFileName, OSLIB_ACCESS_READONLY|OSLIB_ACCESS_SHAREDENYNONE); … … 200 205 goto failure; 201 206 } 202 if(OSLibDosSetFilePtr(hFile, doshdr.e_lfanew, OSLIB_SETPTR_FILE_BEGIN) == -1) {207 if(OSLibDosSetFilePtr(hFile, ulPEOffset+doshdr.e_lfanew, OSLIB_SETPTR_FILE_BEGIN) == -1) { 203 208 goto failure; 204 209 } … … 236 241 goto failure; 237 242 } 238 win32file = memmap->mapViewOfFile(0, 0, 2); 243 //PE image starts at offset ulPEOffset (default 0) 244 win32file = memmap->mapViewOfFile(0, ulPEOffset, 2); 239 245 240 246 if(DosQueryPathInfo(szFileName, FIL_QUERYFULLNAME, szFullPath, sizeof(szFullPath)) == 0) { … … 580 586 581 587 #ifdef COMMIT_ALL 582 // this is a workaround until we have full page fault handling. We583 // just commit all pages here, i.e. do the DosReads584 588 for (i=0; i<nSections; i++) { 585 589 commitPage((ULONG)section[i].realvirtaddr, FALSE, COMPLETE_SECTION); … … 597 601 } 598 602 #endif 599 // here we are going to parse the export table and build a list600 // in memory of what this module exports601 603 if(processExports((char *)win32file) == FALSE) { 602 604 dprintf((LOG, "Failed to process exported apis" )); … … 612 614 #endif 613 615 614 // a HINSTANCE in Windows is actually a pointer to the PE header!616 //SvL: Use pointer to image header as module handle now. Some apps needs this 615 617 hinstance = (HINSTANCE)realBaseAddress; 616 618 … … 627 629 } 628 630 629 // Allocate TLS index for this module 630 // Must do this before dlls are loaded for this module. Some apps assume 631 // they get TLS index 0 for their main executable 632 // AH TODO: is this really safe here? We call processExports before and 633 // the module might export forwarders so additional DLLs are loaded which 634 // in turn might allocate TLS in the initterm routine! 631 //Allocate TLS index for this module 632 //Must do this before dlls are loaded for this module. Some apps assume 633 //they get TLS index 0 for their main executable 635 634 { 636 635 USHORT sel = SetWin32TIB(TIB_SWITCH_FORCE_WIN32); … … 642 641 if(!(dwFlags & (FLAG_PELDR_LOADASDATAFILE | FLAG_PELDR_SKIPIMPORTS))) 643 642 { 644 // this will process all import statements and resolve them. I.e.645 // additional DLLs will be loaded automatically.646 643 if(processImports((char *)win32file) == FALSE) { 647 644 dprintf((LOG, "Failed to process imports!" )); … … 737 734 { 738 735 Section *section; 739 ULONG fileoffset; // this will be the offset in the file we have to read at 740 // it will be calculated from the virtual address 741 ULONG offset, size, sectionsize, protflags, range, attr; 736 ULONG offset, size, sectionsize, protflags, fileoffset, range, attr; 742 737 ULONG ulNewPos, ulRead, orgVirtAddress = virtAddress; 743 738 APIRET rc; … … 748 743 } 749 744 750 // round down to nearest page boundary745 //Round down to nearest page boundary 751 746 virtAddress = virtAddress & ~0xFFF; 752 747 753 // check if this address corresponds to any PE section754 748 section = findSectionByOS2Addr(virtAddress); 755 749 if(section == NULL) { 756 // maybe the section does not start at a page boundary?757 750 section = findSectionByOS2Addr(orgVirtAddress); 758 751 if(section) { … … 760 753 } 761 754 } 762 // if we still haven't found the section, it's a special case763 755 if(section == NULL) { 764 756 size = 4096; … … 766 758 //Header page must be readonly (same as in NT) 767 759 protflags = PAG_READ; 768 769 // check if there is a previous section770 760 section = findPreviousSectionByOS2Addr(virtAddress); 771 772 // no, so it must be the PE header 773 if(section == NULL) { 761 if(section == NULL) {//access to header 774 762 offset = 0; 775 763 fileoffset = virtAddress - realBaseAddress; … … 785 773 sectionsize = section->virtualsize - offset; 786 774 787 // check if this is unitialized data (i.e. not present in the PE file788 // and set to 0 by the PE loader789 775 if(offset > section->rawsize || section->type == SECTION_UNINITDATA) { 790 // AH TODO shouldn't be abusing these variables here...776 //unintialized data (set to 0) 791 777 size = 0; 792 778 fileoffset = -1; 793 779 } 794 780 else { 795 size = section->rawsize -offset;781 size = section->rawsize-offset; 796 782 fileoffset = section->rawoffset + offset; 797 783 } … … 801 787 } 802 788 } 803 // we completely ignore debug sections! 804 if(fPageCmd == COMPLETE_SECTION && (section && section->type == SECTION_DEBUG)) { 789 if(fPageCmd == COMPLETE_SECTION && (section && section->type == SECTION_DEBUG)) {//ignore 805 790 return TRUE; 806 791 } … … 832 817 sectionsize = min(sectionsize, range); 833 818 834 // make sure this is not address space that has no backing PE file data835 // (i.e. uninitialized data)836 // AH TODO: don't abuse these variables!837 819 if(size && fileoffset != -1) { 838 820 rc = DosEnterCritSec(); … … 841 823 goto fail; 842 824 } 843 // we need write permissions for now to do the actual loading844 825 rc = DosSetMem((PVOID)virtAddress, sectionsize, PAG_READ|PAG_WRITE|PAG_COMMIT); 845 826 if(rc) { … … 849 830 } 850 831 851 if(DosSetFilePtr(hFile, fileoffset, FILE_BEGIN, &ulNewPos) == -1) {832 if(DosSetFilePtr(hFile, ulPEOffset+fileoffset, FILE_BEGIN, &ulNewPos) == -1) { 852 833 DosExitCritSec(); 853 834 dprintf((LOG, "Win32PeLdrImage::commitPage: DosSetFilePtr failed for 0x%x!", fileoffset)); … … 874 855 setFixups(virtAddress, sectionsize); 875 856 876 // set the protection flags to what the section requests877 857 rc = DosSetMem((PVOID)virtAddress, sectionsize, protflags); 878 858 DosExitCritSec(); … … 883 863 } 884 864 else { 885 // unitialized data section, padded with 0 (done by OS/2)886 887 865 rc = DosEnterCritSec(); 888 866 if(rc) { … … 891 869 } 892 870 893 // get temporary write permission894 871 rc = DosSetMem((PVOID)virtAddress, sectionsize, PAG_READ|PAG_WRITE|PAG_COMMIT); 895 872 if(rc) { … … 900 877 setFixups(virtAddress, sectionsize); 901 878 902 // set the protection flags to what the section requests903 879 rc = DosSetMem((PVOID)virtAddress, sectionsize, protflags); 904 880 DosExitCritSec(); … … 955 931 return allocFixedMem(reservedMem); 956 932 } 957 // AH TODO: aren't we wasting 64kb address space here if things go bad?958 933 rc = OSLibDosAllocMem((PPVOID)&baseAddress, imageSize, PAG_READ | PAG_WRITE); 959 934 if(rc) { … … 1129 1104 } 1130 1105 //****************************************************************************** 1131 // setFixups:1132 // this is the main fixup processing function. It uses the virtual image base1133 // address (oh.ImageBase) and replaces all fixups by the relative virtual address1134 // plus the image base address1135 1106 //****************************************************************************** 1136 1107 BOOL Win32PeLdrImage::setFixups(ULONG virtAddress, ULONG size) 1137 1108 { 1138 int i;1109 int i, j; 1139 1110 char *page; 1140 1111 ULONG count, newpage; … … 1142 1113 PIMAGE_BASE_RELOCATION prel = pFixups; 1143 1114 1144 // is fixup processing required?1145 1115 if(realBaseAddress == oh.ImageBase || fh.Characteristics & IMAGE_FILE_RELOCS_STRIPPED) { 1146 1116 return(TRUE); 1147 1117 } 1148 1118 1149 // convert the virtual address to a relative virtual address1150 1119 virtAddress -= realBaseAddress; 1151 1152 // round size to next page boundary 1153 size = (size - 1) & ~0xFFF; 1120 //round size to next page boundary 1121 size = (size-1) & ~0xFFF; 1154 1122 size += PAGE_SIZE; 1155 1123 1156 // do we have relocation records (aka fixups)?1157 1124 if(prel) { 1158 // move to the first relocation record1159 while(((ULONG)prel < (ULONG)pFixups +dwFixupSize) &&1125 j = 1; 1126 while(((ULONG)prel < (ULONG)pFixups+dwFixupSize) && 1160 1127 prel->VirtualAddress && prel->VirtualAddress < virtAddress) 1161 1128 { 1162 1129 prel = (PIMAGE_BASE_RELOCATION)((char*)prel + prel->SizeOfBlock); 1163 1130 } 1164 // go through all relocation records 1165 while(((ULONG)prel < (ULONG)pFixups + dwFixupSize) && 1131 while(((ULONG)prel < (ULONG)pFixups+dwFixupSize) && 1166 1132 prel->VirtualAddress && prel->VirtualAddress < virtAddress + size) 1167 1133 { 1168 1134 page = (char *)((char *)prel + (ULONG)prel->VirtualAddress); 1169 // determine how many fixups we have to process1170 count = (prel->SizeOfBlock - 8) / 2;1171 for(i = 0; i < count;i++) {1135 count = (prel->SizeOfBlock - 8)/2; 1136 j++; 1137 for(i=0;i<count;i++) { 1172 1138 int type = prel->TypeOffset[i] >> 12; 1173 1139 int offset = prel->TypeOffset[i] & 0xFFF; … … 1184 1150 break; 1185 1151 } 1186 // if the fixup crosses the final page boundary,1187 // 1152 //If the fixup crosses the final page boundary, 1153 //then we have to load another page 1188 1154 if(prel->VirtualAddress + offset + fixupsize > virtAddress + size) 1189 1155 { … … 1191 1157 newpage &= ~0xFFF; 1192 1158 1193 // find the corresponding section so that we know lateron1194 // what permission bits we have to assign to the new page1195 1159 section = findSectionByOS2Addr(newpage); 1196 1160 if(section == NULL) { 1197 // 1198 dprintf((LOG, " setFixups -> section == NULL!!"));1161 //should never happen 1162 dprintf((LOG, "::setFixups -> section == NULL!!")); 1199 1163 return FALSE; 1200 1164 } 1201 // explicitly read page from disk1165 //SvL: Read page from disk 1202 1166 commitPage(newpage, FALSE, SINGLE_PAGE); 1203 1167 1204 1168 //SvL: Enable write access (TODO: may need to prevent other threads from being active) 1205 DosSetMem((PVOID)newpage, PAGE_SIZE, PAG_READ |PAG_WRITE);1169 DosSetMem((PVOID)newpage, PAGE_SIZE, PAG_READ|PAG_WRITE); 1206 1170 } 1207 1171 … … 1224 1188 break; 1225 1189 } 1226 // did we have to load another page?1227 1190 if(prel->VirtualAddress + offset + fixupsize > virtAddress + size) 1228 1191 { … … 1231 1194 } 1232 1195 } 1233 // move to the next relocation record1234 1196 prel = (PIMAGE_BASE_RELOCATION)((char*)prel + prel->SizeOfBlock); 1235 1197 }//while … … 1245 1207 BOOL Win32PeLdrImage::setFixups(PIMAGE_BASE_RELOCATION prel) 1246 1208 { 1247 int i; 1248 #if DEBUG 1249 int j; 1250 #endif 1209 int i, j; 1251 1210 char *page; 1252 1211 ULONG count; 1253 1212 1254 // if there are no fixups, we have nothing to do...1255 1213 if(fh.Characteristics & IMAGE_FILE_RELOCS_STRIPPED) { 1256 1214 return(TRUE); … … 1258 1216 1259 1217 if(prel) { 1260 #if DEBUG1261 1218 j = 1; 1262 #endif1263 // loop through all relocation records1264 1219 while(prel->VirtualAddress) { 1265 1220 page = (char *)((char *)prel + (ULONG)prel->VirtualAddress); 1266 // determine how many fixups we have to process 1267 count = (prel->SizeOfBlock - 8) / 2; 1268 1269 dprintf((LOG, "Page %d Address %x Count %d", j, prel->VirtualAddress, count)); 1270 #if DEBUG 1221 count = (prel->SizeOfBlock - 8)/2; 1222 dprintf((LOG, "Page %d Address %x Count %d", j, prel->VirtualAddress, count )); 1271 1223 j++; 1272 #endif 1273 1274 for(i = 0; i < count; i++) { 1224 for(i=0;i<count;i++) { 1275 1225 int type = prel->TypeOffset[i] >> 12; 1276 1226 int offset = prel->TypeOffset[i] & 0xFFF; … … 1296 1246 } 1297 1247 } 1298 // advance to the next relocation record1299 1248 prel = (PIMAGE_BASE_RELOCATION)((char*)prel + prel->SizeOfBlock); 1300 1249 }//while … … 1316 1265 fixup = (ULONG *)(fixupaddr + realBaseAddress); 1317 1266 orgaddr = *fixup; 1318 // //dprintf((LOG, "AddOff32Fixup 0x%x org 0x%x -> new 0x%x", fixup, orgaddr, realBaseAddress + (*fixup - oh.ImageBase)));1267 // dprintf((LOG, "AddOff32Fixup 0x%x org 0x%x -> new 0x%x", fixup, orgaddr, realBaseAddress + (*fixup - oh.ImageBase))); 1319 1268 *fixup = realBaseAddress + (*fixup - oh.ImageBase); 1320 1269 } … … 1619 1568 } 1620 1569 1621 // if it's not a PE image, we let OS/2 load it (LX image)1622 1570 if(isPEImage(modname, NULL, NULL) != ERROR_SUCCESS_W) 1623 { 1571 {//LX image, so let OS/2 do all the work for us 1624 1572 APIRET rc; 1625 1573 char szModuleFailure[CCHMAXPATH] = ""; … … 1627 1575 Win32LxDll *lxdll; 1628 1576 1629 // check if we have the .DLL extension or have to add it first1630 1577 char *dot = strchr(modname, '.'); 1631 1578 if(dot == NULL) { 1632 1579 strcat(modname, DLL_EXTENSION); 1633 1580 } 1634 // here we load the module. This will also execute the initterm1635 // function in the DLL. We expect the LX DLL to callback RegisterLxDll1636 // to register with Odin. This also means we cannot load "standard"1637 // LX DLLs with this method - they have to be Odin aware1638 1581 rc = DosLoadModule(szModuleFailure, sizeof(szModuleFailure), modname, (HMODULE *)&hInstanceNewDll); 1639 1582 if(rc) { … … 1643 1586 return NULL; 1644 1587 } 1645 // due to the callback requirement, we can expect to have a structure1646 // for it by now. Otherwise it didn't work out1647 1588 lxdll = Win32LxDll::findModuleByOS2Handle(hInstanceNewDll); 1648 1589 if(lxdll == NULL) {//shouldn't happen! 1649 1590 dprintf((LOG, "Just loaded the dll, but can't find it anywhere?!!?")); 1650 // AH TODO: shouldn't we do a DosFreeModule here?1651 1591 errorState = ERROR_INTERNAL; 1652 1592 return NULL; 1653 1593 } 1654 1594 lxdll->setDllHandleOS2(hInstanceNewDll); 1655 // AddRef for a LX DLL is special - it does not increase the reference counter1656 1595 if(lxdll->AddRef() == -1) {//-1 -> load failed (attachProcess) 1657 1596 dprintf((LOG, "Dll %s refused to be loaded; aborting", modname)); … … 1664 1603 else { 1665 1604 Win32PeLdrDll *pedll; 1666 // create an object for that DLL 1605 1667 1606 pedll = new Win32PeLdrDll(modname, this); 1668 1607 if(pedll == NULL) { … … 1675 1614 dprintf((LOG, "********************** Loading Module *********************" )); 1676 1615 dprintf((LOG, "**********************************************************************" )); 1677 // do the actual loading including all imports - so this is a point of recursion1678 1616 if(pedll->init(0) == FALSE) { 1679 1617 dprintf((LOG, "Internal WinDll error ", pedll->getError() )); … … 1684 1622 pedll->AddRef(getModuleName()); 1685 1623 #else 1686 // increase the reference count1687 1624 pedll->AddRef(); 1688 1625 #endif 1689 // send the attach process message to the DLL, i.e. call the handler1690 1626 if(pedll->attachProcess() == FALSE) { 1691 1627 dprintf((LOG, "attachProcess failed!" )); … … 2122 2058 } 2123 2059 //****************************************************************************** 2124 // we link this function to all imports we couldn't resolve in our DLLs so the2125 // user gets a stupid error message dialog2126 2060 //****************************************************************************** 2127 2061 ULONG WIN32API MissingApi(char *message) -
trunk/src/kernel32/winimagepeldr.h
r5914 r8913 1 /* $Id: winimagepeldr.h,v 1.1 6 2001-06-06 10:01:48 phallerExp $ */1 /* $Id: winimagepeldr.h,v 1.17 2002-07-23 13:51:49 sandervl Exp $ */ 2 2 3 3 /* … … 76 76 virtual ~Win32PeLdrImage(); 77 77 78 //reservedMem is address of memory reserved in peldr.dll (allocated before 79 //any dlls are loaded, so that exes without fixups can be loaded at a low 80 //address) 81 virtual BOOL init(ULONG reservedMem); 78 //reservedMem: address of memory reserved in peldr.dll (allocated before 79 // any dlls are loaded, so that exes without fixups can be 80 // loaded at a low address) 81 //ulPEOffset: offset in file where real PE image starts 82 virtual BOOL init(ULONG reservedMem, ULONG ulPEOffset = 0); 82 83 83 84 virtual BOOL insideModule(ULONG address); … … 140 141 Section *section; 141 142 143 //offset in executable image where real PE file starts (default 0) 144 ULONG ulPEOffset; 145 142 146 //internal flags (see FLAGS_PELDR_*) 143 147 DWORD dwFlags;
Note:
See TracChangeset
for help on using the changeset viewer.