- Timestamp:
- Nov 16, 1999, 6:09:31 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/pe2lx/pe2lx.cpp
r1755 r1756 1 /* $Id: pe2lx.cpp,v 1. 9 1999-11-16 16:11:43bird Exp $1 /* $Id: pe2lx.cpp,v 1.10 1999-11-16 17:09:31 bird Exp $ 2 2 * 3 3 * Pe2Lx class implementation. Ring 0 and Ring 3 … … 1909 1909 rc = pRelocReader->readAtRVA(ulRVABaseReloc, SSToDS(&BaseReloc), sizeof(BaseReloc)); 1910 1910 1911 1912 1911 /* 1913 1912 * The Loop! Iterate thru all pages for all objects. … … 2027 2026 PWORD pawoffFixup; 2028 2027 2029 pawoffFixup = (PWORD)malloc((size_t)(c * sizeof(WORD))); 2030 if (pawoffFixup != NULL) 2031 rc = pRelocReader->readAtRVA(ulRVABaseReloc + offsetof(IMAGE_BASE_RELOCATION, TypeOffset), 2032 pawoffFixup, c * sizeof(WORD)); 2033 else 2034 rc = ERROR_NOT_ENOUGH_MEMORY; 2035 2036 /* loop thru the baserelocation in this chunk. */ 2037 for (ul = 0; ul < c && rc == NO_ERROR; ul++) 2028 if (c != 0) 2038 2029 { 2039 WORD woffFixup; 2040 ULONG ulTarget; 2041 /* Get relocation type/offset. */ 2030 pawoffFixup = (PWORD)malloc((size_t)(c * sizeof(WORD))); 2042 2031 if (pawoffFixup != NULL) 2043 woffFixup = pawoffFixup[ul]; 2044 2045 /* Get target. */ 2046 rc = pPageReader->readAtRVA(BaseReloc.VirtualAddress + (woffFixup & 0x0FFF), 2047 SSToDS(&ulTarget), sizeof(ulTarget)); 2048 if (rc == NO_ERROR) 2032 rc = pRelocReader->readAtRVA(ulRVABaseReloc + offsetof(IMAGE_BASE_RELOCATION, TypeOffset), 2033 pawoffFixup, c * sizeof(WORD)); 2034 else 2035 rc = ERROR_NOT_ENOUGH_MEMORY; 2036 2037 /* loop thru the baserelocation in this chunk. */ 2038 for (ul = 0; ul < c && rc == NO_ERROR; ul++) 2049 2039 { 2050 switch (woffFixup >> 12) 2040 WORD woffFixup; 2041 ULONG ulTarget; 2042 /* Get relocation type/offset. */ 2043 if (pawoffFixup != NULL) 2044 woffFixup = pawoffFixup[ul]; 2045 2046 /* Get target. */ 2047 rc = pPageReader->readAtRVA(BaseReloc.VirtualAddress + (woffFixup & 0x0FFF), 2048 SSToDS(&ulTarget), sizeof(ulTarget)); 2049 if (rc == NO_ERROR) 2051 2050 { 2052 case IMAGE_REL_BASED_HIGHLOW: 2053 rc = add32OffsetFixup((WORD)(woffFixup & 0x0FFF), ulTarget); 2054 printInfA(("Fixup: 0x%03x target 0x%08x (rc = %d) %s\n", 2055 (woffFixup & 0x0FFF), ulTarget, rc, 2056 pvCrossPageFixup ? "crosspage" : "")); 2057 break; 2058 case IMAGE_REL_BASED_ABSOLUTE: /* ignored! */ 2059 break; 2060 default: 2061 printWar(("Unknown/unsupported fixup type!, 0x%1x\n", woffFixup >> 12)); 2051 switch (woffFixup >> 12) 2052 { 2053 case IMAGE_REL_BASED_HIGHLOW: 2054 rc = add32OffsetFixup((WORD)(woffFixup & 0x0FFF), ulTarget); 2055 printInfA(("Fixup: 0x%03x target 0x%08x (rc = %d) %s\n", 2056 (woffFixup & 0x0FFF), ulTarget, rc, 2057 pvCrossPageFixup ? "crosspage" : "")); 2058 break; 2059 case IMAGE_REL_BASED_ABSOLUTE: /* ignored! */ 2060 break; 2061 default: 2062 printWar(("Unknown/unsupported fixup type!, 0x%1x\n", woffFixup >> 12)); 2063 } 2062 2064 } 2063 2065 } 2064 2066 } 2067 2065 2068 /* cleanup */ 2066 2069 if (pawoffFixup != NULL)
Note:
See TracChangeset
for help on using the changeset viewer.