| 2004 | } |
| 2005 | |
| 2006 | void BlContext::PopulateIData_LookupTable(BlSegment* iDataSect, int& hintNameTableSize) |
| 2007 | { |
| 2008 | int importLookupTableSize = ((int)mImportLookups.size() + (int)mImportFiles.size()) * 8; |
| 2009 | int importDirectoryTableSize = ((int)mImportFiles.size() + 1) * 20; |
| 2010 | int hintNameTableOfs = importLookupTableSize + importDirectoryTableSize + importLookupTableSize; |
| 2011 | |
| 2012 | // Import lookup table |
| 2013 | for (auto& importFilePair : mImportFiles) |
| 2014 | { |
| 2015 | auto& importFile = importFilePair.second; |
| 2016 | for (auto lookup : importFile.mLookups) |
| 2017 | { |
| 2018 | if (lookup->mName.empty()) |
| 2019 | { |
| 2020 | mImportStream.Write((int64)0x8000000000000000LL | lookup->mHint); |
| 2021 | } |
| 2022 | else |
| 2023 | { |
| 2024 | mImportStream.Write((int64)iDataSect->mRVA + hintNameTableOfs + hintNameTableSize); |
| 2025 | hintNameTableSize += 2; |
| 2026 | hintNameTableSize += (int)lookup->mName.length() + 1; |
| 2027 | if ((hintNameTableSize % 2) == 1) |
| 2028 | hintNameTableSize++; |
| 2029 | } |
| 2030 | } |
| 2031 | |
| 2032 | mImportStream.Write((int64)0); |
| 2033 | } |
| 2034 | } |
| 2035 | |
| 2036 | void BlContext::PopulateIData(BlSegment* iDataSect) |
| 2037 | { |