Changeset 87 in kStuff
- Timestamp:
- Sep 7, 2016 1:09:12 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kLdr/kLdrModLX.c
r81 r87 119 119 PFNKLDRMODGETIMPORT pfnGetImport, void *pvUser); 120 120 static int kldrModLXDoCreate(PKRDR pRdr, KLDRFOFF offNewHdr, PKLDRMODLX *ppModLX); 121 static const KU8 *kldrModLXDoNameTableLookupByOrdinal(const KU8 *pbNameTable, K I32cbNameTable, KU32 iOrdinal);122 static int kldrModLXDoNameLookup(PKLDRMODLX pModLX, const char *pchSymbol, K U32cchSymbol, KU32 *piSymbol);123 static const KU8 *kldrModLXDoNameTableLookupByName(const KU8 *pbNameTable, K I32cbNameTable,121 static const KU8 *kldrModLXDoNameTableLookupByOrdinal(const KU8 *pbNameTable, KSSIZE cbNameTable, KU32 iOrdinal); 122 static int kldrModLXDoNameLookup(PKLDRMODLX pModLX, const char *pchSymbol, KSIZE cchSymbol, KU32 *piSymbol); 123 static const KU8 *kldrModLXDoNameTableLookupByName(const KU8 *pbNameTable, KSSIZE cbNameTable, 124 124 const char *pchSymbol, KSIZE cchSymbol); 125 125 static int kldrModLXDoLoadBits(PKLDRMODLX pModLX, void *pvBits); … … 298 298 pMod->pOps = NULL; /* set upon success. */ 299 299 pMod->cSegments = Hdr.e32_objcnt; 300 pMod->cchFilename = cchFilename;300 pMod->cchFilename = (KU32)cchFilename; 301 301 pMod->pszFilename = (char *)K_ALIGN_P(&pMod->aSegments[pMod->cSegments], 8); 302 302 kHlpMemCopy((char *)pMod->pszFilename, kRdrName(pRdr), cchFilename + 1); … … 478 478 else 479 479 pMod->aSegments[i].cbMapped = pModLX->paObjs[i + 1].o32_base - pModLX->paObjs[i].o32_base; 480 NextRVA += pMod->aSegments[i].cbMapped;480 NextRVA += (KU32)pMod->aSegments[i].cbMapped; 481 481 482 482 /* protection */ … … 709 709 * @param piSymbol Where to store the symbol ordinal. 710 710 */ 711 static int kldrModLXDoNameLookup(PKLDRMODLX pModLX, const char *pchSymbol, K U32cchSymbol, KU32 *piSymbol)711 static int kldrModLXDoNameLookup(PKLDRMODLX pModLX, const char *pchSymbol, KSIZE cchSymbol, KU32 *piSymbol) 712 712 { 713 713 … … 784 784 * @param cchSymbol The length of the symbol name. 785 785 */ 786 static const KU8 *kldrModLXDoNameTableLookupByName(const KU8 *pbNameTable, K I32cbNameTable,786 static const KU8 *kldrModLXDoNameTableLookupByName(const KU8 *pbNameTable, KSSIZE cbNameTable, 787 787 const char *pchSymbol, KSIZE cchSymbol) 788 788 { … … 1173 1173 * @param iOrdinal The ordinal to search for. 1174 1174 */ 1175 static const KU8 *kldrModLXDoNameTableLookupByOrdinal(const KU8 *pbNameTable, K I32cbNameTable, KU32 iOrdinal)1175 static const KU8 *kldrModLXDoNameTableLookupByOrdinal(const KU8 *pbNameTable, KSSIZE cbNameTable, KU32 iOrdinal) 1176 1176 { 1177 1177 while (*pbNameTable != 0 && cbNameTable > 0) … … 1424 1424 { 1425 1425 const struct o32_obj * const pObj = &pModLX->paObjs[i]; 1426 const KU32 cPages = pModLX->pMod->aSegments[i].cbMapped / OBJPAGELEN;1426 const KU32 cPages = (KU32)(pModLX->pMod->aSegments[i].cbMapped / OBJPAGELEN); 1427 1427 KU32 iPage; 1428 1428 KU8 *pbPage = (KU8 *)pvBits + (KUPTR)pModLX->pMod->aSegments[i].RVA; … … 2039 2039 if (pvMapping == KLDRMOD_INT_MAP) 2040 2040 { 2041 pvMapping = pModLX->pvMapping;2041 pvMapping = (void *)pModLX->pvMapping; 2042 2042 if (!pvMapping) 2043 2043 return KLDR_ERR_NOT_MAPPED; … … 2166 2166 if (pvMapping == KLDRMOD_INT_MAP) 2167 2167 { 2168 pvMapping = pModLX->pvMapping;2168 pvMapping = (void *)pModLX->pvMapping; 2169 2169 if (!pvMapping) 2170 2170 return KLDR_ERR_NOT_MAPPED; … … 2476 2476 && off >= 0 2477 2477 && off <= OBJPAGELEN - 4) 2478 *(KU32 *)&pbPage[off] = uValue;2478 *(KU32 *)&pbPage[off] = (KU32)uValue; 2479 2479 else if ( (u.prlc->nr_stype & NRSRCMASK) == NRSOFF32 2480 2480 && off >= 0 2481 2481 && off <= OBJPAGELEN - 4) 2482 *(KU32 *)&pbPage[off] = uValue - (PageAddress + off + 4);2482 *(KU32 *)&pbPage[off] = (KU32)(uValue - (PageAddress + off + 4)); 2483 2483 else 2484 2484 { … … 2501 2501 int off = *poffSrc++; 2502 2502 if (off >= 0 && off <= OBJPAGELEN - 4) 2503 *(KU32 *)&pbPage[off] = uValue;2503 *(KU32 *)&pbPage[off] = (KU32)uValue; 2504 2504 else 2505 2505 { … … 2516 2516 int off = *poffSrc++; 2517 2517 if (off >= 0 && off <= OBJPAGELEN - 4) 2518 *(KU32 *)&pbPage[off] = uValue - (PageAddress + off + 4);2518 *(KU32 *)&pbPage[off] = (KU32)(uValue - (PageAddress + off + 4)); 2519 2519 else 2520 2520 { … … 2634 2634 break; 2635 2635 case NRSOFF32: 2636 uData.off32 = (KU32) uValue - (PageAddress + off + 4);2636 uData.off32 = (KU32)(uValue - (PageAddress + off + 4)); 2637 2637 cb = 4; 2638 2638 break;
Note:
See TracChangeset
for help on using the changeset viewer.