-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworker.js.map
1 lines (1 loc) · 282 KB
/
worker.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/worker/pe/image-flags.ts","webpack:///./src/worker/page-data/formatter.ts","webpack:///./src/worker/pe/utils.ts","webpack:///./src/worker/page-data/nav-data.ts","webpack:///./src/worker/page-data/mds-list.ts","webpack:///./src/worker/page-data/mds-table.ts","webpack:///./src/worker/page-data/metadata-headers.ts","webpack:///./src/worker/page-data/headers.ts","webpack:///./src/worker/page-data/generator.ts","webpack:///./src/worker/pe/error.ts","webpack:///./src/worker/pe/loader.ts","webpack:///./src/worker/pe/image.ts","webpack:///./src/worker/message.ts","webpack:///./src/worker/index.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","MetadataTableIndex","IMAGE_DOS_SIGNATURE","IMAGE_NT_SIGNATURE","IMAGE_NT_OPTIONAL_HDR32_MAGIC","IMAGE_NT_OPTIONAL_HDR64_MAGIC","ImageFile","ImageFileMachine","ImageSubsystem","ImageDllCharacteristics","ImageDirectoryEntry","IMAGE_NUMBEROF_DIRECTORY_ENTRIES","ImageSection","ComImageFlags","MetadataSignature","NumberOfMdTables","MetadataCodedTokenIndex","ctc","tagSize","tables","TypeDef","TypeRef","TypeSpec","Field","Param","Property","MethodDef","InterfaceImpl","MemberRef","Module","DeclSecurity","Event","StandAloneSig","ModuleRef","Assembly","AssemblyRef","File","ExportedType","ManifestResource","GenericParam","GenericParamConstraint","MethodSpec","String","AssemblyHashAlgorithm","CorAssemblyFlags","CorEventAttr","CorFieldAttr","CorFileFlags","CorGenericParamAttr","CorPinvokeMap","CorManifestResourceFlags","CorMethodAttr","CorMethodImpl","CorMethodSemanticsAttr","CorParamAttr","CorPropertyAttr","CorTypeAttr","CorDeclSecurity","CorElementType","formatU1RawHex","padZeroLeft","toString","toUpperCase","formatU2RawHex","formatU4RawHex","formatU1Hex","formatU2Hex","formatU4Hex","formatHexDec","toLocaleString","formatDec","v","formatBytes","bytes","lineWidth","lines","start","length","line","Array","from","subarray","map","b","join","push","str","len","repeat","formatUIntField","f","sz","showDec","hex","offset","_offset","size","_size","rawData","data","formatStructTitle","title","formatU1Field","formatU2Field","formatU4Field","formatU8Field","high","low","formatCompressedUIntField","formatBytesField","formatStringField","formatGuidField","decompressUint","buffer","byteLength","RangeError","calculatePadding","dataSize","align","count1","mask","isSetLong","bit","decompressInt","u","fb","getCompressedIntSize","firstByte","F","generateNavList","pe","pageID","navList","target","children","elemID","navMD","isManaged","hasMetadata","hasStrongNameSignature","getMetadataStreamHeader","pageNum","getMetadataTableHeader","ti","tid","isMetadataTableValid","getMetadataTableRows","subID","generateMDTablesNavData","generateMDHeadersNavData","U","FM","getBlobIndexes","base","indexes","dtsz","getU1","getData","putIndexToPages","pageSize","pages","pageItems","pStart","pEnd","slice","generateMdsStringsPageData","cache","cfg","pgNum","mdsStrings","mdRoot","getMetadataRoot","sh","Offset","Size","mdsOffsetListPageSize","checkAndBuildCacheForMdsStrings","items","titleOf","nav","groups","index","getMdsStringsItem","paging","currentPageNumber","pageNavList","generateMdsUSPageData","mdsUS","checkAndBuildCacheForMdsUS","item","getMdsUSItem","Value","Suffix","generateMdsBlobPageData","mdsBlob","checkAndBuildCacheForMdsBlob","getMdsBlobItem","generateMdsGuidPageData","getMdsGuidItems","generateMdtModuleItems","Generation","Name","Mvid","EncId","EncBaseId","generateMdtTypeRefItems","ResolutionScope","Namespace","generateMdtTypeDefItems","Flags","Extends","FieldList","MethodList","generateMdtFieldPtrItems","generateMdtFieldItems","Signature","generateMdtMethodPtrItems","Method","generateMdtMethodDefItems","RVA","ImplFlags","ParamList","generateMdtParamPtrItems","generateMdtParamItems","Sequence","generateMdtInterfaceImplItems","Class","Interface","generateMdtMemberRefItems","generateMdtConstantItems","Type","PaddingZero","Parent","generateMdtCustomAttributeItems","generateMdtFieldMarshalItems","NativeType","generateMdtDeclSecurityItems","Action","PermissionSet","generateMdtClassLayoutItems","PackingSize","ClassSize","generateMdtFieldLayoutItems","OffSet","generateMdtStandAloneSigItems","generateMdtEventMapItems","EventList","generateMdtEventPtrItems","generateMdtEventItems","EventFlags","EventType","generateMdtPropertyMapItems","PropertyList","generateMdtPropertyPtrItems","generateMdtPropertyItems","PropFlags","generateMdtMethodSemanticsItems","Semantic","Association","generateMdtMethodImplItems","MethodBody","MethodDeclaration","generateMdtModuleRefItems","generateMdtTypeSpecItems","generateMdtImplMapItems","MappingFlags","MemberForwarded","ImportName","ImportScope","generateMdtFieldRVAItems","generateMdtENCLogItems","Token","FuncCode","generateMdtENCMapItems","generateMdtAssemblyItems","HashAlgId","MajorVersion","MinorVersion","BuildNumber","RevisionNumber","PublicKey","Locale","generateMdtAssemblyProcessorItems","Processor","generateMdtAssemblyOSItems","OSPlatformID","OSMajorVersion","OSMinorVersion","generateMdtAssemblyRefItems","PublicKeyOrToken","HashValue","generateMdtAssemblyRefProcessorItems","generateMdtAssemblyRefOSItems","generateMdtFileItems","generateMdtExportedTypeItems","TypeDefId","TypeName","TypeNamespace","Implementation","generateMdtManifestResourceItems","generateMdtNestedClassItems","NestedClass","EnclosingClass","generateMdtGenericParamItems","Number","Owner","generateMdtMethodSpecItems","Instantiation","generateMdtGenericParamConstraintItems","Constraint","getRidOnPage","psz","mdtPageSize","rows","end","generateMdsTablePageData","tableHeader","h","Reserved","HeapSizes","Reserved2","Valid","Sorted","Rows","generateMDTableHeader","tableInfo","id","valid","sorted","isMetadataTableSorted","generateMDTableList","generateMdtPageData","loader","builder","_a","getMdtModuleItem","getMdtTypeRefItem","getMdtTypeDefItem","FieldPtr","getMdtFieldPtrItem","getMdtFieldItem","MethodPtr","getMdtMethodPtrItem","getMdtMethodDefItem","ParamPtr","getMdtParamPtrItem","getMdtParamItem","getMdtInterfaceImplItem","getMdtMemberRefItem","Constant","getMdtConstantItem","CustomAttribute","getMdtCustomAttributeItem","FieldMarshal","getMdtFieldMarshalItem","getMdtDeclSecurityItem","ClassLayout","getMdtClassLayoutItem","FieldLayout","getMdtFieldLayoutItem","getMdtStandAloneSigItem","EventMap","getMdtEventMapItem","EventPtr","getMdtEventPtrItem","getMdtEventItem","PropertyMap","getMdtPropertyMapItem","PropertyPtr","getMdtPropertyPtrItem","getMdtPropertyItem","MethodSemantics","getMdtMethodSemanticsItem","MethodImpl","getMdtMethodImplItem","getMdtModuleRefItem","getMdtTypeSpecItem","ImplMap","getMdtImplMapItem","FieldRVA","getMdtFieldRVAItem","ENCLog","getMdtENCLogItem","ENCMap","getMdtENCMapItem","getMdtAssemblyItem","AssemblyProcessor","getMdtAssemblyProcessorItem","AssemblyOS","getMdtAssemblyOSItem","getMdtAssemblyRefItem","AssemblyRefProcessor","getMdtAssemblyRefProcessorItem","AssemblyRefOS","getMdtAssemblyRefOSItem","getMdtFileItem","getMdtExportedTypeItem","getMdtManifestResourceItem","getMdtNestedClassItem","getMdtGenericParamItem","getMdtMethodSpecItem","getMdtGenericParamConstraintItem","rid","generateSignleMdtTableItems","generateTalbeItems","Math","floor","tblName","generateMdtPaging","generateMetadataHeadersPageData","cliHeader","getCliHeader","cb","MajorRuntimeVersion","MinorRuntimeVersion","MetaData","VirtualAddress","EntryPointToken","Resources","StrongNameSignature","CodeManagerTable","VTableFixups","ExportAddressTableJumps","ManagedNativeHeader","generateCliHeader","metadataRoot","VersionLength","VersionString","VersionPadding","Streams","generateMetadataRoot","streamHeaders","getMetadataStreamHeaders","Padding","generateMetadataStreamHeader","snSignature","getStrongNameSignature","generateSNSignature","generateHeadersPageData","dosHeader","getDosHeader","e_magic","e_cblp","e_cp","e_crlc","e_cparhdr","e_minalloc","e_maxalloc","e_ss","e_sp","e_csum","e_ip","e_cs","e_lfarlc","e_ovno","e_res","e_oemid","e_oeminfo","e_res2","e_lfanew","generateDosHeader","peSignature","getPESignature","generatePESignature","fileHeader","getFileHeader","Machine","NumberOfSections","TimeDateStamp","PointerToSymbolTable","NumberOfSymbols","SizeOfOptionalHeader","Characteristics","generateFileHeader","optionalHeader","getOptionalHeader","Magic","MajorLinkerVersion","MinorLinkerVersion","SizeOfCode","SizeOfInitializedData","SizeOfUninitializedData","AddressOfEntryPoint","BaseOfCode","BaseOfData","ImageBase","SectionAlignment","FileAlignment","MajorOperatingSystemVersion","MinorOperatingSystemVersion","MajorImageVersion","MinorImageVersion","MajorSubsystemVersion","MinorSubsystemVersion","Win32VersionValue","SizeOfImage","SizeOfHeaders","CheckSum","Subsystem","DllCharacteristics","SizeOfStackReserve","SizeOfStackCommit","SizeOfHeapReserve","SizeOfHeapCommit","LoaderFlags","NumberOfRvaAndSizes","fillOptionalHeader32Fields","fillOptionalHeader64Fields","generateOptionalHeader","dataDirectories","getDataDirectories","generateDataDirectories","sectionHeaders","getSectionHeaders","VirtualSize","SizeOfRawData","PointerToRawData","PointerToRelocations","PointerToLinenumbers","NumberOfRelocations","NumberOfLinenumbers","generateSectionHeaders","headers_1","metadata_headers_1","mds_table_1","mds_list_1","generatePageData","clearGeneratorCache","PEError","_super","type","_this","this","__extends","Error","loadU1Field","loadU2Field","getU2","loadU4Field","getU4","loadU8Field","loadCompressedUIntField","Uint8Array","loadU1EnumField","loadU2EnumField","loadU4EnumField","loadFixedSizeByteArrayField","loadFixedSizeAsciiStringField","fromCharCode","apply","filter","loadNullTerminatedStringField","ptr","decodeURIComponent","loadFixedSizeUnicodeStringField","arr","Uint16Array","fromCodePoint","loadStructArrayByCount","count","loadImageDataDirectory","loadMdsStringsField","getHeapSize","loadMdsGuidField","loadMdsBlobField","loadMdtRidField","getTableIDSize","loadMdCodedTokenField","baseField","getCodedTokenSize","codedTokenInfo","decodeCodedToken","__assign","token","cti","loadImageDosHeader","loadImageFileHeader","loadImageOptionalHeader32","loadImageOptionalHeader64","loadImageSectionHeader","loadCliHeader","loadMetadataRoot","loadMetadataStreamHeader","loadMetadataTableHeader","loadMetadataUSItem","suffixSize","loadMetadataBlobItem","loadMdTokenField","loadMdtModule","loadMdtTypeRef","loadMdtTypeDef","TypeDefOrRef","loadMdtFieldPtr","loadMdtField","loadMdtMethodPtr","loadMdtMethodDef","loadMdtParamPtr","loadMdtParam","loadMdtInterfaceImpl","loadMdtMemberRef","MemberRefParent","loadMdtConstant","HasConstant","loadMdtCustomAttribute","HasCustomAttribute","CustomAttributeType","loadMdtFieldMarshal","HasFieldMarshall","loadMdtDeclSecurity","HasDeclSecurity","loadMdtClassLayout","loadMdtFieldLayout","loadMdtStandAloneSig","loadMdtEventMap","loadMdtEventPtr","loadMdtEvent","loadMdtPropertyMap","loadMdtPropertyPtr","loadMdtProperty","loadMdtMethodSemantics","HasSemantics","loadMdtMethodImpl","MethodDefOrRef","loadMdtModuleRef","loadMdtTypeSpec","loadMdtImplMap","loadMdtFieldRVA","loadMdtENCLog","loadMdtENCMap","loadMdtAssembly","loadMdtAssemblyProcessor","loadMdtAssemblyOS","loadMdtAssemblyRef","loadMdtAssemblyRefProcessor","loadMdtAssemblyRefOS","loadMdtFile","loadMdtExportedType","loadMdtManifestResource","loadMdtNestedClass","loadMdtGenericParam","TypeOrMethodDef","loadMdtMethodSpec","loadMdtGenericParamConstraint","L","E","PEImage","buf","metadataSizingCache","DataView","loadHeaders","load","check","getUint8","getUint16","getUint32","is32Bit","optHdr","dd","isDataDirectoryValid","IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR","hasManagedResources","info","metadataTableInfo","rvaToOffset","metadataStreamHeaders","headers","shift","strongNameSignature","metadataTableHeader","fillMetadataTableInfo","fillMetadataTableInfoExtra","checkMdt","baseOffset","rowSize","heap","idSize","codedToken","maxRows","_i","rva","getSectionHeaderByRva","offsetToRva","getSectionHeaderByOffset","nValid","ctid","ctsz","stringsSize","guidSize","blobSize","tbli","createResNavDataMessage","createResPageDataMessage","pageData","createResPEPropsMessage","createResPEErrorMessage","error","M","image_1","generator_1","nav_data_1","onmessage","ev","msg","reader","FileReader","onload","result","pageDataMsg","postMessage","pePropsMsg","navMsg","ex","msg_1","message","JSON","stringify","onerror","readAsArrayBuffer","file","handleReqOpenFile","res","handleReqOpenNav"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,KAAAqB,WACA,WAA2B,OAAArB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IA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AK,KACL,IAAM4jB,EAAMN,EAAEF,wBAAwB,oBACtCc,YAAYN,IAGhBC,EAAOc,kBAAkBf,EAAIgB,MA9CrBC,CAAkBjB,GAClB,MAEJ,oBA8CR,SAA0BA,GACtB,GAAU,MAAN5jB,EAAY,CACN,IAAA4M,EAAAgX,EAAAzjB,OAAEF,EAAA2M,EAAA3M,OAAQgB,EAAA2L,EAAA3L,MAAON,EAAAiM,EAAAjM,QAASN,EAAAuM,EAAAvM,OAC1B6iB,EAAWM,EAAA5K,iBAAiB5Y,EAAIC,EAAQgB,EAAON,GACrDuiB,EAASjgB,IAAI5C,OAASA,EACtB,IAAMykB,EAAMxB,EAAEL,yBAAyBC,GACvCgB,YAAYY,IAnDRC,CAAiBnB","file":"worker.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","export const IMAGE_DOS_SIGNATURE = 0x5A4D; // MZ\r\n\r\nexport const IMAGE_NT_SIGNATURE = 0x00004550; // PE00\r\n\r\nexport const IMAGE_NT_OPTIONAL_HDR32_MAGIC = 0x10b;\r\nexport const IMAGE_NT_OPTIONAL_HDR64_MAGIC = 0x20b;\r\n\r\nexport enum ImageFile {\r\n IMAGE_FILE_RELOCS_STRIPPED = 0x0001,\r\n IMAGE_FILE_EXECUTABLE_IMAGE = 0x0002,\r\n IMAGE_FILE_LINE_NUMS_STRIPPED = 0x0004,\r\n IMAGE_FILE_LOCAL_SYMS_STRIPPED = 0x0008,\r\n IMAGE_FILE_AGGRESIVE_WS_TRIM = 0x0010,\r\n IMAGE_FILE_LARGE_ADDRESS_AWARE = 0x0020,\r\n IMAGE_FILE_BYTES_REVERSED_LO = 0x0080,\r\n IMAGE_FILE_32BIT_MACHINE = 0x0100,\r\n IMAGE_FILE_DEBUG_STRIPPED = 0x0200,\r\n IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 0x0400,\r\n IMAGE_FILE_NET_RUN_FROM_SWAP = 0x0800,\r\n IMAGE_FILE_SYSTEM = 0x1000,\r\n IMAGE_FILE_DLL = 0x2000,\r\n IMAGE_FILE_UP_SYSTEM_ONLY = 0x4000,\r\n IMAGE_FILE_BYTES_REVERSED_HI = 0x8000,\r\n}\r\n\r\nexport enum ImageFileMachine {\r\n IMAGE_FILE_MACHINE_UNKNOWN = 0,\r\n IMAGE_FILE_MACHINE_TARGET_HOST = 0x0001,\r\n IMAGE_FILE_MACHINE_I386 = 0x014c,\r\n IMAGE_FILE_MACHINE_R3000 = 0x0162,\r\n IMAGE_FILE_MACHINE_R4000 = 0x0166,\r\n IMAGE_FILE_MACHINE_R10000 = 0x0168,\r\n IMAGE_FILE_MACHINE_WCEMIPSV2 = 0x0169,\r\n IMAGE_FILE_MACHINE_ALPHA = 0x0184,\r\n IMAGE_FILE_MACHINE_SH3 = 0x01a2,\r\n IMAGE_FILE_MACHINE_SH3DSP = 0x01a3,\r\n IMAGE_FILE_MACHINE_SH3E = 0x01a4,\r\n IMAGE_FILE_MACHINE_SH4 = 0x01a6,\r\n IMAGE_FILE_MACHINE_SH5 = 0x01a8,\r\n IMAGE_FILE_MACHINE_ARM = 0x01c0,\r\n IMAGE_FILE_MACHINE_THUMB = 0x01c2,\r\n IMAGE_FILE_MACHINE_ARMNT = 0x01c4,\r\n IMAGE_FILE_MACHINE_AM33 = 0x01d3,\r\n IMAGE_FILE_MACHINE_POWERPC = 0x01F0,\r\n IMAGE_FILE_MACHINE_POWERPCFP = 0x01f1,\r\n IMAGE_FILE_MACHINE_IA64 = 0x0200,\r\n IMAGE_FILE_MACHINE_MIPS16 = 0x0266,\r\n IMAGE_FILE_MACHINE_ALPHA64 = 0x0284,\r\n IMAGE_FILE_MACHINE_MIPSFPU = 0x0366,\r\n IMAGE_FILE_MACHINE_MIPSFPU16 = 0x0466,\r\n IMAGE_FILE_MACHINE_AXP64 = IMAGE_FILE_MACHINE_ALPHA64,\r\n IMAGE_FILE_MACHINE_TRICORE = 0x0520,\r\n IMAGE_FILE_MACHINE_CEF = 0x0CEF,\r\n IMAGE_FILE_MACHINE_EBC = 0x0EBC,\r\n IMAGE_FILE_MACHINE_AMD64 = 0x8664,\r\n IMAGE_FILE_MACHINE_M32R = 0x9041,\r\n IMAGE_FILE_MACHINE_ARM64 = 0xAA64,\r\n IMAGE_FILE_MACHINE_CEE = 0xC0EE,\r\n}\r\n\r\nexport enum ImageSubsystem {\r\n IMAGE_SUBSYSTEM_UNKNOWN = 0,\r\n IMAGE_SUBSYSTEM_NATIVE = 1,\r\n IMAGE_SUBSYSTEM_WINDOWS_GUI = 2,\r\n IMAGE_SUBSYSTEM_WINDOWS_CUI = 3,\r\n IMAGE_SUBSYSTEM_OS2_CUI = 5,\r\n IMAGE_SUBSYSTEM_POSIX_CUI = 7,\r\n IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8,\r\n IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9,\r\n IMAGE_SUBSYSTEM_EFI_APPLICATION = 10,\r\n IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11,\r\n IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12,\r\n IMAGE_SUBSYSTEM_EFI_ROM = 13,\r\n IMAGE_SUBSYSTEM_XBOX = 14,\r\n IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16,\r\n IMAGE_SUBSYSTEM_XBOX_CODE_CATALOG = 17,\r\n}\r\n\r\nexport enum ImageDllCharacteristics {\r\n IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA = 0x0020,\r\n IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE = 0x0040,\r\n IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY = 0x0080,\r\n IMAGE_DLLCHARACTERISTICS_NX_COMPAT = 0x0100,\r\n IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = 0x0200,\r\n IMAGE_DLLCHARACTERISTICS_NO_SEH = 0x0400,\r\n IMAGE_DLLCHARACTERISTICS_NO_BIND = 0x0800,\r\n IMAGE_DLLCHARACTERISTICS_APPCONTAINER = 0x1000,\r\n IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 0x2000,\r\n IMAGE_DLLCHARACTERISTICS_GUARD_CF = 0x4000,\r\n IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 0x8000,\r\n}\r\n\r\nexport enum ImageDirectoryEntry {\r\n IMAGE_DIRECTORY_ENTRY_EXPORT = 0,\r\n IMAGE_DIRECTORY_ENTRY_IMPORT = 1,\r\n IMAGE_DIRECTORY_ENTRY_RESOURCE = 2,\r\n IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3,\r\n IMAGE_DIRECTORY_ENTRY_SECURITY = 4,\r\n IMAGE_DIRECTORY_ENTRY_BASERELOC = 5,\r\n IMAGE_DIRECTORY_ENTRY_DEBUG = 6,\r\n IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7,\r\n IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8,\r\n IMAGE_DIRECTORY_ENTRY_TLS = 9,\r\n IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10,\r\n IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11,\r\n IMAGE_DIRECTORY_ENTRY_IAT = 12,\r\n IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13,\r\n IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14,\r\n}\r\n\r\nexport const IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16;\r\n\r\nexport enum ImageSection {\r\n IMAGE_SCN_TYPE_NO_PAD = 0x00000008,\r\n\r\n IMAGE_SCN_CNT_CODE = 0x00000020,\r\n IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040,\r\n IMAGE_SCN_CNT_UNINITIALIZED_DATA = 0x00000080,\r\n\r\n IMAGE_SCN_LNK_OTHER = 0x00000100,\r\n IMAGE_SCN_LNK_INFO = 0x00000200,\r\n IMAGE_SCN_LNK_REMOVE = 0x00000800,\r\n IMAGE_SCN_LNK_COMDAT = 0x00001000,\r\n\r\n IMAGE_SCN_NO_DEFER_SPEC_EXC = 0x00004000,\r\n IMAGE_SCN_GPREL = 0x00008000,\r\n\r\n IMAGE_SCN_MEM_PURGEABLE = 0x00020000,\r\n IMAGE_SCN_MEM_16BIT = 0x00020000,\r\n IMAGE_SCN_MEM_LOCKED = 0x00040000,\r\n IMAGE_SCN_MEM_PRELOAD = 0x00080000,\r\n\r\n IMAGE_SCN_ALIGN_1BYTES = 0x00100000,\r\n IMAGE_SCN_ALIGN_2BYTES = 0x00200000,\r\n IMAGE_SCN_ALIGN_4BYTES = 0x00300000,\r\n IMAGE_SCN_ALIGN_8BYTES = 0x00400000,\r\n IMAGE_SCN_ALIGN_16BYTES = 0x00500000,\r\n IMAGE_SCN_ALIGN_32BYTES = 0x00600000,\r\n IMAGE_SCN_ALIGN_64BYTES = 0x00700000,\r\n IMAGE_SCN_ALIGN_128BYTES = 0x00800000,\r\n IMAGE_SCN_ALIGN_256BYTES = 0x00900000,\r\n IMAGE_SCN_ALIGN_512BYTES = 0x00A00000,\r\n IMAGE_SCN_ALIGN_1024BYTES = 0x00B00000,\r\n IMAGE_SCN_ALIGN_2048BYTES = 0x00C00000,\r\n IMAGE_SCN_ALIGN_4096BYTES = 0x00D00000,\r\n IMAGE_SCN_ALIGN_8192BYTES = 0x00E00000,\r\n\r\n IMAGE_SCN_LNK_NRELOC_OVFL = 0x01000000,\r\n IMAGE_SCN_MEM_DISCARDABLE = 0x02000000,\r\n IMAGE_SCN_MEM_NOT_CACHED = 0x04000000,\r\n IMAGE_SCN_MEM_NOT_PAGED = 0x08000000,\r\n IMAGE_SCN_MEM_SHARED = 0x10000000,\r\n IMAGE_SCN_MEM_EXECUTE = 0x20000000,\r\n IMAGE_SCN_MEM_READ = 0x40000000,\r\n IMAGE_SCN_MEM_WRITE = 0x80000000,\r\n\r\n IMAGE_SCN_SCALE_INDEX = 0x00000001,\r\n}\r\n\r\n//\r\n// Metadata structures.\r\n//\r\n\r\nexport enum ComImageFlags {\r\n COMIMAGE_FLAGS_ILONLY = 0x00000001,\r\n COMIMAGE_FLAGS_32BITREQUIRED = 0x00000002,\r\n COMIMAGE_FLAGS_IL_LIBRARY = 0x00000004,\r\n COMIMAGE_FLAGS_STRONGNAMESIGNED = 0x00000008,\r\n COMIMAGE_FLAGS_NATIVE_ENTRYPOINT = 0x00000010,\r\n COMIMAGE_FLAGS_TRACKDEBUGDATA = 0x00010000,\r\n COMIMAGE_FLAGS_32BITPREFERRED = 0x00020000,\r\n}\r\n\r\nexport const MetadataSignature = 0x424A5342;\r\n\r\nexport const enum MetadataStreamName {\r\n Table = \"#~\",\r\n Strings = \"#Strings\",\r\n US = \"#US\",\r\n GUID = \"#GUID\",\r\n Blob = \"#Blob\",\r\n}\r\n\r\nexport const enum MetadataHeapSizeID {\r\n String = 0,\r\n GUID = 1,\r\n Blob = 2,\r\n}\r\n\r\nexport enum MetadataTableIndex {\r\n Module = 0x00,\r\n TypeRef = 0x01,\r\n TypeDef = 0x02,\r\n FieldPtr = 0x03,\r\n Field = 0x04,\r\n MethodPtr = 0x05,\r\n MethodDef = 0x06,\r\n ParamPtr = 0x07,\r\n Param = 0x08,\r\n InterfaceImpl = 0x09,\r\n MemberRef = 0x0A,\r\n Constant = 0x0B,\r\n CustomAttribute = 0x0C,\r\n FieldMarshal = 0x0D,\r\n DeclSecurity = 0x0E,\r\n ClassLayout = 0x0F,\r\n FieldLayout = 0x10,\r\n StandAloneSig = 0x11,\r\n EventMap = 0x12,\r\n EventPtr = 0x13,\r\n Event = 0x14,\r\n PropertyMap = 0x15,\r\n PropertyPtr = 0x16,\r\n Property = 0x17,\r\n MethodSemantics = 0x18,\r\n MethodImpl = 0x19,\r\n ModuleRef = 0x1A,\r\n TypeSpec = 0x1B,\r\n ImplMap = 0x1C,\r\n FieldRVA = 0x1D,\r\n ENCLog = 0x1E,\r\n ENCMap = 0x1F,\r\n Assembly = 0x20,\r\n AssemblyProcessor = 0x21,\r\n AssemblyOS = 0x22,\r\n AssemblyRef = 0x23,\r\n AssemblyRefProcessor = 0x24,\r\n AssemblyRefOS = 0x25,\r\n File = 0x26,\r\n ExportedType = 0x27,\r\n ManifestResource = 0x28,\r\n NestedClass = 0x29,\r\n GenericParam = 0x2A,\r\n MethodSpec = 0x2B,\r\n GenericParamConstraint = 0x2C,\r\n\r\n String = 0x70,\r\n}\r\n\r\nexport const NumberOfMdTables = 45;\r\n\r\nexport enum MetadataCodedTokenIndex {\r\n TypeDefOrRef = 0,\r\n HasConstant = 1,\r\n HasCustomAttribute = 2,\r\n HasFieldMarshall = 3,\r\n HasDeclSecurity = 4,\r\n MemberRefParent = 5,\r\n HasSemantics = 6,\r\n MethodDefOrRef = 7,\r\n MemberForwarded = 8,\r\n Implementation = 9,\r\n CustomAttributeType = 10,\r\n ResolutionScope = 11,\r\n TypeOrMethodDef = 12,\r\n}\r\n\r\nexport interface MetadataCodedTokenInfo {\r\n tagSize: number;\r\n tables: MetadataTableIndex[];\r\n}\r\n\r\nexport const ctc: MetadataCodedTokenInfo[] = [{\r\n tagSize: 2, tables: [ // TypeDefOrRef\r\n MetadataTableIndex.TypeDef,\r\n MetadataTableIndex.TypeRef,\r\n MetadataTableIndex.TypeSpec,\r\n ]\r\n}, {\r\n tagSize: 2, tables: [ // HasConstant\r\n MetadataTableIndex.Field,\r\n MetadataTableIndex.Param,\r\n MetadataTableIndex.Property,\r\n ]\r\n}, {\r\n tagSize: 5, tables: [ // HasCustomAttribute\r\n MetadataTableIndex.MethodDef,\r\n MetadataTableIndex.Field,\r\n MetadataTableIndex.TypeRef,\r\n MetadataTableIndex.TypeDef,\r\n MetadataTableIndex.Param,\r\n MetadataTableIndex.InterfaceImpl,\r\n MetadataTableIndex.MemberRef,\r\n MetadataTableIndex.Module,\r\n MetadataTableIndex.DeclSecurity,\r\n MetadataTableIndex.Property,\r\n MetadataTableIndex.Event,\r\n MetadataTableIndex.StandAloneSig,\r\n MetadataTableIndex.ModuleRef,\r\n MetadataTableIndex.TypeSpec,\r\n MetadataTableIndex.Assembly,\r\n MetadataTableIndex.AssemblyRef,\r\n MetadataTableIndex.File,\r\n MetadataTableIndex.ExportedType,\r\n MetadataTableIndex.ManifestResource,\r\n MetadataTableIndex.GenericParam,\r\n MetadataTableIndex.GenericParamConstraint,\r\n MetadataTableIndex.MethodSpec,\r\n ]\r\n}, {\r\n tagSize: 1, tables: [ // HasFieldMarshall\r\n MetadataTableIndex.Field,\r\n MetadataTableIndex.Param,\r\n ]\r\n}, {\r\n tagSize: 2, tables: [ // HasDeclSecurity\r\n MetadataTableIndex.TypeDef,\r\n MetadataTableIndex.MethodDef,\r\n MetadataTableIndex.Assembly,\r\n ]\r\n}, {\r\n tagSize: 3, tables: [ // MemberRefParent\r\n MetadataTableIndex.TypeDef,\r\n MetadataTableIndex.TypeRef,\r\n MetadataTableIndex.ModuleRef,\r\n MetadataTableIndex.MethodDef,\r\n MetadataTableIndex.TypeSpec,\r\n ]\r\n}, {\r\n tagSize: 1, tables: [ // HasSemantics\r\n MetadataTableIndex.Event,\r\n MetadataTableIndex.Property,\r\n ]\r\n}, {\r\n tagSize: 1, tables: [ // MethodDefOrRef\r\n MetadataTableIndex.MethodDef,\r\n MetadataTableIndex.MemberRef,\r\n ]\r\n}, {\r\n tagSize: 1, tables: [ // MemberForwarded\r\n MetadataTableIndex.Field,\r\n MetadataTableIndex.MethodDef,\r\n ]\r\n}, {\r\n tagSize: 2, tables: [ // Implementation\r\n MetadataTableIndex.File,\r\n MetadataTableIndex.AssemblyRef,\r\n MetadataTableIndex.ExportedType,\r\n ]\r\n}, {\r\n tagSize: 3, tables: [ // CustomAttributeType\r\n MetadataTableIndex.TypeRef,\r\n MetadataTableIndex.TypeDef,\r\n MetadataTableIndex.MethodDef,\r\n MetadataTableIndex.MemberRef,\r\n MetadataTableIndex.String,\r\n ]\r\n}, {\r\n tagSize: 2, tables: [ // ResolutionScope\r\n MetadataTableIndex.Module,\r\n MetadataTableIndex.ModuleRef,\r\n MetadataTableIndex.AssemblyRef,\r\n MetadataTableIndex.TypeRef,\r\n ]\r\n}, {\r\n tagSize: 1, tables: [ // TypeOrMethodDef\r\n MetadataTableIndex.TypeDef,\r\n MetadataTableIndex.MethodDef,\r\n ]\r\n}];\r\n\r\nexport enum AssemblyHashAlgorithm {\r\n None = 0x0000,\r\n MD5 = 0x8003, // Reserved\r\n SHA1 = 0x8004,\r\n}\r\n\r\nexport enum CorAssemblyFlags {\r\n PublicKey = 0x0001,\r\n\r\n pa__Mask = 0x0070,\r\n pa_ProcessorArchitectureNone = 0x0000,\r\n pa_ProcessorArchitectureMsil = 0x0010,\r\n pa_ProcessorArchitectureX86 = 0x0020,\r\n pa_ProcessorArchitectureIa64 = 0x0030,\r\n pa_ProcessorArchitectureAmd64 = 0x0040,\r\n\r\n ProcessorArchitectureSpecified = 0x0080,\r\n\r\n EnableJitcompileTracking = 0x8000,\r\n DisableJitcompileOptimizer = 0x4000,\r\n\r\n Retargetable = 0x0100,\r\n}\r\n\r\nexport enum CorEventAttr {\r\n SpecialName = 0x0200,\r\n RtSpecialName = 0x0400,\r\n}\r\n\r\nexport enum CorFieldAttr {\r\n fa__Mask = 0x0007,\r\n fa_PrivateScope = 0x0000,\r\n fa_Private = 0x0001,\r\n fa_FamAndAssem = 0x0002,\r\n fa_Assembly = 0x0003,\r\n fa_Family = 0x0004,\r\n fa_FamOrAssem = 0x0005,\r\n fa_Public = 0x0006,\r\n\r\n Static = 0x0010,\r\n InitOnly = 0x0020,\r\n Literal = 0x0040,\r\n NotSerialized = 0x0080,\r\n\r\n SpecialName = 0x0200,\r\n\r\n PinvokeImpl = 0x2000,\r\n\r\n RtSpecialName = 0x0400,\r\n HasFieldMarshal = 0x1000,\r\n HasDefault = 0x8000,\r\n HasFieldRva = 0x0100,\r\n}\r\n\r\nexport enum CorFileFlags {\r\n ContainsMetaData = 0x0000,\r\n ContainsNoMetaData = 0x0001,\r\n}\r\n\r\nexport enum CorGenericParamAttr {\r\n v__Mask = 0x0003,\r\n v_NonVariant = 0x0000,\r\n v_Covariant = 0x0001,\r\n v_Contravariant = 0x0002,\r\n\r\n NoSpecialConstraint = 0x0000,\r\n ReferenceTypeConstraint = 0x0004,\r\n NotNullableValueTypeConstraint = 0x0008,\r\n DefaultConstructorConstraint = 0x0010,\r\n}\r\n\r\nexport enum CorPinvokeMap {\r\n NoMangle = 0x0001,\r\n cs__Mask = 0x0006,\r\n cs_CharSetNotSpec = 0x0000,\r\n cs_CharSetAnsi = 0x0002,\r\n cs_CharSetUnicode = 0x0004,\r\n cs_CharSetAuto = 0x0006,\r\n\r\n bf__Mask = 0x0030,\r\n bf_BestFitUseAssem = 0x0000,\r\n bf_BestFitEnabled = 0x0010,\r\n bf_BestFitDisabled = 0x0020,\r\n\r\n touc__Mask = 0x3000,\r\n touc_ThrowOnUnmappableCharUseAssem = 0x0000,\r\n touc_ThrowOnUnmappableCharEnabled = 0x1000,\r\n touc_ThrowOnUnmappableCharDisabled = 0x2000,\r\n\r\n SupportsLastError = 0x0040,\r\n\r\n cc__Mask = 0x0700,\r\n cc_CallConvWinapi = 0x0100,\r\n cc_CallConvCdecl = 0x0200,\r\n cc_CallConvStdcall = 0x0300,\r\n cc_CallConvThiscall = 0x0400,\r\n cc_CallConvFastcall = 0x0500,\r\n}\r\n\r\nexport enum CorManifestResourceFlags {\r\n v__Mask = 0x0007,\r\n v_Public = 0x0001,\r\n v_Private = 0x0002,\r\n}\r\n\r\nexport enum CorMethodAttr {\r\n ma__Mask = 0x0007,\r\n ma_PrivateScope = 0x0000,\r\n ma_Private = 0x0001,\r\n ma_FamAndAssem = 0x0002,\r\n ma_Assem = 0x0003,\r\n ma_Family = 0x0004,\r\n ma_FamOrAssem = 0x0005,\r\n ma_Public = 0x0006,\r\n\r\n Static = 0x0010,\r\n Final = 0x0020,\r\n Virtual = 0x0040,\r\n HideBySig = 0x0080,\r\n\r\n vl__Mask = 0x0100,\r\n vl_ReuseSlot = 0x0000,\r\n vl_NewSlot = 0x0100,\r\n\r\n CheckAccessOnOverride = 0x0200,\r\n Abstract = 0x0400,\r\n SpecialName = 0x0800,\r\n\r\n PInvokeImpl = 0x2000,\r\n UnmanagedExport = 0x0008,\r\n\r\n RtSpecialName = 0x1000,\r\n HasSecurity = 0x4000,\r\n RequireSecObject = 0x8000,\r\n}\r\n\r\nexport enum CorMethodImpl {\r\n ct__Mask = 0x0003,\r\n ct_IL = 0x0000,\r\n ct_Native = 0x0001,\r\n ct_OptIL = 0x0002,\r\n ct_Runtime = 0x0003,\r\n\r\n m__Mask = 0x0004,\r\n m_Unmanaged = 0x0004,\r\n m_Managed = 0x0000,\r\n\r\n ForwardRef = 0x0010,\r\n PreserveSig = 0x0080,\r\n\r\n InternalCall = 0x1000,\r\n\r\n Synchronized = 0x0020,\r\n NoInlining = 0x0008,\r\n}\r\n\r\nexport enum CorMethodSemanticsAttr {\r\n Setter = 0x0001,\r\n Getter = 0x0002,\r\n Other = 0x0004,\r\n AddOn = 0x0008,\r\n RemoveOn = 0x0010,\r\n Fire = 0x0020,\r\n}\r\n\r\nexport enum CorParamAttr {\r\n In = 0x0001,\r\n Out = 0x0002,\r\n Optional = 0x0010,\r\n\r\n HasDefault = 0x1000,\r\n HasFieldMarshal = 0x2000,\r\n\r\n Unused = 0xcfe0,\r\n}\r\n\r\nexport enum CorPropertyAttr {\r\n SpecialName = 0x0200,\r\n\r\n RtSpecialName = 0x0400,\r\n HasDefault = 0x1000,\r\n\r\n Unused = 0xe9ff,\r\n}\r\n\r\nexport enum CorTypeAttr {\r\n v__Mask = 0x00000007,\r\n v_NotPublic = 0x00000000,\r\n v_Public = 0x00000001,\r\n v_NestedPublic = 0x00000002,\r\n v_NestedPrivate = 0x00000003,\r\n v_NestedFamily = 0x00000004,\r\n v_NestedAssembly = 0x00000005,\r\n v_NestedFamAndAssem = 0x00000006,\r\n v_NestedFamOrAssem = 0x00000007,\r\n\r\n l__Mask = 0x00000018,\r\n l_AutoLayout = 0x00000000,\r\n l_SequentialLayout = 0x00000008,\r\n l_ExplicitLayout = 0x00000010,\r\n\r\n cs__Mask = 0x00000060,\r\n cs_Class = 0x00000000,\r\n cs_Interface = 0x00000020,\r\n\r\n Abstract = 0x00000080,\r\n Sealed = 0x00000100,\r\n SpecialName = 0x00000400,\r\n\r\n Import = 0x00001000,\r\n Serializable = 0x00002000,\r\n WindowsRuntime = 0x00004000,\r\n\r\n sf__Mask = 0x00030000,\r\n sf_AnsiClass = 0x00000000,\r\n sf_UnicodeClass = 0x00010000,\r\n sf_AutoClass = 0x00020000,\r\n sf_CustomFormatClass = 0x00030000,\r\n CustomFormatMask = 0x00C00000,\r\n\r\n BeforeFieldInit = 0x00100000,\r\n Forwarder = 0x00200000,\r\n\r\n RtSpecialName = 0x00000800,\r\n HasSecurity = 0x00040000,\r\n}\r\n\r\nexport enum CorDeclSecurity {\r\n ActionNil = 0x0000,\r\n Request = 0x0001,\r\n Demand = 0x0002,\r\n Assert = 0x0003,\r\n Deny = 0x0004,\r\n PermitOnly = 0x0005,\r\n LinktimeCheck = 0x0006,\r\n InheritanceCheck = 0x0007,\r\n RequestMinimum = 0x0008,\r\n RequestOptional = 0x0009,\r\n RequestRefuse = 0x000a,\r\n PrejitGrant = 0x000b,\r\n PrejitDenied = 0x000c,\r\n NonCasDemand = 0x000d,\r\n NonCasLinkDemand = 0x000e,\r\n NonCasInheritance = 0x000f,\r\n}\r\n\r\nexport enum CorElementType {\r\n End = 0x00,\r\n Void = 0x01,\r\n Boolean = 0x02,\r\n Char = 0x03,\r\n I1 = 0x04,\r\n U1 = 0x05,\r\n I2 = 0x06,\r\n U2 = 0x07,\r\n I4 = 0x08,\r\n U4 = 0x09,\r\n I8 = 0x0A,\r\n U8 = 0x0B,\r\n R4 = 0x0C,\r\n R8 = 0x0D,\r\n String = 0x0E,\r\n\r\n Ptr = 0x0F,\r\n ByRef = 0x10,\r\n\r\n ValueType = 0x11,\r\n Class = 0x12,\r\n Var = 0x13,\r\n Array = 0x14,\r\n GenericInst = 0x15,\r\n TypedByRef = 0x16,\r\n\r\n I = 0x18,\r\n U = 0x19,\r\n FnPtr = 0x1B,\r\n Object = 0x1C,\r\n SzArray = 0x1D,\r\n\r\n MVar = 0x1E,\r\n\r\n CModReqd = 0x1F,\r\n CModOpt = 0x20,\r\n Internal = 0x21,\r\n\r\n Modifier = 0x40,\r\n Sentinel = 0x01 | Modifier,\r\n Pinned = 0x05 | Modifier,\r\n R4HFA = 0x06 | Modifier,\r\n R8HFA = 0x07 | Modifier,\r\n}\r\n","import * as S from \"../pe/structures\";\r\n\r\nexport function formatU1RawHex(d: number): string {\r\n return padZeroLeft(d.toString(16).toUpperCase(), 2);\r\n}\r\n\r\nexport function formatU2RawHex(d: number): string {\r\n return padZeroLeft(d.toString(16).toUpperCase(), 4);\r\n}\r\n\r\nexport function formatU4RawHex(d: number): string {\r\n return padZeroLeft(d.toString(16).toUpperCase(), 8);\r\n}\r\n\r\nexport function formatU1Hex(d: number): string {\r\n return `${formatU1RawHex(d)}h`;\r\n}\r\n\r\nexport function formatU2Hex(d: number): string {\r\n return `${formatU2RawHex(d)}h`;\r\n}\r\n\r\nexport function formatU4Hex(d: number): string {\r\n return `${formatU4RawHex(d)}h`;\r\n}\r\n\r\nexport function formatHexDec(d: number): string {\r\n return `${d.toString(16).toUpperCase()}h (${d.toLocaleString()})`;\r\n}\r\n\r\nexport function formatDec(v: number): string {\r\n return v.toLocaleString();\r\n}\r\n\r\nexport function formatBytes(bytes: Uint8Array, lineWidth: number = 16): string[] {\r\n let lines: string[] = [];\r\n for (let start = 0; start < bytes.length; start += lineWidth) {\r\n const line = Array.from(bytes.subarray(start, start + lineWidth))\r\n .map(b => formatU1RawHex(b)).join(\"-\");\r\n lines.push(line);\r\n }\r\n return lines;\r\n}\r\n\r\nexport function formatStructTitle(s: S.FileData, title: string): string {\r\n return `${title} [${formatU4Hex(s._offset)} - ${formatU4Hex(s._offset + s._size)} : ${formatHexDec(s._size)}]`;\r\n}\r\n\r\nexport function formatU1Field(name: string, f: S.U1Field, showDec?: boolean): W.StructItem {\r\n return formatUIntField(name, f, 1, showDec);\r\n}\r\n\r\nexport function formatU2Field(name: string, f: S.U2Field, showDec?: boolean): W.StructItem {\r\n return formatUIntField(name, f, 2, showDec);\r\n}\r\n\r\nexport function formatU4Field(name: string, f: S.U4Field, showDec?: boolean): W.StructItem {\r\n return formatUIntField(name, f, 4, showDec);\r\n}\r\n\r\nexport function formatU8Field(name: string, f: S.U8Field, showDec?: boolean): W.StructItem {\r\n let value = `${formatU4RawHex(f.high)} ${formatU4Hex(f.low)}`;\r\n\r\n if (showDec && f.high < 0x1FFFFF) {\r\n const long = f.high * 0x100000000 + f.low;\r\n value += ` (${formatDec(long)})`;\r\n }\r\n\r\n return {\r\n offset: formatU4Hex(f._offset),\r\n size: formatHexDec(f._size),\r\n rawData: formatBytes(f.data),\r\n name,\r\n value,\r\n };\r\n}\r\n\r\nexport function formatCompressedUIntField(name: string, f: S.CompressedUIntField): W.StructItem {\r\n return formatUIntField(name, f, f._size, true);\r\n}\r\n\r\nexport function formatBytesField(name: string, f: S.Field): W.StructItem {\r\n return {\r\n offset: formatU4Hex(f._offset),\r\n size: formatHexDec(f._size),\r\n rawData: formatBytes(f.data),\r\n name,\r\n value: \"\",\r\n };\r\n}\r\n\r\nexport function formatStringField(name: string, f: S.StringField): W.StructItem {\r\n return {\r\n offset: formatU4Hex(f._offset),\r\n size: formatHexDec(f._size),\r\n rawData: formatBytes(f.data),\r\n name,\r\n value: `\"${f.value}\"`,\r\n };\r\n}\r\n\r\nexport function formatGuidField(name: string, f: S.Field): W.StructItem {\r\n const b = (n: number) => formatU1RawHex(f.data[n]);\r\n const value = \"{\" + b(3) + b(2) + b(1) + b(0) + \"-\"\r\n + b(5) + b(4) + \"-\" + b(7) + b(6) + \"-\" + b(8) + b(9) + \"-\"\r\n + b(10) + b(11) + b(12) + b(13) + b(14) + b(15) + \"}\";\r\n\r\n return {\r\n offset: formatU4Hex(f._offset),\r\n size: formatHexDec(f._size),\r\n rawData: formatBytes(f.data),\r\n name,\r\n value,\r\n };\r\n}\r\n\r\nfunction padZeroLeft(str: string, len: number): string {\r\n if (str.length < len) {\r\n return \"0\".repeat(len - str.length) + str;\r\n } else {\r\n return str;\r\n }\r\n}\r\n\r\nfunction formatUIntField(name: string, f: S.UIntField, sz: number, showDec?: boolean): W.StructItem {\r\n let hex: string;\r\n switch (sz) {\r\n case 1: hex = formatU1Hex(f.value); break;\r\n case 2: hex = formatU2Hex(f.value); break;\r\n case 4: hex = formatU4Hex(f.value); break;\r\n default: hex = f.value.toString(16).toUpperCase(); break;\r\n }\r\n\r\n return {\r\n offset: formatU4Hex(f._offset),\r\n size: formatHexDec(f._size),\r\n rawData: formatBytes(f.data),\r\n name,\r\n value: showDec ? `${hex} (${formatDec(f.value)})` : hex,\r\n }\r\n}\r\n","export function calculatePadding(dataSize: number, align: number = 4): number {\n const r = dataSize % align;\n if (r == 0) {\n return 0;\n } else {\n return align - r;\n }\n}\n\nexport function count1(n: number) {\n let c = 0;\n for (let i = 0, mask = 1; i < 32; i++ , mask <<= 1) {\n if (n & mask)\n c++;\n }\n return c;\n}\n\nexport function isSetLong(high: number, low: number, bit: number): boolean {\n return bit >= 0 && bit < 64 &&\n (bit < 32 && ((low & (1 << bit)) != 0)) ||\n (bit >= 32 && (high & (1 << (bit - 32))) != 0);\n}\n\nexport function decompressUint(data: Uint8Array): number {\n if ((data[0] & 0x80) == 0 && data.buffer.byteLength == 1)\n return data[0];\n else if ((data[0] & 0xC0) == 0x80 && data.buffer.byteLength == 2)\n return (data[0] & 0x3F) << 8 | data[1];\n else if ((data[0] & 0xE0) == 0xC0 && data.buffer.byteLength == 4)\n return (data[0] & 0x1F) << 24 | data[1] << 16 | data[2] << 8 | data[3];\n else\n throw new RangeError();\n}\n\nexport function decompressInt(data: Uint8Array): number {\n const u = decompressUint(data);\n if ((u & 0x00000001) == 0)\n return (u >> 1);\n\n const fb = data[0];\n if ((fb & 0x80) == 0)\n return (u >> 1) | 0xFFFFFFC0;\n else if ((fb & 0xC0) == 0x80)\n return (u >> 1) | 0xFFFFE000;\n else if ((fb & 0xE0) == 0xC0)\n return (u >> 1) | 0xF0000000;\n else\n throw new RangeError();\n}\n\nexport function getCompressedIntSize(firstByte: number): number {\n if ((firstByte & 0xFFFFFF00) != 0)\n throw new RangeError();\n else if ((firstByte & 0x80) == 0)\n return 1;\n else if ((firstByte & 0xC0) == 0x80)\n return 2;\n else if ((firstByte & 0xE0) == 0xC0)\n return 4;\n else\n throw new RangeError();\n}","import { PEImage } from \"../pe/image\";\r\nimport * as F from \"../pe/image-flags\";\r\n\r\nexport function generateNavList(pe: PEImage): W.NavData[] {\r\n let navList: W.NavData[] = [generateHeadersNavData(pe)];\r\n\r\n const navMD = generateMDHeadersNavData(pe);\r\n if (navMD) navList.push(navMD);\r\n\r\n return navList;\r\n}\r\n\r\nfunction generateHeadersNavData(pe: PEImage): W.NavData {\r\n const pageID = W.PageID.HEADERS;\r\n\r\n return {\r\n target: { pageID, title: W.KnownTitle.HEADERS },\r\n children: [{\r\n target: { pageID, title: W.KnownTitle.DOS_HEADER, elemID: W.KnownElemID.DOS_HEADER }\r\n }, {\r\n target: { pageID, title: W.KnownTitle.PE_SIGNATURE, elemID: W.KnownElemID.PE_SIGNATURE }\r\n }, {\r\n target: { pageID, title: W.KnownTitle.FILE_HEADER, elemID: W.KnownElemID.FILE_HEADER }\r\n }, {\r\n target: { pageID, title: W.KnownTitle.OPTIONAL_HEADER, elemID: W.KnownElemID.OPTIONAL_HEADER }\r\n }, {\r\n target: { pageID, title: W.KnownTitle.DATA_DIRECTORIES, elemID: W.KnownElemID.DATA_DIRECTORIES }\r\n }, {\r\n target: { pageID, title: W.KnownTitle.SECTION_HEADERS, elemID: W.KnownElemID.SECTION_HEADERS }\r\n }]\r\n };\r\n}\r\n\r\nfunction generateMDHeadersNavData(pe: PEImage): W.NavData | undefined {\r\n const pageID = W.PageID.MD_HEADERS;\r\n\r\n if (!pe.isManaged()) return undefined;\r\n\r\n let children: W.NavData[] = [{\r\n target: { pageID, title: W.KnownTitle.CLI_HEADER, elemID: W.KnownElemID.CLI_HEADER }\r\n }];\r\n\r\n if (pe.hasMetadata()) {\r\n children.push({\r\n target: { pageID, title: W.KnownTitle.MD_ROOT, elemID: W.KnownElemID.MD_ROOT }\r\n });\r\n children.push({\r\n target: { pageID, title: W.KnownTitle.MDS_HEADERS, elemID: W.KnownElemID.MDS_HEADERS }\r\n });\r\n }\r\n\r\n if (pe.hasStrongNameSignature()) {\r\n children.push({\r\n target: { pageID, title: W.KnownTitle.SN_SIG, elemID: W.KnownElemID.SN_SIG }\r\n });\r\n }\r\n\r\n if (pe.getMetadataStreamHeader(F.MetadataStreamName.Strings)) {\r\n children.push({\r\n target: { pageID: W.PageID.MDS_STRINGS, title: W.KnownTitle.MDS_STRINGS, pageNum: 0 }\r\n });\r\n }\r\n\r\n if (pe.getMetadataStreamHeader(F.MetadataStreamName.US)) {\r\n children.push({\r\n target: { pageID: W.PageID.MDS_US, title: W.KnownTitle.MDS_US, pageNum: 0 }\r\n });\r\n }\r\n\r\n if (pe.getMetadataStreamHeader(F.MetadataStreamName.GUID)) {\r\n children.push({\r\n target: { pageID: W.PageID.MDS_GUID, title: W.KnownTitle.MDS_GUID, pageNum: 0 }\r\n });\r\n }\r\n\r\n if (pe.getMetadataStreamHeader(F.MetadataStreamName.Blob)) {\r\n children.push({\r\n target: { pageID: W.PageID.MDS_BLOB, title: W.KnownTitle.MDS_BLOB, pageNum: 0 }\r\n });\r\n }\r\n\r\n if (pe.getMetadataStreamHeader(F.MetadataStreamName.Table)) {\r\n children.push(generateMDTablesNavData(pe));\r\n }\r\n\r\n return {\r\n target: { pageID, title: W.KnownTitle.MD_HEADERS },\r\n children\r\n };\r\n}\r\n\r\nfunction generateMDTablesNavData(pe: PEImage): W.NavData {\r\n const pageID = W.PageID.MDS_TABLE;\r\n const h = pe.getMetadataTableHeader();\r\n\r\n let children: W.NavData[] = [];\r\n const ti = F.MetadataTableIndex;\r\n const buildMdtNav = (t: F.MetadataTableIndex) => ({\r\n target: {\r\n pageID: W.PageID.MDT_TBL,\r\n title: `${ti[t]} (${pe.getMetadataTableRows(t).toLocaleString()})`,\r\n subID: ti[t],\r\n pageNum: 0\r\n }\r\n } as W.NavData);\r\n\r\n for (let tid = 0; tid < F.NumberOfMdTables; tid++) {\r\n if (pe.isMetadataTableValid(tid)) {\r\n children.push(buildMdtNav(tid));\r\n }\r\n }\r\n\r\n return {\r\n target: { pageID, title: W.KnownTitle.MDS_TABLE },\r\n children\r\n };\r\n}","import { PEImage } from \"../pe/image\";\r\nimport * as F from \"../pe/image-flags\";\r\nimport * as U from \"../pe/utils\";\r\nimport * as FM from \"./formatter\";\r\nimport * as G from \"./generator\";\r\n\r\nexport function generateMdsStringsPageData(pe: PEImage,\r\n cache: G.GeneratorCache, cfg: G.GeneratorConfig,\r\n pgNum: number): W.PagedItemListPageData {\r\n\r\n checkAndBuildCacheForMdsStrings(pe, cache, cfg);\r\n const items = cache.mdsStrings && cache.mdsStrings.pages[pgNum];\r\n\r\n const titleOf = (i: number) => `#String [${FM.formatHexDec(i)}]`;\r\n\r\n return {\r\n nav: {\r\n pageID: W.PageID.MDS_STRINGS,\r\n title: W.KnownTitle.MDS_STRINGS,\r\n },\r\n items: {\r\n title: W.KnownTitle.MDS_STRINGS,\r\n groups: [{\r\n title: \"\",\r\n items: items && items.map(index =>\r\n FM.formatStringField(titleOf(index), pe.getMdsStringsItem(index)!)\r\n )\r\n }]\r\n },\r\n paging: {\r\n currentPageNumber: pgNum,\r\n pageNavList: cache.mdsStrings!.pages.map((v, i) => ({\r\n title: `Page [${i + 1}] (${titleOf(v[0])} - ${titleOf(v[v.length - 1])}})`,\r\n pageID: W.PageID.MDS_STRINGS,\r\n pageNum: i\r\n }))\r\n }\r\n };\r\n}\r\n\r\nexport function generateMdsUSPageData(pe: PEImage,\r\n cache: G.GeneratorCache, cfg: G.GeneratorConfig,\r\n pgNum: number): W.PagedItemListPageData {\r\n\r\n checkAndBuildCacheForMdsUS(pe, cache, cfg);\r\n const items = cache.mdsUS && cache.mdsUS.pages[pgNum];\r\n\r\n const titleOf = (i: number) => `#US [${FM.formatHexDec(i)}]`;\r\n\r\n return {\r\n nav: {\r\n pageID: W.PageID.MDS_US,\r\n title: W.KnownTitle.MDS_US,\r\n },\r\n items: {\r\n title: W.KnownTitle.MDS_US,\r\n groups: items && items.map(index => {\r\n const item = pe.getMdsUSItem(index)!;\r\n return {\r\n title: titleOf(index),\r\n items: [\r\n FM.formatCompressedUIntField(\"Size\", item.Size),\r\n FM.formatStringField(\"Value\", item.Value),\r\n FM.formatBytesField(\"Suffix\", item.Suffix),\r\n ]\r\n }\r\n })\r\n },\r\n paging: {\r\n currentPageNumber: pgNum,\r\n pageNavList: cache.mdsUS!.pages.map((v, i) => ({\r\n title: `Page [${i + 1}] (${titleOf(v[0])} - ${titleOf(v[v.length - 1])}})`,\r\n pageID: W.PageID.MDS_US,\r\n pageNum: i\r\n }))\r\n }\r\n };\r\n}\r\n\r\nexport function generateMdsBlobPageData(pe: PEImage,\r\n cache: G.GeneratorCache, cfg: G.GeneratorConfig,\r\n pgNum: number): W.PagedItemListPageData {\r\n\r\n checkAndBuildCacheForMdsBlob(pe, cache, cfg);\r\n const items = cache.mdsBlob && cache.mdsBlob.pages[pgNum];\r\n\r\n const titleOf = (i: number) => `#Blob [${FM.formatHexDec(i)}]`;\r\n\r\n return {\r\n nav: {\r\n pageID: W.PageID.MDS_BLOB,\r\n title: W.KnownTitle.MDS_BLOB,\r\n },\r\n items: {\r\n title: W.KnownTitle.MDS_BLOB,\r\n groups: items && items.map(index => {\r\n const item = pe.getMdsBlobItem(index)!;\r\n return {\r\n title: titleOf(index),\r\n items: [\r\n FM.formatCompressedUIntField(\"Size\", item.Size),\r\n FM.formatBytesField(\"Value\", item.Value),\r\n ]\r\n }\r\n })\r\n },\r\n paging: {\r\n currentPageNumber: pgNum,\r\n pageNavList: cache.mdsBlob!.pages.map((v, i) => ({\r\n title: `Page [${i + 1}] (${titleOf(v[0])} - ${titleOf(v[v.length - 1])}})`,\r\n pageID: W.PageID.MDS_BLOB,\r\n pageNum: i\r\n }))\r\n }\r\n };\r\n}\r\n\r\nexport function generateMdsGuidPageData(pe: PEImage): W.PagedItemListPageData {\r\n const titleOf = (i: number) => `#GUID[${FM.formatHexDec(i)}]`;\r\n return {\r\n nav: {\r\n pageID: W.PageID.MDS_GUID,\r\n title: W.KnownTitle.MDS_GUID,\r\n },\r\n items: {\r\n title: W.KnownTitle.MDS_GUID,\r\n groups: [{\r\n title: \"\",\r\n items: pe.getMdsGuidItems()!.items.map((v, i) =>\r\n FM.formatGuidField(titleOf(i + 1), v))\r\n }]\r\n },\r\n };\r\n}\r\n\r\nfunction checkAndBuildCacheForMdsStrings(pe: PEImage, cache: G.GeneratorCache, cfg: G.GeneratorConfig): void {\r\n if (cache.mdsStrings) return;\r\n\r\n const mdRoot = pe.getMetadataRoot();\r\n if (!mdRoot) return;\r\n\r\n const sh = pe.getMetadataStreamHeader(F.MetadataStreamName.Strings);\r\n if (!sh) return;\r\n\r\n let indexes: number[] = [0];\r\n const base = mdRoot._offset + sh.Offset.value;\r\n for (let p = 1; p < sh.Size.value; p++) {\r\n if (pe.getU1(base + p - 1) == 0) {\r\n indexes.push(p);\r\n }\r\n }\r\n\r\n cache.mdsStrings = {\r\n pages: putIndexToPages(indexes, cfg.mdsOffsetListPageSize)\r\n };\r\n}\r\n\r\nfunction checkAndBuildCacheForMdsUS(pe: PEImage, cache: G.GeneratorCache, cfg: G.GeneratorConfig): void {\r\n if (cache.mdsUS) return;\r\n\r\n const mdRoot = pe.getMetadataRoot();\r\n if (!mdRoot) return;\r\n\r\n const sh = pe.getMetadataStreamHeader(F.MetadataStreamName.US);\r\n if (!sh) return;\r\n\r\n const indexes = getBlobIndexes(pe, mdRoot._offset + sh.Offset.value, sh.Size.value);\r\n\r\n cache.mdsUS = {\r\n pages: putIndexToPages(indexes, cfg.mdsOffsetListPageSize)\r\n };\r\n}\r\n\r\nfunction checkAndBuildCacheForMdsBlob(pe: PEImage, cache: G.GeneratorCache, cfg: G.GeneratorConfig): void {\r\n if (cache.mdsBlob) return;\r\n\r\n const mdRoot = pe.getMetadataRoot();\r\n if (!mdRoot) return;\r\n\r\n const sh = pe.getMetadataStreamHeader(F.MetadataStreamName.Blob);\r\n if (!sh) return;\r\n\r\n const indexes = getBlobIndexes(pe, mdRoot._offset + sh.Offset.value, sh.Size.value);\r\n\r\n cache.mdsBlob = {\r\n pages: putIndexToPages(indexes, cfg.mdsOffsetListPageSize)\r\n };\r\n}\r\n\r\nfunction getBlobIndexes(pe: PEImage, base: number, size: number): number[] {\r\n let indexes: number[] = [];\r\n let p = 0;\r\n\r\n while (p < size) {\r\n indexes.push(p);\r\n const dtsz = U.getCompressedIntSize(pe.getU1(base + p));\r\n const szval = U.decompressUint(pe.getData(base + p, dtsz));\r\n p += szval + dtsz;\r\n }\r\n\r\n return indexes;\r\n}\r\n\r\nfunction putIndexToPages(indexes: number[], pageSize: number): G.MdsOffsetListPageCache[] {\r\n let pages: G.MdsOffsetListPageCache[] = [];\r\n let pageItems: G.MdsOffsetListPageCache = [];\r\n\r\n for (let pStart = 0, pEnd = 0; pStart < indexes.length; pStart = pEnd) {\r\n while (indexes[pEnd] - indexes[pStart] < pageSize\r\n && pEnd < indexes.length) {\r\n pageItems.push(indexes[pEnd++]);\r\n }\r\n pages.push(pageItems.slice());\r\n pageItems = [];\r\n }\r\n\r\n return pages;\r\n}","import { PEImage } from \"../pe/image\";\r\nimport * as F from \"../pe/image-flags\";\r\nimport * as S from \"../pe/structures\";\r\nimport * as FM from \"./formatter\";\r\nimport * as G from \"./generator\";\r\n\r\nexport function generateMdsTablePageData(pe: PEImage): W.MdsTablePageData {\r\n return {\r\n nav: {\r\n pageID: W.PageID.MDS_TABLE,\r\n title: W.KnownTitle.MDS_TABLE,\r\n },\r\n tableHeader: generateMDTableHeader(pe),\r\n tableInfo: generateMDTableList(pe),\r\n };\r\n}\r\n\r\nfunction generateMDTableHeader(pe: PEImage): W.GroupedStruct {\r\n let s: W.GroupedStruct = {\r\n title: W.KnownTitle.MDT_HEADER,\r\n elemID: W.KnownElemID.MDT_HEADER,\r\n };\r\n\r\n const h = pe.getMetadataTableHeader();\r\n if (!h) return s;\r\n\r\n s.groups = [{\r\n title: \"\",\r\n items: [\r\n FM.formatU4Field(\"Reserved\", h.Reserved),\r\n FM.formatU1Field(\"MajorVersion\", h.MajorVersion, true),\r\n FM.formatU1Field(\"MinorVersion\", h.MinorVersion, true),\r\n FM.formatU1Field(\"HeapSizes\", h.HeapSizes),\r\n FM.formatU1Field(\"Reserved2\", h.Reserved2),\r\n FM.formatU8Field(\"Valid\", h.Valid),\r\n FM.formatU8Field(\"Sorted\", h.Sorted),\r\n ]\r\n }, {\r\n title: \"Rows\",\r\n items: h.Rows.items.map((v, i) => FM.formatU4Field(`Rows[${i}]`, v, true))\r\n }];\r\n\r\n return s;\r\n}\r\n\r\nfunction generateMDTableList(pe: PEImage): W.MdTableInfo[] {\r\n let s: W.MdTableInfo[] = [];\r\n for (let id = 0; id < F.NumberOfMdTables; id++) {\r\n s.push({\r\n index: `${FM.formatU1Hex(id)} (${FM.formatDec(id)})`,\r\n name: F.MetadataTableIndex[id],\r\n valid: pe.isMetadataTableValid(id),\r\n sorted: pe.isMetadataTableSorted(id),\r\n rows: FM.formatDec(pe.getMetadataTableRows(id)),\r\n });\r\n }\r\n return s;\r\n}\r\n\r\nexport function generateMdtPageData(\r\n pe: PEImage,\r\n tid: F.MetadataTableIndex,\r\n cfg: G.GeneratorConfig,\r\n pgNum: number): W.PagedItemListPageData {\r\n const ti = F.MetadataTableIndex;\r\n const title = ti[tid] + \" Table\";\r\n\r\n return {\r\n nav: {\r\n pageID: W.PageID.MDT_TBL,\r\n subID: ti[tid],\r\n title,\r\n },\r\n items: generateTalbeItems(pe, tid, cfg, pgNum, title),\r\n paging: generateMdtPaging(pe, tid, cfg, pgNum)\r\n };\r\n}\r\n\r\nfunction generateTalbeItems(\r\n pe: PEImage,\r\n tid: F.MetadataTableIndex,\r\n cfg: G.GeneratorConfig,\r\n pgNum: number,\r\n title: string): W.GroupedStruct {\r\n const { start, end } = getRidOnPage(pe, tid, cfg, pgNum);\r\n\r\n let loader: (rid: number) => S.FileData;\r\n let builder: (item: S.FileData) => W.StructItem[];\r\n\r\n switch (tid) {\r\n case F.MetadataTableIndex.Module:\r\n loader = pe.getMdtModuleItem.bind(pe);\r\n builder = generateMdtModuleItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.TypeRef:\r\n loader = pe.getMdtTypeRefItem.bind(pe);\r\n builder = generateMdtTypeRefItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.TypeDef:\r\n loader = pe.getMdtTypeDefItem.bind(pe);\r\n builder = generateMdtTypeDefItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.FieldPtr:\r\n loader = pe.getMdtFieldPtrItem.bind(pe);\r\n builder = generateMdtFieldPtrItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.Field:\r\n loader = pe.getMdtFieldItem.bind(pe);\r\n builder = generateMdtFieldItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.MethodPtr:\r\n loader = pe.getMdtMethodPtrItem.bind(pe);\r\n builder = generateMdtMethodPtrItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.MethodDef:\r\n loader = pe.getMdtMethodDefItem.bind(pe);\r\n builder = generateMdtMethodDefItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.ParamPtr:\r\n loader = pe.getMdtParamPtrItem.bind(pe);\r\n builder = generateMdtParamPtrItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.Param:\r\n loader = pe.getMdtParamItem.bind(pe);\r\n builder = generateMdtParamItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.InterfaceImpl:\r\n loader = pe.getMdtInterfaceImplItem.bind(pe);\r\n builder = generateMdtInterfaceImplItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.MemberRef:\r\n loader = pe.getMdtMemberRefItem.bind(pe);\r\n builder = generateMdtMemberRefItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.Constant:\r\n loader = pe.getMdtConstantItem.bind(pe);\r\n builder = generateMdtConstantItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.CustomAttribute:\r\n loader = pe.getMdtCustomAttributeItem.bind(pe);\r\n builder = generateMdtCustomAttributeItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.FieldMarshal:\r\n loader = pe.getMdtFieldMarshalItem.bind(pe);\r\n builder = generateMdtFieldMarshalItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.DeclSecurity:\r\n loader = pe.getMdtDeclSecurityItem.bind(pe);\r\n builder = generateMdtDeclSecurityItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.ClassLayout:\r\n loader = pe.getMdtClassLayoutItem.bind(pe);\r\n builder = generateMdtClassLayoutItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.FieldLayout:\r\n loader = pe.getMdtFieldLayoutItem.bind(pe);\r\n builder = generateMdtFieldLayoutItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.StandAloneSig:\r\n loader = pe.getMdtStandAloneSigItem.bind(pe);\r\n builder = generateMdtStandAloneSigItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.EventMap:\r\n loader = pe.getMdtEventMapItem.bind(pe);\r\n builder = generateMdtEventMapItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.EventPtr:\r\n loader = pe.getMdtEventPtrItem.bind(pe);\r\n builder = generateMdtEventPtrItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.Event:\r\n loader = pe.getMdtEventItem.bind(pe);\r\n builder = generateMdtEventItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.PropertyMap:\r\n loader = pe.getMdtPropertyMapItem.bind(pe);\r\n builder = generateMdtPropertyMapItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.PropertyPtr:\r\n loader = pe.getMdtPropertyPtrItem.bind(pe);\r\n builder = generateMdtPropertyPtrItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.Property:\r\n loader = pe.getMdtPropertyItem.bind(pe);\r\n builder = generateMdtPropertyItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.MethodSemantics:\r\n loader = pe.getMdtMethodSemanticsItem.bind(pe);\r\n builder = generateMdtMethodSemanticsItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.MethodImpl:\r\n loader = pe.getMdtMethodImplItem.bind(pe);\r\n builder = generateMdtMethodImplItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.ModuleRef:\r\n loader = pe.getMdtModuleRefItem.bind(pe);\r\n builder = generateMdtModuleRefItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.TypeSpec:\r\n loader = pe.getMdtTypeSpecItem.bind(pe);\r\n builder = generateMdtTypeSpecItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.ImplMap:\r\n loader = pe.getMdtImplMapItem.bind(pe);\r\n builder = generateMdtImplMapItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.FieldRVA:\r\n loader = pe.getMdtFieldRVAItem.bind(pe);\r\n builder = generateMdtFieldRVAItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.ENCLog:\r\n loader = pe.getMdtENCLogItem.bind(pe);\r\n builder = generateMdtENCLogItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.ENCMap:\r\n loader = pe.getMdtENCMapItem.bind(pe);\r\n builder = generateMdtENCMapItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.Assembly:\r\n loader = pe.getMdtAssemblyItem.bind(pe);\r\n builder = generateMdtAssemblyItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.AssemblyProcessor:\r\n loader = pe.getMdtAssemblyProcessorItem.bind(pe);\r\n builder = generateMdtAssemblyProcessorItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.AssemblyOS:\r\n loader = pe.getMdtAssemblyOSItem.bind(pe);\r\n builder = generateMdtAssemblyOSItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.AssemblyRef:\r\n loader = pe.getMdtAssemblyRefItem.bind(pe);\r\n builder = generateMdtAssemblyRefItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.AssemblyRefProcessor:\r\n loader = pe.getMdtAssemblyRefProcessorItem.bind(pe);\r\n builder = generateMdtAssemblyRefProcessorItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.AssemblyRefOS:\r\n loader = pe.getMdtAssemblyRefOSItem.bind(pe);\r\n builder = generateMdtAssemblyRefOSItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.File:\r\n loader = pe.getMdtFileItem.bind(pe);\r\n builder = generateMdtFileItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.ExportedType:\r\n loader = pe.getMdtExportedTypeItem.bind(pe);\r\n builder = generateMdtExportedTypeItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.ManifestResource:\r\n loader = pe.getMdtManifestResourceItem.bind(pe);\r\n builder = generateMdtManifestResourceItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.NestedClass:\r\n loader = pe.getMdtNestedClassItem.bind(pe);\r\n builder = generateMdtNestedClassItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.GenericParam:\r\n loader = pe.getMdtGenericParamItem.bind(pe);\r\n builder = generateMdtGenericParamItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.MethodSpec:\r\n loader = pe.getMdtMethodSpecItem.bind(pe);\r\n builder = generateMdtMethodSpecItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n case F.MetadataTableIndex.GenericParamConstraint:\r\n loader = pe.getMdtGenericParamConstraintItem.bind(pe);\r\n builder = generateMdtGenericParamConstraintItems as (item: S.FileData) => W.StructItem[];\r\n break;\r\n default:\r\n return { title };\r\n }\r\n\r\n return generateSignleMdtTableItems(pe, tid, title, start, end, loader, builder);\r\n}\r\n\r\nfunction generateSignleMdtTableItems<T>(\r\n pe: PEImage, tid: F.MetadataTableIndex, title: string, start: number, end: number,\r\n loader: (rid: number) => T,\r\n builder: (item: T) => W.StructItem[]): W.GroupedStruct {\r\n let items: T[] = [];\r\n for (let rid = start; rid <= end; rid++) {\r\n items.push(loader(rid));\r\n }\r\n\r\n return {\r\n title,\r\n groups: items.map((v, i) => ({\r\n title: `${F.MetadataTableIndex[tid]} [${FM.formatHexDec(start + i)}]`,\r\n items: builder(v)\r\n }))\r\n };\r\n}\r\n\r\nfunction generateMdtModuleItems(item: S.MdtModuleItem): W.StructItem[] {\r\n return [\r\n FM.formatU2Field(\"Generation\", item.Generation),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Mvid\", item.Mvid),\r\n FM.formatU4Field(\"EncId\", item.EncId),\r\n FM.formatU4Field(\"EncBaseId\", item.EncBaseId),\r\n ];\r\n}\r\n\r\nfunction generateMdtTypeRefItems(item: S.MdtTypeRefItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"ResolutionScope\", item.ResolutionScope),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Namespace\", item.Namespace),\r\n ];\r\n}\r\n\r\nfunction generateMdtTypeDefItems(item: S.MdtTypeDefItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Namespace\", item.Namespace),\r\n FM.formatU4Field(\"Extends\", item.Extends),\r\n FM.formatU4Field(\"FieldList\", item.FieldList),\r\n FM.formatU4Field(\"MethodList\", item.MethodList),\r\n ];\r\n}\r\n\r\nfunction generateMdtFieldPtrItems(item: S.MdtFieldPtrItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Field\", item.Field),\r\n ];\r\n}\r\n\r\nfunction generateMdtFieldItems(item: S.MdtFieldItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Signature\", item.Signature),\r\n ];\r\n}\r\n\r\nfunction generateMdtMethodPtrItems(item: S.MdtMethodPtrItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Method\", item.Method),\r\n ];\r\n}\r\n\r\nfunction generateMdtMethodDefItems(item: S.MdtMethodDefItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"RVA\", item.RVA),\r\n FM.formatU4Field(\"ImplFlags\", item.ImplFlags),\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Signature\", item.Signature),\r\n FM.formatU4Field(\"ParamList\", item.ParamList),\r\n ];\r\n}\r\n\r\nfunction generateMdtParamPtrItems(item: S.MdtParamPtrItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Param\", item.Param),\r\n ];\r\n}\r\n\r\nfunction generateMdtParamItems(item: S.MdtParamItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"Sequence\", item.Sequence),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n ];\r\n}\r\n\r\nfunction generateMdtInterfaceImplItems(item: S.MdtInterfaceImplItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Class\", item.Class),\r\n FM.formatU4Field(\"Interface\", item.Interface),\r\n ];\r\n}\r\n\r\nfunction generateMdtMemberRefItems(item: S.MdtMemberRefItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Class\", item.Class),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Signature\", item.Signature),\r\n ];\r\n}\r\n\r\nfunction generateMdtConstantItems(item: S.MdtConstantItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Type\", item.Type),\r\n FM.formatU4Field(\"PaddingZero\", item.PaddingZero),\r\n FM.formatU4Field(\"Parent\", item.Parent),\r\n FM.formatU4Field(\"Value\", item.Value),\r\n ];\r\n}\r\n\r\nfunction generateMdtCustomAttributeItems(item: S.MdtCustomAttributeItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Parent\", item.Parent),\r\n FM.formatU4Field(\"Type\", item.Type),\r\n FM.formatU4Field(\"Value\", item.Value),\r\n ];\r\n}\r\n\r\nfunction generateMdtFieldMarshalItems(item: S.MdtFieldMarshalItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Parent\", item.Parent),\r\n FM.formatU4Field(\"NativeType\", item.NativeType),\r\n ];\r\n}\r\n\r\nfunction generateMdtDeclSecurityItems(item: S.MdtDeclSecurityItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Action\", item.Action),\r\n FM.formatU4Field(\"Parent\", item.Parent),\r\n FM.formatU4Field(\"PermissionSet\", item.PermissionSet),\r\n ];\r\n}\r\n\r\nfunction generateMdtClassLayoutItems(item: S.MdtClassLayoutItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"PackingSize\", item.PackingSize),\r\n FM.formatU4Field(\"ClassSize\", item.ClassSize),\r\n FM.formatU4Field(\"Parent\", item.Parent),\r\n ];\r\n}\r\n\r\nfunction generateMdtFieldLayoutItems(item: S.MdtFieldLayoutItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"OffSet\", item.OffSet),\r\n FM.formatU4Field(\"Field\", item.Field),\r\n ];\r\n}\r\n\r\nfunction generateMdtStandAloneSigItems(item: S.MdtStandAloneSigItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Signature\", item.Signature),\r\n ];\r\n}\r\n\r\nfunction generateMdtEventMapItems(item: S.MdtEventMapItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Parent\", item.Parent),\r\n FM.formatU4Field(\"EventList\", item.EventList),\r\n ];\r\n}\r\n\r\nfunction generateMdtEventPtrItems(item: S.MdtEventPtrItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Generation\", item.Event),\r\n ];\r\n}\r\n\r\nfunction generateMdtEventItems(item: S.MdtEventItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"EventFlags\", item.EventFlags),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"EventType\", item.EventType),\r\n ];\r\n}\r\n\r\nfunction generateMdtPropertyMapItems(item: S.MdtPropertyMapItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Parent\", item.Parent),\r\n FM.formatU4Field(\"PropertyList\", item.PropertyList),\r\n ];\r\n}\r\n\r\nfunction generateMdtPropertyPtrItems(item: S.MdtPropertyPtrItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Property\", item.Property),\r\n ];\r\n}\r\n\r\nfunction generateMdtPropertyItems(item: S.MdtPropertyItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"PropFlags\", item.PropFlags),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Type\", item.Type),\r\n ];\r\n}\r\n\r\nfunction generateMdtMethodSemanticsItems(item: S.MdtMethodSemanticsItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Semantic\", item.Semantic),\r\n FM.formatU4Field(\"Method\", item.Method),\r\n FM.formatU4Field(\"Association\", item.Association),\r\n ];\r\n}\r\n\r\nfunction generateMdtMethodImplItems(item: S.MdtMethodImplItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Class\", item.Class),\r\n FM.formatU4Field(\"MethodBody\", item.MethodBody),\r\n FM.formatU4Field(\"MethodDeclaration\", item.MethodDeclaration),\r\n ];\r\n}\r\n\r\nfunction generateMdtModuleRefItems(item: S.MdtModuleRefItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Name\", item.Name),\r\n ];\r\n}\r\n\r\nfunction generateMdtTypeSpecItems(item: S.MdtTypeSpecItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Signature\", item.Signature),\r\n ];\r\n}\r\n\r\nfunction generateMdtImplMapItems(item: S.MdtImplMapItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"MappingFlags\", item.MappingFlags),\r\n FM.formatU4Field(\"MemberForwarded\", item.MemberForwarded),\r\n FM.formatU4Field(\"ImportName\", item.ImportName),\r\n FM.formatU4Field(\"ImportScope\", item.ImportScope),\r\n ];\r\n}\r\n\r\nfunction generateMdtFieldRVAItems(item: S.MdtFieldRVAItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"RVA\", item.RVA),\r\n FM.formatU4Field(\"Field\", item.Field),\r\n ];\r\n}\r\n\r\nfunction generateMdtENCLogItems(item: S.MdtENCLogItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Token\", item.Token),\r\n FM.formatU4Field(\"FuncCode\", item.FuncCode),\r\n ];\r\n}\r\n\r\nfunction generateMdtENCMapItems(item: S.MdtENCMapItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Token\", item.Token),\r\n ];\r\n}\r\n\r\nfunction generateMdtAssemblyItems(item: S.MdtAssemblyItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"HashAlgId\", item.HashAlgId),\r\n FM.formatU4Field(\"MajorVersion\", item.MajorVersion),\r\n FM.formatU4Field(\"MinorVersion\", item.MinorVersion),\r\n FM.formatU4Field(\"BuildNumber\", item.BuildNumber),\r\n FM.formatU4Field(\"RevisionNumber\", item.RevisionNumber),\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"PublicKey\", item.PublicKey),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Locale\", item.Locale),\r\n ];\r\n}\r\n\r\nfunction generateMdtAssemblyProcessorItems(item: S.MdtAssemblyProcessorItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Processor\", item.Processor),\r\n ];\r\n}\r\n\r\nfunction generateMdtAssemblyOSItems(item: S.MdtAssemblyOSItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"OSPlatformID\", item.OSPlatformID),\r\n FM.formatU4Field(\"OSMajorVersion\", item.OSMajorVersion),\r\n FM.formatU4Field(\"OSMinorVersion\", item.OSMinorVersion),\r\n ];\r\n}\r\n\r\nfunction generateMdtAssemblyRefItems(item: S.MdtAssemblyRefItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"MajorVersion\", item.MajorVersion),\r\n FM.formatU4Field(\"MinorVersion\", item.MinorVersion),\r\n FM.formatU4Field(\"BuildNumber\", item.BuildNumber),\r\n FM.formatU4Field(\"RevisionNumber\", item.RevisionNumber),\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"PublicKeyOrToken\", item.PublicKeyOrToken),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Locale\", item.Locale),\r\n FM.formatU4Field(\"HashValue\", item.HashValue),\r\n ];\r\n}\r\n\r\nfunction generateMdtAssemblyRefProcessorItems(item: S.MdtAssemblyRefProcessorItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Processor\", item.Processor),\r\n FM.formatU4Field(\"AssemblyRef\", item.AssemblyRef),\r\n ];\r\n}\r\n\r\nfunction generateMdtAssemblyRefOSItems(item: S.MdtAssemblyRefOSItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"OSPlatformID\", item.OSPlatformID),\r\n FM.formatU4Field(\"OSMajorVersion\", item.OSMajorVersion),\r\n FM.formatU4Field(\"OSMinorVersion\", item.OSMinorVersion),\r\n FM.formatU4Field(\"AssemblyRef\", item.AssemblyRef),\r\n ];\r\n}\r\n\r\nfunction generateMdtFileItems(item: S.MdtFileItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"HashValue\", item.HashValue),\r\n ];\r\n}\r\n\r\nfunction generateMdtExportedTypeItems(item: S.MdtExportedTypeItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"TypeDefId\", item.TypeDefId),\r\n FM.formatU4Field(\"TypeName\", item.TypeName),\r\n FM.formatU4Field(\"TypeNamespace\", item.TypeNamespace),\r\n FM.formatU4Field(\"Implementation\", item.Implementation),\r\n ];\r\n}\r\n\r\nfunction generateMdtManifestResourceItems(item: S.MdtManifestResourceItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Offset\", item.Offset),\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n FM.formatU4Field(\"Implementation\", item.Implementation),\r\n ];\r\n}\r\n\r\nfunction generateMdtNestedClassItems(item: S.MdtNestedClassItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"NestedClass\", item.NestedClass),\r\n FM.formatU4Field(\"EnclosingClass\", item.EnclosingClass),\r\n ];\r\n}\r\n\r\nfunction generateMdtGenericParamItems(item: S.MdtGenericParamItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Number\", item.Number),\r\n FM.formatU4Field(\"Flags\", item.Flags),\r\n FM.formatU4Field(\"Owner\", item.Owner),\r\n FM.formatU4Field(\"Name\", item.Name),\r\n ];\r\n}\r\n\r\nfunction generateMdtMethodSpecItems(item: S.MdtMethodSpecItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Method\", item.Method),\r\n FM.formatU4Field(\"Instantiation\", item.Instantiation),\r\n ];\r\n}\r\n\r\nfunction generateMdtGenericParamConstraintItems(item: S.MdtGenericParamConstraintItem): W.StructItem[] {\r\n return [\r\n FM.formatU4Field(\"Owner\", item.Owner),\r\n FM.formatU4Field(\"Constraint\", item.Constraint),\r\n ];\r\n}\r\n\r\nfunction generateMdtPaging(\r\n pe: PEImage,\r\n tid: F.MetadataTableIndex,\r\n cfg: G.GeneratorConfig,\r\n pgNum: number): W.Paging {\r\n const paging: W.Paging = {\r\n currentPageNumber: pgNum,\r\n pageNavList: []\r\n };\r\n\r\n const psz = cfg.mdtPageSize;\r\n const rows = pe.getMetadataTableRows(tid);\r\n const pages = Math.floor((rows + psz - 1) / psz);\r\n for (let p = 0; p < pages; p++) {\r\n const tblName = F.MetadataTableIndex[tid];\r\n const titleOf = (r: number) => `${tblName}[${FM.formatHexDec(r)}]`;\r\n const { start, end } = getRidOnPage(pe, tid, cfg, p);\r\n const target: W.NavTarget = {\r\n title: `Page[${p + 1}] (${titleOf(start)} - ${titleOf(end)})`,\r\n pageID: W.PageID.MDT_TBL,\r\n subID: tblName,\r\n pageNum: p,\r\n };\r\n paging.pageNavList.push(target);\r\n }\r\n\r\n return paging;\r\n}\r\n\r\nfunction getRidOnPage(\r\n pe: PEImage,\r\n tid: F.MetadataTableIndex,\r\n cfg: G.GeneratorConfig,\r\n pgNum: number): { start: number, end: number } {\r\n const psz = cfg.mdtPageSize;\r\n const rows = pe.getMetadataTableRows(tid);\r\n const start = pgNum * psz + 1;\r\n let end = start + psz - 1;\r\n if (end > rows) end = rows;\r\n return { start, end };\r\n}","import { PEImage } from \"../pe/image\";\r\nimport * as FM from \"./formatter\";\r\n\r\nexport function generateMetadataHeadersPageData(pe: PEImage): W.MetadataHeadersPageData {\r\n return {\r\n nav: {\r\n pageID: W.PageID.MD_HEADERS,\r\n title: W.KnownTitle.MD_HEADERS,\r\n },\r\n cliHeader: generateCliHeader(pe),\r\n metadataRoot: generateMetadataRoot(pe),\r\n streamHeaders: generateMetadataStreamHeader(pe),\r\n snSignature: generateSNSignature(pe),\r\n };\r\n}\r\n\r\nfunction generateCliHeader(pe: PEImage): W.SimpleStruct {\r\n let s: W.SimpleStruct = {\r\n title: W.KnownTitle.CLI_HEADER,\r\n elemID: W.KnownElemID.CLI_HEADER,\r\n };\r\n\r\n const h = pe.getCliHeader();\r\n if (!h) return s;\r\n\r\n s.items = [\r\n FM.formatU4Field(\"cb\", h.cb, true),\r\n FM.formatU2Field(\"MajorRuntimeVersion\", h.MajorRuntimeVersion, true),\r\n FM.formatU2Field(\"MinorRuntimeVersion\", h.MinorRuntimeVersion, true),\r\n FM.formatU4Field(\"MetaData.VirtualAddress\", h.MetaData.VirtualAddress),\r\n FM.formatU4Field(\"MetaData.Size\", h.MetaData.Size, true),\r\n FM.formatU4Field(\"Flags\", h.Flags),\r\n FM.formatU4Field(\"EntryPointToken\", h.EntryPointToken),\r\n FM.formatU4Field(\"Resources.VirtualAddress\", h.Resources.VirtualAddress),\r\n FM.formatU4Field(\"Resources.Size\", h.Resources.Size, true),\r\n FM.formatU4Field(\"StrongNameSignature.VirtualAddress\", h.StrongNameSignature.VirtualAddress),\r\n FM.formatU4Field(\"StrongNameSignature.Size\", h.StrongNameSignature.Size, true),\r\n FM.formatU4Field(\"CodeManagerTable.VirtualAddress\", h.CodeManagerTable.VirtualAddress),\r\n FM.formatU4Field(\"CodeManagerTable.Size\", h.CodeManagerTable.Size, true),\r\n FM.formatU4Field(\"VTableFixups.VirtualAddress\", h.VTableFixups.VirtualAddress),\r\n FM.formatU4Field(\"VTableFixups.Size\", h.VTableFixups.Size, true),\r\n FM.formatU4Field(\"ExportAddressTableJumps.VirtualAddress\", h.ExportAddressTableJumps.VirtualAddress),\r\n FM.formatU4Field(\"ExportAddressTableJumps.Size\", h.ExportAddressTableJumps.Size, true),\r\n FM.formatU4Field(\"ManagedNativeHeader.VirtualAddress\", h.ManagedNativeHeader.VirtualAddress),\r\n FM.formatU4Field(\"ManagedNativeHeader.Size\", h.ManagedNativeHeader.Size, true),\r\n ];\r\n\r\n return s;\r\n}\r\n\r\nfunction generateSNSignature(pe: PEImage): W.SimpleStruct | undefined {\r\n const d = pe.getStrongNameSignature();\r\n if (!d) return undefined;\r\n\r\n const s: W.SimpleStruct = {\r\n title: W.KnownTitle.SN_SIG,\r\n elemID: W.KnownElemID.SN_SIG,\r\n items: [FM.formatBytesField(\"Signature\", d)]\r\n };\r\n return s;\r\n}\r\n\r\nfunction generateMetadataRoot(pe: PEImage): W.SimpleStruct | undefined {\r\n const h = pe.getMetadataRoot();\r\n if (!h) return undefined;\r\n\r\n const s: W.SimpleStruct = {\r\n title: W.KnownTitle.MD_ROOT,\r\n elemID: W.KnownElemID.MD_ROOT,\r\n items: [\r\n FM.formatU4Field(\"Signature\", h.Signature),\r\n FM.formatU2Field(\"MajorVersion\", h.MajorVersion, true),\r\n FM.formatU2Field(\"MinorVersion\", h.MinorVersion, true),\r\n FM.formatU4Field(\"Reserved\", h.Reserved),\r\n FM.formatU4Field(\"VersionLength\", h.VersionLength, true),\r\n FM.formatStringField(\"VersionString\", h.VersionString),\r\n FM.formatBytesField(\"VersionPadding\", h.VersionPadding),\r\n FM.formatU2Field(\"Flags\", h.Flags),\r\n FM.formatU2Field(\"Streams\", h.Streams, true),\r\n ]\r\n };\r\n return s;\r\n}\r\n\r\nfunction generateMetadataStreamHeader(pe: PEImage): W.GroupedStruct | undefined {\r\n const h = pe.getMetadataStreamHeaders();\r\n if (!h) return undefined;\r\n\r\n const s: W.GroupedStruct = {\r\n title: W.KnownTitle.MDS_HEADERS,\r\n elemID: W.KnownElemID.MDS_HEADERS,\r\n groups: h.items.map((v, i) => ({\r\n title: `[${i}] (${v.Name.value})`,\r\n items: [\r\n FM.formatU4Field(\"Offset\", v.Offset),\r\n FM.formatU4Field(\"Size\", v.Size, true),\r\n FM.formatStringField(\"Name\", v.Name),\r\n FM.formatBytesField(\"Padding\", v.Padding),\r\n ]\r\n }))\r\n };\r\n return s;\r\n}","import { PEImage } from \"../pe/image\";\r\nimport * as S from \"../pe/structures\";\r\nimport * as F from \"../pe/image-flags\";\r\nimport * as FM from \"./formatter\";\r\n\r\nexport function generateHeadersPageData(pe: PEImage): W.HeadersPageData {\r\n return {\r\n nav: {\r\n pageID: W.PageID.HEADERS,\r\n title: W.KnownTitle.HEADERS,\r\n },\r\n dosHeader: generateDosHeader(pe),\r\n peSignature: generatePESignature(pe),\r\n fileHeader: generateFileHeader(pe),\r\n optionalHeader: generateOptionalHeader(pe),\r\n dataDirectories: generateDataDirectories(pe),\r\n sectionHeaders: generateSectionHeaders(pe),\r\n };\r\n}\r\n\r\nfunction generateDosHeader(pe: PEImage): W.SimpleStruct {\r\n let s: W.SimpleStruct = {\r\n title: W.KnownTitle.DOS_HEADER,\r\n elemID: W.KnownElemID.DOS_HEADER,\r\n };\r\n\r\n const h = pe.getDosHeader();\r\n if (!h) return s;\r\n\r\n s.items = [\r\n FM.formatU2Field(\"e_magic\", h.e_magic),\r\n FM.formatU2Field(\"e_cblp\", h.e_cblp),\r\n FM.formatU2Field(\"e_cp\", h.e_cp),\r\n FM.formatU2Field(\"e_crlc\", h.e_crlc),\r\n FM.formatU2Field(\"e_cparhdr\", h.e_cparhdr),\r\n FM.formatU2Field(\"e_minalloc\", h.e_minalloc),\r\n FM.formatU2Field(\"e_maxalloc\", h.e_maxalloc),\r\n FM.formatU2Field(\"e_ss\", h.e_ss),\r\n FM.formatU2Field(\"e_sp\", h.e_sp),\r\n FM.formatU2Field(\"e_csum\", h.e_csum),\r\n FM.formatU2Field(\"e_ip\", h.e_ip),\r\n FM.formatU2Field(\"e_cs\", h.e_cs),\r\n FM.formatU2Field(\"e_lfarlc\", h.e_lfarlc),\r\n FM.formatU2Field(\"e_ovno\", h.e_ovno),\r\n FM.formatBytesField(\"e_res\", h.e_res),\r\n FM.formatU2Field(\"e_oemid\", h.e_oemid),\r\n FM.formatU2Field(\"e_oeminfo\", h.e_oeminfo),\r\n FM.formatBytesField(\"e_res2\", h.e_res2),\r\n FM.formatU4Field(\"e_lfanew\", h.e_lfanew),\r\n ];\r\n\r\n return s;\r\n}\r\n\r\nfunction generatePESignature(pe: PEImage): W.SimpleStruct {\r\n let s: W.SimpleStruct = {\r\n title: W.KnownTitle.PE_SIGNATURE,\r\n elemID: W.KnownElemID.PE_SIGNATURE,\r\n };\r\n\r\n const h = pe.getPESignature();\r\n if (!h) return s;\r\n\r\n s.items = [\r\n FM.formatU4Field(\"PE Signature\", h),\r\n ];\r\n\r\n return s;\r\n}\r\n\r\nfunction generateFileHeader(pe: PEImage): W.SimpleStruct {\r\n let s: W.SimpleStruct = {\r\n title: W.KnownTitle.FILE_HEADER,\r\n elemID: W.KnownElemID.FILE_HEADER,\r\n };\r\n\r\n const h = pe.getFileHeader();\r\n if (!h) return s;\r\n\r\n s.items = [\r\n FM.formatU2Field(\"Machine\", h.Machine),\r\n FM.formatU2Field(\"NumberOfSections\", h.NumberOfSections, true),\r\n FM.formatU4Field(\"TimeDateStamp\", h.TimeDateStamp),\r\n FM.formatU4Field(\"PointerToSymbolTable\", h.PointerToSymbolTable),\r\n FM.formatU4Field(\"NumberOfSymbols\", h.NumberOfSymbols, true),\r\n FM.formatU2Field(\"SizeOfOptionalHeader\", h.SizeOfOptionalHeader, true),\r\n FM.formatU2Field(\"Characteristics\", h.Characteristics),\r\n ];\r\n\r\n return s;\r\n}\r\n\r\nfunction generateOptionalHeader(pe: PEImage): W.GroupedStruct {\r\n let s: W.GroupedStruct = {\r\n title: W.KnownTitle.OPTIONAL_HEADER,\r\n elemID: W.KnownElemID.OPTIONAL_HEADER,\r\n };\r\n\r\n const h = pe.getOptionalHeader();\r\n if (!h) return s;\r\n\r\n switch (h.Magic.value) {\r\n case F.IMAGE_NT_OPTIONAL_HDR32_MAGIC:\r\n s.title += \" (32-bit)\";\r\n fillOptionalHeader32Fields(s, <S.ImageOptionalHeader32>h);\r\n break;\r\n\r\n case F.IMAGE_NT_OPTIONAL_HDR64_MAGIC:\r\n s.title += \" (64-bit)\";\r\n fillOptionalHeader64Fields(s, <S.ImageOptionalHeader64>h);\r\n break;\r\n }\r\n\r\n return s;\r\n}\r\n\r\nfunction fillOptionalHeader32Fields(s: W.GroupedStruct, h: S.ImageOptionalHeader32): void {\r\n s.groups = [{\r\n title: \"Standard Fields\",\r\n items: [\r\n FM.formatU2Field(\"Magic\", h.Magic),\r\n FM.formatU1Field(\"MajorLinkerVersion\", h.MajorLinkerVersion, true),\r\n FM.formatU1Field(\"MinorLinkerVersion\", h.MinorLinkerVersion, true),\r\n FM.formatU4Field(\"SizeOfCode\", h.SizeOfCode, true),\r\n FM.formatU4Field(\"SizeOfInitializedData\", h.SizeOfInitializedData, true),\r\n FM.formatU4Field(\"SizeOfUninitializedData\", h.SizeOfUninitializedData, true),\r\n FM.formatU4Field(\"AddressOfEntryPoint\", h.AddressOfEntryPoint),\r\n FM.formatU4Field(\"BaseOfCode\", h.BaseOfCode),\r\n FM.formatU4Field(\"BaseOfData\", h.BaseOfData),\r\n ],\r\n }, {\r\n title: \"NT-specified Fields\",\r\n items: [\r\n FM.formatU4Field(\"ImageBase\", h.ImageBase),\r\n FM.formatU4Field(\"SectionAlignment\", h.SectionAlignment, true),\r\n FM.formatU4Field(\"FileAlignment\", h.FileAlignment, true),\r\n FM.formatU2Field(\"MajorOperatingSystemVersion\", h.MajorOperatingSystemVersion, true),\r\n FM.formatU2Field(\"MinorOperatingSystemVersion\", h.MinorOperatingSystemVersion, true),\r\n FM.formatU2Field(\"MajorImageVersion\", h.MajorImageVersion, true),\r\n FM.formatU2Field(\"MinorImageVersion\", h.MinorImageVersion, true),\r\n FM.formatU2Field(\"MajorSubsystemVersion\", h.MajorSubsystemVersion, true),\r\n FM.formatU2Field(\"MinorSubsystemVersion\", h.MinorSubsystemVersion, true),\r\n FM.formatU4Field(\"Win32VersionValue\", h.Win32VersionValue, true),\r\n FM.formatU4Field(\"SizeOfImage\", h.SizeOfImage, true),\r\n FM.formatU4Field(\"SizeOfHeaders\", h.SizeOfHeaders, true),\r\n FM.formatU4Field(\"CheckSum\", h.CheckSum),\r\n FM.formatU2Field(\"Subsystem\", h.Subsystem),\r\n FM.formatU2Field(\"DllCharacteristics\", h.DllCharacteristics),\r\n FM.formatU4Field(\"SizeOfStackReserve\", h.SizeOfStackReserve, true),\r\n FM.formatU4Field(\"SizeOfStackCommit\", h.SizeOfStackCommit, true),\r\n FM.formatU4Field(\"SizeOfHeapReserve\", h.SizeOfHeapReserve, true),\r\n FM.formatU4Field(\"SizeOfHeapCommit\", h.SizeOfHeapCommit, true),\r\n FM.formatU4Field(\"LoaderFlags\", h.LoaderFlags),\r\n FM.formatU4Field(\"NumberOfRvaAndSizes\", h.NumberOfRvaAndSizes, true),\r\n ],\r\n }];\r\n}\r\n\r\nfunction fillOptionalHeader64Fields(s: W.GroupedStruct, h: S.ImageOptionalHeader64): void {\r\n s.groups = [{\r\n title: \"Standard Fields\",\r\n items: [\r\n FM.formatU2Field(\"Magic\", h.Magic),\r\n FM.formatU1Field(\"MajorLinkerVersion\", h.MajorLinkerVersion, true),\r\n FM.formatU1Field(\"MinorLinkerVersion\", h.MinorLinkerVersion, true),\r\n FM.formatU4Field(\"SizeOfCode\", h.SizeOfCode, true),\r\n FM.formatU4Field(\"SizeOfInitializedData\", h.SizeOfInitializedData, true),\r\n FM.formatU4Field(\"SizeOfUninitializedData\", h.SizeOfUninitializedData, true),\r\n FM.formatU4Field(\"AddressOfEntryPoint\", h.AddressOfEntryPoint),\r\n FM.formatU4Field(\"BaseOfCode\", h.BaseOfCode),\r\n ],\r\n }, {\r\n title: \"NT-specified Fields\",\r\n items: [\r\n FM.formatU8Field(\"ImageBase\", h.ImageBase),\r\n FM.formatU4Field(\"SectionAlignment\", h.SectionAlignment, true),\r\n FM.formatU4Field(\"FileAlignment\", h.FileAlignment, true),\r\n FM.formatU2Field(\"MajorOperatingSystemVersion\", h.MajorOperatingSystemVersion, true),\r\n FM.formatU2Field(\"MinorOperatingSystemVersion\", h.MinorOperatingSystemVersion, true),\r\n FM.formatU2Field(\"MajorImageVersion\", h.MajorImageVersion, true),\r\n FM.formatU2Field(\"MinorImageVersion\", h.MinorImageVersion, true),\r\n FM.formatU2Field(\"MajorSubsystemVersion\", h.MajorSubsystemVersion, true),\r\n FM.formatU2Field(\"MinorSubsystemVersion\", h.MinorSubsystemVersion, true),\r\n FM.formatU4Field(\"Win32VersionValue\", h.Win32VersionValue, true),\r\n FM.formatU4Field(\"SizeOfImage\", h.SizeOfImage, true),\r\n FM.formatU4Field(\"SizeOfHeaders\", h.SizeOfHeaders, true),\r\n FM.formatU4Field(\"CheckSum\", h.CheckSum),\r\n FM.formatU2Field(\"Subsystem\", h.Subsystem),\r\n FM.formatU2Field(\"DllCharacteristics\", h.DllCharacteristics),\r\n FM.formatU8Field(\"SizeOfStackReserve\", h.SizeOfStackReserve, true),\r\n FM.formatU8Field(\"SizeOfStackCommit\", h.SizeOfStackCommit, true),\r\n FM.formatU8Field(\"SizeOfHeapReserve\", h.SizeOfHeapReserve, true),\r\n FM.formatU8Field(\"SizeOfHeapCommit\", h.SizeOfHeapCommit, true),\r\n FM.formatU4Field(\"LoaderFlags\", h.LoaderFlags),\r\n FM.formatU4Field(\"NumberOfRvaAndSizes\", h.NumberOfRvaAndSizes, true),\r\n ],\r\n }];\r\n}\r\n\r\nfunction generateDataDirectories(pe: PEImage): W.GroupedStruct {\r\n let s: W.GroupedStruct = {\r\n title: W.KnownTitle.DATA_DIRECTORIES,\r\n elemID: W.KnownElemID.DATA_DIRECTORIES,\r\n };\r\n\r\n const h = pe.getDataDirectories();\r\n if (!h) return s;\r\n\r\n s.groups = h.items.map((v, i) => ({\r\n title: `[${i}] ${F.ImageDirectoryEntry[i] || \"\"}`,\r\n items: [\r\n FM.formatU4Field(\"VirtualAddress\", v.VirtualAddress),\r\n FM.formatU4Field(\"Size\", v.Size, true),\r\n ]\r\n } as W.SimpleStruct));\r\n\r\n return s;\r\n}\r\n\r\nfunction generateSectionHeaders(pe: PEImage): W.GroupedStruct {\r\n let s: W.GroupedStruct = {\r\n title: W.KnownTitle.SECTION_HEADERS,\r\n elemID: W.KnownElemID.SECTION_HEADERS,\r\n };\r\n\r\n const h = pe.getSectionHeaders();\r\n if (!h) return s;\r\n\r\n s.groups = h.items.map((v, i) => ({\r\n title: `[${i}] (${v.Name.value})`,\r\n items: [\r\n FM.formatStringField(\"Name\", v.Name),\r\n FM.formatU4Field(\"VirtualSize\", v.VirtualSize, true),\r\n FM.formatU4Field(\"VirtualAddress\", v.VirtualAddress),\r\n FM.formatU4Field(\"SizeOfRawData\", v.SizeOfRawData, true),\r\n FM.formatU4Field(\"PointerToRawData\", v.PointerToRawData),\r\n FM.formatU4Field(\"PointerToRelocations\", v.PointerToRelocations),\r\n FM.formatU4Field(\"PointerToLinenumbers\", v.PointerToLinenumbers),\r\n FM.formatU2Field(\"NumberOfRelocations\", v.NumberOfRelocations, true),\r\n FM.formatU2Field(\"NumberOfLinenumbers\", v.NumberOfLinenumbers, true),\r\n FM.formatU4Field(\"Characteristics\", v.Characteristics),\r\n ]\r\n }));\r\n\r\n return s;\r\n}\r\n","import { PEImage } from \"../pe/image\";\r\nimport * as F from \"../pe/image-flags\";\r\n\r\nimport { generateHeadersPageData } from \"./headers\";\r\nimport { generateMetadataHeadersPageData } from \"./metadata-headers\";\r\nimport { generateMdsTablePageData, generateMdtPageData } from \"./mds-table\";\r\nimport {\r\n generateMdsStringsPageData,\r\n generateMdsUSPageData,\r\n generateMdsGuidPageData,\r\n generateMdsBlobPageData\r\n} from \"./mds-list\";\r\n\r\nexport function generatePageData(pe: PEImage, pageID: W.PageID, subID?: string, pageNum?: number): W.PageData {\r\n switch (pageID) {\r\n case W.PageID.HEADERS: return generateHeadersPageData(pe);\r\n case W.PageID.MD_HEADERS: return generateMetadataHeadersPageData(pe);\r\n case W.PageID.MDS_TABLE: return generateMdsTablePageData(pe);\r\n case W.PageID.MDS_STRINGS: return generateMdsStringsPageData(pe, cache, cfg, pageNum || 0);\r\n case W.PageID.MDS_US: return generateMdsUSPageData(pe, cache, cfg, pageNum || 0);\r\n case W.PageID.MDS_GUID: return generateMdsGuidPageData(pe);\r\n case W.PageID.MDS_BLOB: return generateMdsBlobPageData(pe, cache, cfg, pageNum || 0);\r\n case W.PageID.MDT_TBL: {\r\n const tid = F.MetadataTableIndex[subID! as any] as any as F.MetadataTableIndex;\r\n return generateMdtPageData(pe, tid, cfg, pageNum || 0);\r\n }\r\n default: return { nav: { pageID: W.PageID.NOTFOUND, title: W.KnownTitle.NOTFOUND } };\r\n }\r\n}\r\n\r\nexport interface GeneratorCache {\r\n mdsStrings?: MdsOffsetListCache;\r\n mdsUS?: MdsOffsetListCache;\r\n mdsBlob?: MdsOffsetListCache;\r\n}\r\n\r\nexport type MdsOffsetListCache = {\r\n pages: MdsOffsetListPageCache[];\r\n}\r\n\r\nexport type MdsOffsetListPageCache = number[];\r\n\r\nexport function clearGeneratorCache(): void {\r\n cache = {};\r\n}\r\n\r\nexport interface GeneratorConfig {\r\n mdsOffsetListPageSize: number; // Total bytes per page.\r\n mdtPageSize: number; // Total items per page.\r\n}\r\n\r\nlet cache: GeneratorCache = {};\r\n\r\nconst cfg: GeneratorConfig = {\r\n mdsOffsetListPageSize: 4000,\r\n mdtPageSize: 100,\r\n}\r\n","export const enum PEErrorType {\r\n INVALID_DATA_POSITION = \"INVALID_DATA_POSITION\",\r\n INVALID_DOS_SIGNATURE = \"INVALID_DOS_SIGNATURE\",\r\n INVALID_PE_SIGNATURE = \"INVALID_PE_SIGNATURE\",\r\n INVALID_OPTIONAL_HEADER_MAGIC = \"INVALID_OPTIONAL_HEADER_MAGIC\",\r\n INVALID_DATA_DIRECTORY_COUNT = \"INVALID_DATA_DIRECTORY_COUNT\",\r\n}\r\n\r\nexport class PEError extends Error {\r\n constructor(\r\n public type: PEErrorType,\r\n public offset?: number,\r\n public size?: number\r\n ) {\r\n super(type);\r\n }\r\n}\r\n","import * as S from \"./structures\";\r\nimport * as F from \"./image-flags\";\r\nimport * as U from \"./utils\";\r\n\r\nexport interface FileDataProvider {\r\n getU1(p: number): number;\r\n getU2(p: number): number;\r\n getU4(p: number): number;\r\n getData(p: number, sz: number): Uint8Array;\r\n}\r\n\r\nexport interface MetadataSizingProvider {\r\n getHeapSize(heap: F.MetadataHeapSizeID): number;\r\n getTableIDSize(t: F.MetadataTableIndex): number;\r\n getCodedTokenSize(t: F.MetadataCodedTokenIndex): number;\r\n}\r\n\r\n//\r\n// Basic structures.\r\n//\r\n\r\nexport function loadU1Field(d: FileDataProvider, p: number): S.U1Field {\r\n return {\r\n _offset: p, _size: 1, data: d.getData(p, 1), value: d.getU1(p)\r\n };\r\n}\r\n\r\nexport function loadU2Field(d: FileDataProvider, p: number): S.U2Field {\r\n return {\r\n _offset: p, _size: 2, data: d.getData(p, 2), value: d.getU2(p)\r\n };\r\n}\r\n\r\nexport function loadU4Field(d: FileDataProvider, p: number): S.U4Field {\r\n return {\r\n _offset: p, _size: 4, data: d.getData(p, 4), value: d.getU4(p)\r\n };\r\n}\r\n\r\nexport function loadU8Field(d: FileDataProvider, p: number): S.U8Field {\r\n const low = d.getU4(p);\r\n const high = d.getU4(p + 4);\r\n\r\n return {\r\n _offset: p, _size: 8, data: d.getData(p, 8), low, high\r\n };\r\n}\r\n\r\nexport function loadCompressedUIntField(d: FileDataProvider, p: number): S.CompressedUIntField {\r\n const sz = U.getCompressedIntSize(d.getU1(p));\r\n const data = new Uint8Array(d.getData(p, sz));\r\n const value = U.decompressUint(data);\r\n\r\n return { _offset: p, _size: sz, data, value };\r\n}\r\n\r\nexport function loadU1EnumField<T>(d: FileDataProvider, p: number): S.U1EnumField<T> {\r\n return {\r\n _offset: p, _size: 1, data: d.getData(p, 1), value: d.getU1(p) as any as T\r\n };\r\n}\r\n\r\nexport function loadU2EnumField<T>(d: FileDataProvider, p: number): S.U2EnumField<T> {\r\n return {\r\n _offset: p, _size: 2, data: d.getData(p, 2), value: d.getU2(p) as any as T\r\n };\r\n}\r\n\r\nexport function loadU4EnumField<T>(d: FileDataProvider, p: number): S.U4EnumField<T> {\r\n return {\r\n _offset: p, _size: 4, data: d.getData(p, 4), value: d.getU4(p) as any as T\r\n };\r\n}\r\n\r\nexport function loadFixedSizeByteArrayField(d: FileDataProvider, p: number, sz: number): S.Field {\r\n return {\r\n _offset: p, _size: sz, data: d.getData(p, sz)\r\n };\r\n}\r\n\r\nexport function loadFixedSizeAsciiStringField(d: FileDataProvider, p: number, sz: number): S.StringField {\r\n const data = d.getData(p, sz);\r\n const value = String.fromCharCode.apply(null, Array.from(data).filter(v => v != 0));\r\n\r\n return {\r\n _offset: p, _size: sz, data, value\r\n };\r\n}\r\n\r\nexport function loadNullTerminatedStringField(d: FileDataProvider, p: number): S.StringField {\r\n let bytes: number[] = [];\r\n let ptr = p;\r\n let b: number;\r\n\r\n do {\r\n b = d.getU1(ptr++);\r\n bytes.push(b);\r\n } while (b != 0);\r\n const str = bytes.slice(0, bytes.length - 1).map(v => `%${v.toString(16)}`).join(\"\");\r\n const value = decodeURIComponent(str);\r\n\r\n return {\r\n _offset: p, _size: ptr - p, data: Uint8Array.from(bytes), value\r\n };\r\n}\r\n\r\nexport function loadFixedSizeUnicodeStringField(d: FileDataProvider, p: number, sz: number): S.StringField {\r\n const data = d.getData(p, sz);\r\n const arr = new Uint16Array(data.buffer);\r\n const value = String.fromCodePoint.apply(null, arr);\r\n\r\n return {\r\n _offset: p, _size: sz, data, value\r\n };\r\n}\r\n\r\nexport function loadStructArrayByCount<T extends S.FileData>(\r\n d: FileDataProvider,\r\n p: number,\r\n loader: (d: FileDataProvider, p: number) => T,\r\n count: number): S.StructArray<T> {\r\n\r\n let items: T[] = [];\r\n let ptr = p;\r\n for (let i = 0; i < count; i++) {\r\n const s = loader(d, ptr);\r\n items.push(s);\r\n ptr += s._size;\r\n }\r\n\r\n return { _offset: p, _size: ptr - p, items };\r\n}\r\n\r\n//\r\n// Image headers.\r\n//\r\n\r\nexport function loadImageDosHeader(d: FileDataProvider, p: number): S.ImageDosHeader {\r\n let ptr = p;\r\n\r\n const e_magic = loadU2Field(d, ptr);\r\n ptr += e_magic._size;\r\n\r\n const e_cblp = loadU2Field(d, ptr);\r\n ptr += e_cblp._size;\r\n\r\n const e_cp = loadU2Field(d, ptr);\r\n ptr += e_cp._size;\r\n\r\n const e_crlc = loadU2Field(d, ptr);\r\n ptr += e_crlc._size;\r\n\r\n const e_cparhdr = loadU2Field(d, ptr);\r\n ptr += e_cparhdr._size;\r\n\r\n const e_minalloc = loadU2Field(d, ptr);\r\n ptr += e_minalloc._size;\r\n\r\n const e_maxalloc = loadU2Field(d, ptr);\r\n ptr += e_maxalloc._size;\r\n\r\n const e_ss = loadU2Field(d, ptr);\r\n ptr += e_ss._size;\r\n\r\n const e_sp = loadU2Field(d, ptr);\r\n ptr += e_sp._size;\r\n\r\n const e_csum = loadU2Field(d, ptr);\r\n ptr += e_csum._size;\r\n\r\n const e_ip = loadU2Field(d, ptr);\r\n ptr += e_ip._size;\r\n\r\n const e_cs = loadU2Field(d, ptr);\r\n ptr += e_cs._size;\r\n\r\n const e_lfarlc = loadU2Field(d, ptr);\r\n ptr += e_lfarlc._size;\r\n\r\n const e_ovno = loadU2Field(d, ptr);\r\n ptr += e_ovno._size;\r\n\r\n const e_res = loadFixedSizeByteArrayField(d, ptr, 4 * 2);\r\n ptr += e_res._size;\r\n\r\n const e_oemid = loadU2Field(d, ptr);\r\n ptr += e_oemid._size;\r\n\r\n const e_oeminfo = loadU2Field(d, ptr);\r\n ptr += e_oeminfo._size;\r\n\r\n const e_res2 = loadFixedSizeByteArrayField(d, ptr, 10 * 2);\r\n ptr += e_res2._size;\r\n\r\n const e_lfanew = loadU4Field(d, ptr);\r\n ptr += e_lfanew._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n e_magic,\r\n e_cblp,\r\n e_cp,\r\n e_crlc,\r\n e_cparhdr,\r\n e_minalloc,\r\n e_maxalloc,\r\n e_ss,\r\n e_sp,\r\n e_csum,\r\n e_ip,\r\n e_cs,\r\n e_lfarlc,\r\n e_ovno,\r\n e_res,\r\n e_oemid,\r\n e_oeminfo,\r\n e_res2,\r\n e_lfanew,\r\n };\r\n}\r\n\r\nexport function loadImageFileHeader(d: FileDataProvider, p: number): S.ImageFileHeader {\r\n let ptr = p;\r\n\r\n const Machine = loadU2Field(d, ptr);\r\n ptr += Machine._size;\r\n\r\n const NumberOfSections = loadU2Field(d, ptr);\r\n ptr += NumberOfSections._size;\r\n\r\n const TimeDateStamp = loadU4Field(d, ptr);\r\n ptr += TimeDateStamp._size;\r\n\r\n const PointerToSymbolTable = loadU4Field(d, ptr);\r\n ptr += PointerToSymbolTable._size;\r\n\r\n const NumberOfSymbols = loadU4Field(d, ptr);\r\n ptr += NumberOfSymbols._size;\r\n\r\n const SizeOfOptionalHeader = loadU2Field(d, ptr);\r\n ptr += SizeOfOptionalHeader._size;\r\n\r\n const Characteristics = loadU2EnumField<F.ImageFile>(d, ptr);\r\n ptr += Characteristics._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Machine,\r\n NumberOfSections,\r\n TimeDateStamp,\r\n PointerToSymbolTable,\r\n NumberOfSymbols,\r\n SizeOfOptionalHeader,\r\n Characteristics,\r\n };\r\n}\r\n\r\nexport function loadImageOptionalHeader32(d: FileDataProvider, p: number): S.ImageOptionalHeader32 {\r\n let ptr = p;\r\n\r\n const Magic = loadU2Field(d, ptr);\r\n ptr += Magic._size;\r\n\r\n const MajorLinkerVersion = loadU1Field(d, ptr);\r\n ptr += MajorLinkerVersion._size;\r\n\r\n const MinorLinkerVersion = loadU1Field(d, ptr);\r\n ptr += MinorLinkerVersion._size;\r\n\r\n const SizeOfCode = loadU4Field(d, ptr);\r\n ptr += SizeOfCode._size;\r\n\r\n const SizeOfInitializedData = loadU4Field(d, ptr);\r\n ptr += SizeOfInitializedData._size;\r\n\r\n const SizeOfUninitializedData = loadU4Field(d, ptr);\r\n ptr += SizeOfUninitializedData._size;\r\n\r\n const AddressOfEntryPoint = loadU4Field(d, ptr);\r\n ptr += AddressOfEntryPoint._size;\r\n\r\n const BaseOfCode = loadU4Field(d, ptr);\r\n ptr += BaseOfCode._size;\r\n\r\n const BaseOfData = loadU4Field(d, ptr);\r\n ptr += BaseOfData._size;\r\n\r\n const ImageBase = loadU4Field(d, ptr);\r\n ptr += ImageBase._size;\r\n\r\n const SectionAlignment = loadU4Field(d, ptr);\r\n ptr += SectionAlignment._size;\r\n\r\n const FileAlignment = loadU4Field(d, ptr);\r\n ptr += FileAlignment._size;\r\n\r\n const MajorOperatingSystemVersion = loadU2Field(d, ptr);\r\n ptr += MajorOperatingSystemVersion._size;\r\n\r\n const MinorOperatingSystemVersion = loadU2Field(d, ptr);\r\n ptr += MinorOperatingSystemVersion._size;\r\n\r\n const MajorImageVersion = loadU2Field(d, ptr);\r\n ptr += MajorImageVersion._size;\r\n\r\n const MinorImageVersion = loadU2Field(d, ptr);\r\n ptr += MinorImageVersion._size;\r\n\r\n const MajorSubsystemVersion = loadU2Field(d, ptr);\r\n ptr += MajorSubsystemVersion._size;\r\n\r\n const MinorSubsystemVersion = loadU2Field(d, ptr);\r\n ptr += MinorSubsystemVersion._size;\r\n\r\n const Win32VersionValue = loadU4Field(d, ptr);\r\n ptr += Win32VersionValue._size;\r\n\r\n const SizeOfImage = loadU4Field(d, ptr);\r\n ptr += SizeOfImage._size;\r\n\r\n const SizeOfHeaders = loadU4Field(d, ptr);\r\n ptr += SizeOfHeaders._size;\r\n\r\n const CheckSum = loadU4Field(d, ptr);\r\n ptr += CheckSum._size;\r\n\r\n const Subsystem = loadU2EnumField<F.ImageSubsystem>(d, ptr);\r\n ptr += Subsystem._size;\r\n\r\n const DllCharacteristics = loadU2EnumField<F.ImageDllCharacteristics>(d, ptr);\r\n ptr += DllCharacteristics._size;\r\n\r\n const SizeOfStackReserve = loadU4Field(d, ptr);\r\n ptr += SizeOfStackReserve._size;\r\n\r\n const SizeOfStackCommit = loadU4Field(d, ptr);\r\n ptr += SizeOfStackCommit._size;\r\n\r\n const SizeOfHeapReserve = loadU4Field(d, ptr);\r\n ptr += SizeOfHeapReserve._size;\r\n\r\n const SizeOfHeapCommit = loadU4Field(d, ptr);\r\n ptr += SizeOfHeapCommit._size;\r\n\r\n const LoaderFlags = loadU4Field(d, ptr);\r\n ptr += LoaderFlags._size;\r\n\r\n const NumberOfRvaAndSizes = loadU4Field(d, ptr);\r\n ptr += NumberOfRvaAndSizes._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Magic,\r\n MajorLinkerVersion,\r\n MinorLinkerVersion,\r\n SizeOfCode,\r\n SizeOfInitializedData,\r\n SizeOfUninitializedData,\r\n AddressOfEntryPoint,\r\n BaseOfCode,\r\n BaseOfData,\r\n ImageBase,\r\n SectionAlignment,\r\n FileAlignment,\r\n MajorOperatingSystemVersion,\r\n MinorOperatingSystemVersion,\r\n MajorImageVersion,\r\n MinorImageVersion,\r\n MajorSubsystemVersion,\r\n MinorSubsystemVersion,\r\n Win32VersionValue,\r\n SizeOfImage,\r\n SizeOfHeaders,\r\n CheckSum,\r\n Subsystem,\r\n DllCharacteristics,\r\n SizeOfStackReserve,\r\n SizeOfStackCommit,\r\n SizeOfHeapReserve,\r\n SizeOfHeapCommit,\r\n LoaderFlags,\r\n NumberOfRvaAndSizes,\r\n };\r\n}\r\n\r\nexport function loadImageOptionalHeader64(d: FileDataProvider, p: number): S.ImageOptionalHeader64 {\r\n let ptr = p;\r\n\r\n const Magic = loadU2Field(d, ptr);\r\n ptr += Magic._size;\r\n\r\n const MajorLinkerVersion = loadU1Field(d, ptr);\r\n ptr += MajorLinkerVersion._size;\r\n\r\n const MinorLinkerVersion = loadU1Field(d, ptr);\r\n ptr += MinorLinkerVersion._size;\r\n\r\n const SizeOfCode = loadU4Field(d, ptr);\r\n ptr += SizeOfCode._size;\r\n\r\n const SizeOfInitializedData = loadU4Field(d, ptr);\r\n ptr += SizeOfInitializedData._size;\r\n\r\n const SizeOfUninitializedData = loadU4Field(d, ptr);\r\n ptr += SizeOfUninitializedData._size;\r\n\r\n const AddressOfEntryPoint = loadU4Field(d, ptr);\r\n ptr += AddressOfEntryPoint._size;\r\n\r\n const BaseOfCode = loadU4Field(d, ptr);\r\n ptr += BaseOfCode._size;\r\n\r\n const ImageBase = loadU8Field(d, ptr);\r\n ptr += ImageBase._size;\r\n\r\n const SectionAlignment = loadU4Field(d, ptr);\r\n ptr += SectionAlignment._size;\r\n\r\n const FileAlignment = loadU4Field(d, ptr);\r\n ptr += FileAlignment._size;\r\n\r\n const MajorOperatingSystemVersion = loadU2Field(d, ptr);\r\n ptr += MajorOperatingSystemVersion._size;\r\n\r\n const MinorOperatingSystemVersion = loadU2Field(d, ptr);\r\n ptr += MinorOperatingSystemVersion._size;\r\n\r\n const MajorImageVersion = loadU2Field(d, ptr);\r\n ptr += MajorImageVersion._size;\r\n\r\n const MinorImageVersion = loadU2Field(d, ptr);\r\n ptr += MinorImageVersion._size;\r\n\r\n const MajorSubsystemVersion = loadU2Field(d, ptr);\r\n ptr += MajorSubsystemVersion._size;\r\n\r\n const MinorSubsystemVersion = loadU2Field(d, ptr);\r\n ptr += MinorSubsystemVersion._size;\r\n\r\n const Win32VersionValue = loadU4Field(d, ptr);\r\n ptr += Win32VersionValue._size;\r\n\r\n const SizeOfImage = loadU4Field(d, ptr);\r\n ptr += SizeOfImage._size;\r\n\r\n const SizeOfHeaders = loadU4Field(d, ptr);\r\n ptr += SizeOfHeaders._size;\r\n\r\n const CheckSum = loadU4Field(d, ptr);\r\n ptr += CheckSum._size;\r\n\r\n const Subsystem = loadU2EnumField<F.ImageSubsystem>(d, ptr);\r\n ptr += Subsystem._size;\r\n\r\n const DllCharacteristics = loadU2EnumField<F.ImageDllCharacteristics>(d, ptr);\r\n ptr += DllCharacteristics._size;\r\n\r\n const SizeOfStackReserve = loadU8Field(d, ptr);\r\n ptr += SizeOfStackReserve._size;\r\n\r\n const SizeOfStackCommit = loadU8Field(d, ptr);\r\n ptr += SizeOfStackCommit._size;\r\n\r\n const SizeOfHeapReserve = loadU8Field(d, ptr);\r\n ptr += SizeOfHeapReserve._size;\r\n\r\n const SizeOfHeapCommit = loadU8Field(d, ptr);\r\n ptr += SizeOfHeapCommit._size;\r\n\r\n const LoaderFlags = loadU4Field(d, ptr);\r\n ptr += LoaderFlags._size;\r\n\r\n const NumberOfRvaAndSizes = loadU4Field(d, ptr);\r\n ptr += NumberOfRvaAndSizes._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Magic,\r\n MajorLinkerVersion,\r\n MinorLinkerVersion,\r\n SizeOfCode,\r\n SizeOfInitializedData,\r\n SizeOfUninitializedData,\r\n AddressOfEntryPoint,\r\n BaseOfCode,\r\n ImageBase,\r\n SectionAlignment,\r\n FileAlignment,\r\n MajorOperatingSystemVersion,\r\n MinorOperatingSystemVersion,\r\n MajorImageVersion,\r\n MinorImageVersion,\r\n MajorSubsystemVersion,\r\n MinorSubsystemVersion,\r\n Win32VersionValue,\r\n SizeOfImage,\r\n SizeOfHeaders,\r\n CheckSum,\r\n Subsystem,\r\n DllCharacteristics,\r\n SizeOfStackReserve,\r\n SizeOfStackCommit,\r\n SizeOfHeapReserve,\r\n SizeOfHeapCommit,\r\n LoaderFlags,\r\n NumberOfRvaAndSizes,\r\n };\r\n}\r\n\r\nexport function loadImageDataDirectory(d: FileDataProvider, p: number): S.ImageDataDirectory {\r\n let ptr = p;\r\n\r\n const VirtualAddress = loadU4Field(d, ptr);\r\n ptr += VirtualAddress._size;\r\n\r\n const Size = loadU4Field(d, ptr);\r\n ptr += Size._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n VirtualAddress,\r\n Size,\r\n };\r\n}\r\n\r\nexport function loadImageSectionHeader(d: FileDataProvider, p: number): S.ImageSectionHeader {\r\n let ptr = p;\r\n\r\n const Name = loadFixedSizeAsciiStringField(d, ptr, 8);\r\n ptr += Name._size;\r\n\r\n const VirtualSize = loadU4Field(d, ptr);\r\n ptr += VirtualSize._size;\r\n\r\n const VirtualAddress = loadU4Field(d, ptr);\r\n ptr += VirtualAddress._size;\r\n\r\n const SizeOfRawData = loadU4Field(d, ptr);\r\n ptr += SizeOfRawData._size;\r\n\r\n const PointerToRawData = loadU4Field(d, ptr);\r\n ptr += PointerToRawData._size;\r\n\r\n const PointerToRelocations = loadU4Field(d, ptr);\r\n ptr += PointerToRelocations._size;\r\n\r\n const PointerToLinenumbers = loadU4Field(d, ptr);\r\n ptr += PointerToLinenumbers._size;\r\n\r\n const NumberOfRelocations = loadU2Field(d, ptr);\r\n ptr += NumberOfRelocations._size;\r\n\r\n const NumberOfLinenumbers = loadU2Field(d, ptr);\r\n ptr += NumberOfLinenumbers._size;\r\n\r\n const Characteristics = loadU4EnumField<F.ImageSection>(d, ptr);\r\n ptr += Characteristics._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Name,\r\n VirtualSize,\r\n VirtualAddress,\r\n SizeOfRawData,\r\n PointerToRawData,\r\n PointerToRelocations,\r\n PointerToLinenumbers,\r\n NumberOfRelocations,\r\n NumberOfLinenumbers,\r\n Characteristics,\r\n };\r\n}\r\n\r\n//\r\n// Metadata structures.\r\n//\r\n\r\nexport function loadCliHeader(d: FileDataProvider, p: number): S.CliHeader {\r\n let ptr = p;\r\n\r\n const cb = loadU4Field(d, ptr);\r\n ptr += cb._size;\r\n\r\n const MajorRuntimeVersion = loadU2Field(d, ptr);\r\n ptr += MajorRuntimeVersion._size;\r\n\r\n const MinorRuntimeVersion = loadU2Field(d, ptr);\r\n ptr += MinorRuntimeVersion._size;\r\n\r\n const MetaData = loadImageDataDirectory(d, ptr);\r\n ptr += MetaData._size;\r\n\r\n const Flags = loadU4Field(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const EntryPointToken = loadU4Field(d, ptr);\r\n ptr += EntryPointToken._size;\r\n\r\n const Resources = loadImageDataDirectory(d, ptr);\r\n ptr += Resources._size;\r\n\r\n const StrongNameSignature = loadImageDataDirectory(d, ptr);\r\n ptr += StrongNameSignature._size;\r\n\r\n const CodeManagerTable = loadImageDataDirectory(d, ptr);\r\n ptr += CodeManagerTable._size;\r\n\r\n const VTableFixups = loadImageDataDirectory(d, ptr);\r\n ptr += VTableFixups._size;\r\n\r\n const ExportAddressTableJumps = loadImageDataDirectory(d, ptr);\r\n ptr += ExportAddressTableJumps._size;\r\n\r\n const ManagedNativeHeader = loadImageDataDirectory(d, ptr);\r\n ptr += ManagedNativeHeader._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n cb,\r\n MajorRuntimeVersion,\r\n MinorRuntimeVersion,\r\n MetaData,\r\n Flags,\r\n EntryPointToken,\r\n Resources,\r\n StrongNameSignature,\r\n CodeManagerTable,\r\n VTableFixups,\r\n ExportAddressTableJumps,\r\n ManagedNativeHeader,\r\n };\r\n}\r\n\r\nexport function loadMetadataRoot(d: FileDataProvider, p: number): S.MetadataRoot {\r\n let ptr = p;\r\n\r\n const Signature = loadU4Field(d, ptr);\r\n ptr += Signature._size;\r\n\r\n const MajorVersion = loadU2Field(d, ptr);\r\n ptr += MajorVersion._size;\r\n\r\n const MinorVersion = loadU2Field(d, ptr);\r\n ptr += MinorVersion._size;\r\n\r\n const Reserved = loadU4Field(d, ptr);\r\n ptr += Reserved._size;\r\n\r\n const VersionLength = loadU4Field(d, ptr);\r\n ptr += VersionLength._size;\r\n\r\n const VersionString = loadNullTerminatedStringField(d, ptr);\r\n ptr += VersionString._size;\r\n\r\n const paddingSize = U.calculatePadding(VersionString._size);\r\n const VersionPadding = loadFixedSizeByteArrayField(d, ptr, paddingSize);\r\n ptr += VersionPadding._size;\r\n\r\n const Flags = loadU2Field(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const Streams = loadU2Field(d, ptr);\r\n ptr += Streams._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Signature,\r\n MajorVersion,\r\n MinorVersion,\r\n Reserved,\r\n VersionLength,\r\n VersionString,\r\n VersionPadding,\r\n Flags,\r\n Streams,\r\n };\r\n}\r\n\r\nexport function loadMetadataStreamHeader(d: FileDataProvider, p: number): S.MetadataStreamHeader {\r\n let ptr = p;\r\n\r\n const Offset = loadU4Field(d, ptr);\r\n ptr += Offset._size;\r\n\r\n const Size = loadU4Field(d, ptr);\r\n ptr += Size._size;\r\n\r\n const Name = loadNullTerminatedStringField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const paddingSize = U.calculatePadding(Name._size);\r\n const Padding = loadFixedSizeByteArrayField(d, ptr, paddingSize);\r\n ptr += Padding._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Offset,\r\n Size,\r\n Name,\r\n Padding,\r\n };\r\n}\r\n\r\nexport function loadMetadataTableHeader(d: FileDataProvider, p: number): S.MetadataTableHeader {\r\n let ptr = p;\r\n\r\n const Reserved = loadU4Field(d, ptr);\r\n ptr += Reserved._size;\r\n\r\n const MajorVersion = loadU1Field(d, ptr);\r\n ptr += MajorVersion._size;\r\n\r\n const MinorVersion = loadU1Field(d, ptr);\r\n ptr += MinorVersion._size;\r\n\r\n const HeapSizes = loadU1Field(d, ptr);\r\n ptr += HeapSizes._size;\r\n\r\n const Reserved2 = loadU1Field(d, ptr);\r\n ptr += Reserved2._size;\r\n\r\n const Valid = loadU8Field(d, ptr);\r\n ptr += Valid._size;\r\n\r\n const Sorted = loadU8Field(d, ptr);\r\n ptr += Sorted._size;\r\n\r\n const tables = U.count1(Valid.high) + U.count1(Valid.low);\r\n const Rows = loadStructArrayByCount(d, ptr, loadU4Field, tables);\r\n ptr += Rows._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Reserved,\r\n MajorVersion,\r\n MinorVersion,\r\n HeapSizes,\r\n Reserved2,\r\n Valid,\r\n Sorted,\r\n Rows,\r\n };\r\n}\r\n\r\nexport function loadMetadataUSItem(d: FileDataProvider, p: number): S.MetadataUSItem {\r\n let ptr = p;\r\n\r\n const Size = loadCompressedUIntField(d, ptr);\r\n ptr += Size._size;\r\n\r\n const sz = Size.value;\r\n const strSize = sz > 0 ? sz - 1 : 0;\r\n const suffixSize = sz > 0 ? 1 : 0;\r\n\r\n const Value = loadFixedSizeUnicodeStringField(d, ptr, strSize);\r\n ptr += Value._size;\r\n\r\n const Suffix = loadFixedSizeByteArrayField(d, ptr, suffixSize);\r\n ptr += Suffix._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Size,\r\n Value,\r\n Suffix,\r\n };\r\n}\r\n\r\nexport function loadMetadataBlobItem(d: FileDataProvider, p: number): S.MetadataBlobItem {\r\n let ptr = p;\r\n\r\n const Size = loadCompressedUIntField(d, ptr);\r\n ptr += Size._size;\r\n\r\n const Value = loadFixedSizeByteArrayField(d, ptr, Size.value);\r\n ptr += Value._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Size,\r\n Value,\r\n };\r\n}\r\n\r\nexport function loadMdsStringsField(\r\n d: FileDataProvider & MetadataSizingProvider,\r\n p: number): S.MdsStringsField {\r\n\r\n return d.getHeapSize(F.MetadataHeapSizeID.String) == 4\r\n ? loadU4Field(d, p) : loadU2Field(d, p);\r\n}\r\n\r\nexport function loadMdsGuidField(\r\n d: FileDataProvider & MetadataSizingProvider,\r\n p: number): S.MdsGuidField {\r\n\r\n return d.getHeapSize(F.MetadataHeapSizeID.GUID) == 4\r\n ? loadU4Field(d, p) : loadU2Field(d, p);\r\n}\r\n\r\nexport function loadMdsBlobField(\r\n d: FileDataProvider & MetadataSizingProvider,\r\n p: number): S.MdsBlobField {\r\n\r\n return d.getHeapSize(F.MetadataHeapSizeID.Blob) == 4\r\n ? loadU4Field(d, p) : loadU2Field(d, p);\r\n}\r\n\r\nexport function loadMdtRidField(\r\n d: FileDataProvider & MetadataSizingProvider,\r\n t: F.MetadataTableIndex, p: number): S.MdtRidField {\r\n\r\n return d.getTableIDSize(t) == 4\r\n ? loadU4Field(d, p) : loadU2Field(d, p);\r\n}\r\n\r\nexport function loadMdCodedTokenField(\r\n d: FileDataProvider & MetadataSizingProvider,\r\n t: F.MetadataCodedTokenIndex, p: number): S.MdCodedTokenField {\r\n\r\n const baseField = d.getCodedTokenSize(t) == 4\r\n ? loadU4Field(d, p) : loadU2Field(d, p);\r\n const codedTokenInfo = decodeCodedToken(baseField.value, t);\r\n\r\n return {\r\n ...baseField, ...codedTokenInfo\r\n };\r\n}\r\n\r\nexport function loadMdTokenField(d: FileDataProvider, p: number): S.MdTokenField {\r\n const baseField = loadU4Field(d, p);\r\n const tid: F.MetadataTableIndex = (baseField.value & 0xFF000000) >> 24;\r\n const rid = baseField.value & 0x00FFFFFF;\r\n return {\r\n ...baseField, tid, rid\r\n };\r\n}\r\n\r\nexport function decodeCodedToken(token: number, t: F.MetadataCodedTokenIndex): { tid: F.MetadataTableIndex, rid: number } {\r\n const cti = F.ctc[t];\r\n const tid = cti.tables[token & ((1 << cti.tagSize) - 1)];\r\n const rid = token >> cti.tagSize;\r\n return { tid, rid };\r\n}\r\n\r\n//\r\n// Metadata tables.\r\n//\r\n\r\nexport function loadMdtModule(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtModuleItem {\r\n let ptr = p;\r\n\r\n const Generation = loadU2Field(d, ptr);\r\n ptr += Generation._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Mvid = loadMdsGuidField(d, ptr);\r\n ptr += Mvid._size;\r\n\r\n const EncId = loadMdsGuidField(d, ptr);\r\n ptr += EncId._size;\r\n\r\n const EncBaseId = loadMdsGuidField(d, ptr);\r\n ptr += EncBaseId._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Generation,\r\n Name,\r\n Mvid,\r\n EncId,\r\n EncBaseId,\r\n };\r\n}\r\n\r\nexport function loadMdtTypeRef(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtTypeRefItem {\r\n let ptr = p;\r\n\r\n const ResolutionScope = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.ResolutionScope, ptr);\r\n ptr += ResolutionScope._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Namespace = loadMdsStringsField(d, ptr);\r\n ptr += Namespace._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n ResolutionScope,\r\n Name,\r\n Namespace,\r\n };\r\n}\r\n\r\nexport function loadMdtTypeDef(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtTypeDefItem {\r\n let ptr = p;\r\n\r\n const Flags = loadU4EnumField<F.CorTypeAttr>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Namespace = loadMdsStringsField(d, ptr);\r\n ptr += Namespace._size;\r\n\r\n const Extends = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.TypeDefOrRef, ptr);\r\n ptr += Extends._size;\r\n\r\n const FieldList = loadMdtRidField(d, F.MetadataTableIndex.Field, ptr);\r\n ptr += FieldList._size;\r\n\r\n const MethodList = loadMdtRidField(d, F.MetadataTableIndex.MethodDef, ptr);\r\n ptr += MethodList._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Flags,\r\n Name,\r\n Namespace,\r\n Extends,\r\n FieldList,\r\n MethodList,\r\n };\r\n}\r\n\r\nexport function loadMdtFieldPtr(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtFieldPtrItem {\r\n let ptr = p;\r\n\r\n const Field = loadMdtRidField(d, F.MetadataTableIndex.Field, ptr);\r\n ptr += Field._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Field,\r\n };\r\n}\r\n\r\nexport function loadMdtField(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtFieldItem {\r\n let ptr = p;\r\n\r\n const Flags = loadU2EnumField<F.CorFieldAttr>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Signature = loadMdsBlobField(d, ptr);\r\n ptr += Signature._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Flags,\r\n Name,\r\n Signature,\r\n };\r\n}\r\n\r\nexport function loadMdtMethodPtr(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtMethodPtrItem {\r\n let ptr = p;\r\n\r\n const Method = loadMdtRidField(d, F.MetadataTableIndex.MethodDef, ptr);\r\n ptr += Method._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Method,\r\n };\r\n}\r\n\r\nexport function loadMdtMethodDef(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtMethodDefItem {\r\n let ptr = p;\r\n\r\n const RVA = loadU4Field(d, ptr);\r\n ptr += RVA._size;\r\n\r\n const ImplFlags = loadU2EnumField<F.CorMethodImpl>(d, ptr);\r\n ptr += ImplFlags._size;\r\n\r\n const Flags = loadU2EnumField<F.CorMethodAttr>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Signature = loadMdsBlobField(d, ptr);\r\n ptr += Signature._size;\r\n\r\n const ParamList = loadMdtRidField(d, F.MetadataTableIndex.Param, ptr);\r\n ptr += ParamList._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n RVA,\r\n ImplFlags,\r\n Flags,\r\n Name,\r\n Signature,\r\n ParamList,\r\n };\r\n}\r\n\r\nexport function loadMdtParamPtr(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtParamPtrItem {\r\n let ptr = p;\r\n\r\n const Param = loadMdtRidField(d, F.MetadataTableIndex.Param, ptr);\r\n ptr += Param._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Param,\r\n };\r\n}\r\n\r\nexport function loadMdtParam(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtParamItem {\r\n let ptr = p;\r\n\r\n const Flags = loadU2EnumField<F.CorParamAttr>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const Sequence = loadU2Field(d, ptr);\r\n ptr += Sequence._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Flags,\r\n Sequence,\r\n Name,\r\n };\r\n}\r\n\r\nexport function loadMdtInterfaceImpl(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtInterfaceImplItem {\r\n let ptr = p;\r\n\r\n const Class = loadMdtRidField(d, F.MetadataTableIndex.TypeDef, ptr);\r\n ptr += Class._size;\r\n\r\n const Interface = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.TypeDefOrRef, ptr);\r\n ptr += Interface._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Class,\r\n Interface,\r\n };\r\n}\r\n\r\nexport function loadMdtMemberRef(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtMemberRefItem {\r\n let ptr = p;\r\n\r\n const Class = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.MemberRefParent, ptr);\r\n ptr += Class._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Signature = loadMdsBlobField(d, ptr);\r\n ptr += Signature._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Class,\r\n Name,\r\n Signature,\r\n };\r\n}\r\n\r\nexport function loadMdtConstant(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtConstantItem {\r\n let ptr = p;\r\n\r\n const Type = loadU1EnumField<F.CorElementType>(d, ptr);\r\n ptr += Type._size;\r\n\r\n const PaddingZero = loadU1Field(d, ptr);\r\n ptr += PaddingZero._size;\r\n\r\n const Parent = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.HasConstant, ptr);\r\n ptr += Parent._size;\r\n\r\n const Value = loadMdsBlobField(d, ptr);\r\n ptr += Value._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Type,\r\n PaddingZero,\r\n Parent,\r\n Value,\r\n };\r\n}\r\n\r\nexport function loadMdtCustomAttribute(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtCustomAttributeItem {\r\n let ptr = p;\r\n\r\n const Parent = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.HasCustomAttribute, ptr);\r\n ptr += Parent._size;\r\n\r\n const Type = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.CustomAttributeType, ptr);\r\n ptr += Type._size;\r\n\r\n const Value = loadMdsBlobField(d, ptr);\r\n ptr += Value._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Parent,\r\n Type,\r\n Value,\r\n };\r\n}\r\n\r\nexport function loadMdtFieldMarshal(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtFieldMarshalItem {\r\n let ptr = p;\r\n\r\n const Parent = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.HasFieldMarshall, ptr);\r\n ptr += Parent._size;\r\n\r\n const NativeType = loadMdsBlobField(d, ptr);\r\n ptr += NativeType._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Parent,\r\n NativeType,\r\n };\r\n}\r\n\r\nexport function loadMdtDeclSecurity(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtDeclSecurityItem {\r\n let ptr = p;\r\n\r\n const Action = loadU2EnumField<F.CorDeclSecurity>(d, ptr);\r\n ptr += Action._size;\r\n\r\n const Parent = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.HasDeclSecurity, ptr);\r\n ptr += Parent._size;\r\n\r\n const PermissionSet = loadMdsBlobField(d, ptr);\r\n ptr += PermissionSet._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Action,\r\n Parent,\r\n PermissionSet,\r\n };\r\n}\r\n\r\nexport function loadMdtClassLayout(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtClassLayoutItem {\r\n let ptr = p;\r\n\r\n const PackingSize = loadU2Field(d, ptr);\r\n ptr += PackingSize._size;\r\n\r\n const ClassSize = loadU4Field(d, ptr);\r\n ptr += ClassSize._size;\r\n\r\n const Parent = loadMdtRidField(d, F.MetadataTableIndex.TypeDef, ptr);\r\n ptr += Parent._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n PackingSize,\r\n ClassSize,\r\n Parent,\r\n };\r\n}\r\n\r\nexport function loadMdtFieldLayout(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtFieldLayoutItem {\r\n let ptr = p;\r\n\r\n const OffSet = loadU4Field(d, ptr);\r\n ptr += OffSet._size;\r\n\r\n const Field = loadMdtRidField(d, F.MetadataTableIndex.Field, ptr);\r\n ptr += Field._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n OffSet,\r\n Field,\r\n };\r\n}\r\n\r\nexport function loadMdtStandAloneSig(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtStandAloneSigItem {\r\n let ptr = p;\r\n\r\n const Signature = loadMdsBlobField(d, ptr);\r\n ptr += Signature._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Signature,\r\n };\r\n}\r\n\r\nexport function loadMdtEventMap(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtEventMapItem {\r\n let ptr = p;\r\n\r\n const Parent = loadMdtRidField(d, F.MetadataTableIndex.TypeDef, ptr);\r\n ptr += Parent._size;\r\n\r\n const EventList = loadMdtRidField(d, F.MetadataTableIndex.Event, ptr);\r\n ptr += EventList._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Parent,\r\n EventList,\r\n };\r\n}\r\n\r\nexport function loadMdtEventPtr(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtEventPtrItem {\r\n let ptr = p;\r\n\r\n const Event = loadMdtRidField(d, F.MetadataTableIndex.Event, ptr);\r\n ptr += Event._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Event,\r\n };\r\n}\r\n\r\nexport function loadMdtEvent(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtEventItem {\r\n let ptr = p;\r\n\r\n const EventFlags = loadU2EnumField<F.CorEventAttr>(d, ptr);\r\n ptr += EventFlags._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const EventType = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.TypeDefOrRef, ptr);\r\n ptr += EventType._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n EventFlags,\r\n Name,\r\n EventType,\r\n };\r\n}\r\n\r\nexport function loadMdtPropertyMap(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtPropertyMapItem {\r\n let ptr = p;\r\n\r\n const Parent = loadMdtRidField(d, F.MetadataTableIndex.TypeDef, ptr);\r\n ptr += Parent._size;\r\n\r\n const PropertyList = loadMdtRidField(d, F.MetadataTableIndex.Property, ptr);\r\n ptr += PropertyList._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Parent,\r\n PropertyList,\r\n };\r\n}\r\n\r\nexport function loadMdtPropertyPtr(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtPropertyPtrItem {\r\n let ptr = p;\r\n\r\n const Property = loadMdtRidField(d, F.MetadataTableIndex.Property, ptr);\r\n ptr += Property._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Property,\r\n };\r\n}\r\n\r\nexport function loadMdtProperty(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtPropertyItem {\r\n let ptr = p;\r\n\r\n const PropFlags = loadU2EnumField<F.CorPropertyAttr>(d, ptr);\r\n ptr += PropFlags._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Type = loadMdsBlobField(d, ptr);\r\n ptr += Type._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n PropFlags,\r\n Name,\r\n Type,\r\n };\r\n}\r\n\r\nexport function loadMdtMethodSemantics(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtMethodSemanticsItem {\r\n let ptr = p;\r\n\r\n const Semantic = loadU2EnumField<F.CorMethodSemanticsAttr>(d, ptr);\r\n ptr += Semantic._size;\r\n\r\n const Method = loadMdtRidField(d, F.MetadataTableIndex.MethodDef, ptr);\r\n ptr += Method._size;\r\n\r\n const Association = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.HasSemantics, ptr);\r\n ptr += Association._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Semantic,\r\n Method,\r\n Association,\r\n };\r\n}\r\n\r\nexport function loadMdtMethodImpl(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtMethodImplItem {\r\n let ptr = p;\r\n\r\n const Class = loadMdtRidField(d, F.MetadataTableIndex.TypeDef, ptr);\r\n ptr += Class._size;\r\n\r\n const MethodBody = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.MethodDefOrRef, ptr);\r\n ptr += MethodBody._size;\r\n\r\n const MethodDeclaration = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.MethodDefOrRef, ptr);\r\n ptr += MethodDeclaration._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Class,\r\n MethodBody,\r\n MethodDeclaration,\r\n };\r\n}\r\n\r\nexport function loadMdtModuleRef(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtModuleRefItem {\r\n let ptr = p;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Name,\r\n };\r\n}\r\n\r\nexport function loadMdtTypeSpec(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtTypeSpecItem {\r\n let ptr = p;\r\n\r\n const Signature = loadMdsBlobField(d, ptr);\r\n ptr += Signature._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Signature,\r\n };\r\n}\r\n\r\nexport function loadMdtImplMap(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtImplMapItem {\r\n let ptr = p;\r\n\r\n const MappingFlags = loadU2EnumField<F.CorPinvokeMap>(d, ptr);\r\n ptr += MappingFlags._size;\r\n\r\n const MemberForwarded = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.MemberForwarded, ptr);\r\n ptr += MemberForwarded._size;\r\n\r\n const ImportName = loadMdsStringsField(d, ptr);\r\n ptr += ImportName._size;\r\n\r\n const ImportScope = loadMdtRidField(d, F.MetadataTableIndex.ModuleRef, ptr);\r\n ptr += ImportScope._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n MappingFlags,\r\n MemberForwarded,\r\n ImportName,\r\n ImportScope,\r\n };\r\n}\r\n\r\nexport function loadMdtFieldRVA(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtFieldRVAItem {\r\n let ptr = p;\r\n\r\n const RVA = loadU4Field(d, ptr);\r\n ptr += RVA._size;\r\n\r\n const Field = loadMdtRidField(d, F.MetadataTableIndex.Field, ptr);\r\n ptr += Field._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n RVA,\r\n Field,\r\n };\r\n}\r\n\r\nexport function loadMdtENCLog(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtENCLogItem {\r\n let ptr = p;\r\n\r\n const Token = loadU4Field(d, ptr);\r\n ptr += Token._size;\r\n\r\n const FuncCode = loadU4Field(d, ptr);\r\n ptr += FuncCode._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Token,\r\n FuncCode,\r\n };\r\n}\r\n\r\nexport function loadMdtENCMap(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtENCMapItem {\r\n let ptr = p;\r\n\r\n const Token = loadU4Field(d, ptr);\r\n ptr += Token._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Token,\r\n };\r\n}\r\n\r\nexport function loadMdtAssembly(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtAssemblyItem {\r\n let ptr = p;\r\n\r\n const HashAlgId = loadU4EnumField<F.AssemblyHashAlgorithm>(d, ptr);\r\n ptr += HashAlgId._size;\r\n\r\n const MajorVersion = loadU2Field(d, ptr);\r\n ptr += MajorVersion._size;\r\n\r\n const MinorVersion = loadU2Field(d, ptr);\r\n ptr += MinorVersion._size;\r\n\r\n const BuildNumber = loadU2Field(d, ptr);\r\n ptr += BuildNumber._size;\r\n\r\n const RevisionNumber = loadU2Field(d, ptr);\r\n ptr += RevisionNumber._size;\r\n\r\n const Flags = loadU4EnumField<F.CorAssemblyFlags>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const PublicKey = loadMdsBlobField(d, ptr);\r\n ptr += PublicKey._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Locale = loadMdsStringsField(d, ptr);\r\n ptr += Locale._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n HashAlgId,\r\n MajorVersion,\r\n MinorVersion,\r\n BuildNumber,\r\n RevisionNumber,\r\n Flags,\r\n PublicKey,\r\n Name,\r\n Locale,\r\n };\r\n}\r\n\r\nexport function loadMdtAssemblyProcessor(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtAssemblyProcessorItem {\r\n let ptr = p;\r\n\r\n const Processor = loadU4Field(d, ptr);\r\n ptr += Processor._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Processor,\r\n };\r\n}\r\n\r\nexport function loadMdtAssemblyOS(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtAssemblyOSItem {\r\n let ptr = p;\r\n\r\n const OSPlatformID = loadU4Field(d, ptr);\r\n ptr += OSPlatformID._size;\r\n\r\n const OSMajorVersion = loadU4Field(d, ptr);\r\n ptr += OSMajorVersion._size;\r\n\r\n const OSMinorVersion = loadU4Field(d, ptr);\r\n ptr += OSMinorVersion._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n OSPlatformID,\r\n OSMajorVersion,\r\n OSMinorVersion,\r\n };\r\n}\r\n\r\nexport function loadMdtAssemblyRef(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtAssemblyRefItem {\r\n let ptr = p;\r\n\r\n const MajorVersion = loadU2Field(d, ptr);\r\n ptr += MajorVersion._size;\r\n\r\n const MinorVersion = loadU2Field(d, ptr);\r\n ptr += MinorVersion._size;\r\n\r\n const BuildNumber = loadU2Field(d, ptr);\r\n ptr += BuildNumber._size;\r\n\r\n const RevisionNumber = loadU2Field(d, ptr);\r\n ptr += RevisionNumber._size;\r\n\r\n const Flags = loadU4EnumField<F.CorAssemblyFlags>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const PublicKeyOrToken = loadMdsBlobField(d, ptr);\r\n ptr += PublicKeyOrToken._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Locale = loadMdsStringsField(d, ptr);\r\n ptr += Locale._size;\r\n\r\n const HashValue = loadMdsBlobField(d, ptr);\r\n ptr += HashValue._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n MajorVersion,\r\n MinorVersion,\r\n BuildNumber,\r\n RevisionNumber,\r\n Flags,\r\n PublicKeyOrToken,\r\n Name,\r\n Locale,\r\n HashValue,\r\n };\r\n}\r\n\r\nexport function loadMdtAssemblyRefProcessor(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtAssemblyRefProcessorItem {\r\n let ptr = p;\r\n\r\n const Processor = loadU4Field(d, ptr);\r\n ptr += Processor._size;\r\n\r\n const AssemblyRef = loadMdtRidField(d, F.MetadataTableIndex.AssemblyRef, ptr);\r\n ptr += AssemblyRef._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Processor,\r\n AssemblyRef,\r\n };\r\n}\r\n\r\nexport function loadMdtAssemblyRefOS(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtAssemblyRefOSItem {\r\n let ptr = p;\r\n\r\n const OSPlatformID = loadU4Field(d, ptr);\r\n ptr += OSPlatformID._size;\r\n\r\n const OSMajorVersion = loadU4Field(d, ptr);\r\n ptr += OSMajorVersion._size;\r\n\r\n const OSMinorVersion = loadU4Field(d, ptr);\r\n ptr += OSMinorVersion._size;\r\n\r\n const AssemblyRef = loadMdtRidField(d, F.MetadataTableIndex.AssemblyRef, ptr);\r\n ptr += AssemblyRef._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n OSPlatformID,\r\n OSMajorVersion,\r\n OSMinorVersion,\r\n AssemblyRef,\r\n };\r\n}\r\n\r\nexport function loadMdtFile(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtFileItem {\r\n let ptr = p;\r\n\r\n const Flags = loadU4EnumField<F.CorFileFlags>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const HashValue = loadMdsBlobField(d, ptr);\r\n ptr += HashValue._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Flags,\r\n Name,\r\n HashValue,\r\n };\r\n}\r\n\r\nexport function loadMdtExportedType(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtExportedTypeItem {\r\n let ptr = p;\r\n\r\n const Flags = loadU4EnumField<F.CorTypeAttr>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const TypeDefId = loadU4Field(d, ptr);\r\n ptr += TypeDefId._size;\r\n\r\n const TypeName = loadMdsStringsField(d, ptr);\r\n ptr += TypeName._size;\r\n\r\n const TypeNamespace = loadMdsStringsField(d, ptr);\r\n ptr += TypeNamespace._size;\r\n\r\n const Implementation = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.Implementation, ptr);\r\n ptr += Implementation._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Flags,\r\n TypeDefId,\r\n TypeName,\r\n TypeNamespace,\r\n Implementation,\r\n };\r\n}\r\n\r\nexport function loadMdtManifestResource(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtManifestResourceItem {\r\n let ptr = p;\r\n\r\n const Offset = loadU4Field(d, ptr);\r\n ptr += Offset._size;\r\n\r\n const Flags = loadU4EnumField<F.CorManifestResourceFlags>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n const Implementation = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.Implementation, ptr);\r\n ptr += Implementation._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Offset,\r\n Flags,\r\n Name,\r\n Implementation,\r\n };\r\n}\r\n\r\nexport function loadMdtNestedClass(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtNestedClassItem {\r\n let ptr = p;\r\n\r\n const NestedClass = loadMdtRidField(d, F.MetadataTableIndex.TypeDef, ptr);\r\n ptr += NestedClass._size;\r\n\r\n const EnclosingClass = loadMdtRidField(d, F.MetadataTableIndex.TypeDef, ptr);\r\n ptr += EnclosingClass._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n NestedClass,\r\n EnclosingClass,\r\n };\r\n}\r\n\r\nexport function loadMdtGenericParam(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtGenericParamItem {\r\n let ptr = p;\r\n\r\n const Number = loadU2Field(d, ptr);\r\n ptr += Number._size;\r\n\r\n const Flags = loadU2EnumField<F.CorGenericParamAttr>(d, ptr);\r\n ptr += Flags._size;\r\n\r\n const Owner = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.TypeOrMethodDef, ptr);\r\n ptr += Owner._size;\r\n\r\n const Name = loadMdsStringsField(d, ptr);\r\n ptr += Name._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Number,\r\n Flags,\r\n Owner,\r\n Name,\r\n };\r\n}\r\n\r\nexport function loadMdtMethodSpec(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtMethodSpecItem {\r\n let ptr = p;\r\n\r\n const Method = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.MethodDefOrRef, ptr);\r\n ptr += Method._size;\r\n\r\n const Instantiation = loadMdsBlobField(d, ptr);\r\n ptr += Instantiation._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Method,\r\n Instantiation,\r\n };\r\n}\r\n\r\nexport function loadMdtGenericParamConstraint(d: FileDataProvider & MetadataSizingProvider, p: number): S.MdtGenericParamConstraintItem {\r\n let ptr = p;\r\n\r\n const Owner = loadMdtRidField(d, F.MetadataTableIndex.GenericParam, ptr);\r\n ptr += Owner._size;\r\n\r\n const Constraint = loadMdCodedTokenField(d, F.MetadataCodedTokenIndex.TypeDefOrRef, ptr);\r\n ptr += Constraint._size;\r\n\r\n return {\r\n _offset: p, _size: ptr - p,\r\n Owner,\r\n Constraint,\r\n };\r\n}\r\n","import * as S from \"./structures\";\r\nimport * as A from \"./aux-structures\";\r\nimport * as L from \"./loader\";\r\nimport * as F from \"./image-flags\";\r\nimport * as E from \"./error\";\r\nimport * as U from \"./utils\";\r\n\r\nexport class PEImage implements L.FileDataProvider, L.MetadataSizingProvider {\r\n public static load(buf: ArrayBuffer): PEImage {\r\n return new PEImage(buf);\r\n }\r\n\r\n //\r\n // FileDataProvider functions.\r\n //\r\n\r\n public getU1(p: number): number {\r\n this.check(p, 1);\r\n return this.data.getUint8(p);\r\n }\r\n\r\n public getU2(p: number): number {\r\n this.check(p, 2);\r\n return this.data.getUint16(p, true);\r\n }\r\n\r\n public getU4(p: number): number {\r\n this.check(p, 3);\r\n return this.data.getUint32(p, true);\r\n }\r\n\r\n public getData(p: number, sz: number): Uint8Array {\r\n this.check(p, sz);\r\n return new Uint8Array(this.data.buffer.slice(p, p + sz));\r\n }\r\n\r\n //\r\n // Image attributes.\r\n //\r\n\r\n public is32Bit(): boolean | undefined {\r\n const optHdr = this.getOptionalHeader();\r\n if (optHdr == null) {\r\n return undefined;\r\n }\r\n\r\n switch (optHdr.Magic.value) {\r\n case F.IMAGE_NT_OPTIONAL_HDR32_MAGIC: return true;\r\n case F.IMAGE_NT_OPTIONAL_HDR64_MAGIC: return false;\r\n default: return undefined;\r\n }\r\n }\r\n\r\n public isManaged(): boolean {\r\n const dd = this.getDataDirectories();\r\n return dd != null && this.isDataDirectoryValid(\r\n dd.items[F.ImageDirectoryEntry.IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR]\r\n );\r\n }\r\n\r\n public hasMetadata(): boolean {\r\n const h = this.getCliHeader();\r\n return h != null && this.isDataDirectoryValid(h.MetaData);\r\n }\r\n\r\n public hasManagedResources(): boolean {\r\n const h = this.getCliHeader();\r\n return h != null && this.isDataDirectoryValid(h.Resources);\r\n }\r\n\r\n public hasStrongNameSignature(): boolean {\r\n const h = this.getCliHeader();\r\n return h != null && this.isDataDirectoryValid(h.StrongNameSignature);\r\n }\r\n\r\n public isMetadataTableValid(id: F.MetadataTableIndex): boolean {\r\n const info = this.metadataTableInfo;\r\n if (info && info[id]) {\r\n return info[id].valid;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n public isMetadataTableSorted(id: F.MetadataTableIndex): boolean {\r\n const info = this.metadataTableInfo;\r\n if (info && info[id]) {\r\n return info[id].sorted;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n public getMetadataTableRows(id: F.MetadataTableIndex): number {\r\n const info = this.metadataTableInfo;\r\n if (info && info[id]) {\r\n return info[id].rows;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n\r\n //\r\n // Image headers.\r\n //\r\n\r\n public getDosHeader(): S.ImageDosHeader | undefined {\r\n return this.dosHeader;\r\n }\r\n\r\n public getPESignature(): S.U4Field | undefined {\r\n return this.peSignature;\r\n }\r\n\r\n public getFileHeader(): S.ImageFileHeader | undefined {\r\n return this.fileHeader;\r\n }\r\n\r\n public getOptionalHeader(): S.ImageOptionalHeader32 | S.ImageOptionalHeader64 | undefined {\r\n return this.optionalHeader;\r\n }\r\n\r\n public getDataDirectories(): S.StructArray<S.ImageDataDirectory> | undefined {\r\n return this.dataDirectories;\r\n }\r\n\r\n public getSectionHeaders(): S.StructArray<S.ImageSectionHeader> | undefined {\r\n return this.sectionHeaders;\r\n }\r\n\r\n //\r\n // Metadata structures.\r\n //\r\n\r\n public getCliHeader(): S.CliHeader | undefined {\r\n if (this.cliHeader) return this.cliHeader;\r\n if (!this.isManaged()) return undefined;\r\n\r\n const offset = this.rvaToOffset(this.dataDirectories!\r\n .items[F.ImageDirectoryEntry.IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR]\r\n .VirtualAddress.value);\r\n\r\n this.cliHeader = L.loadCliHeader(this, offset);\r\n return this.cliHeader;\r\n }\r\n\r\n public getMetadataRoot(): S.MetadataRoot | undefined {\r\n if (this.metadataRoot) return this.metadataRoot;\r\n\r\n const cliHeader = this.getCliHeader();\r\n if (!cliHeader) return undefined;\r\n\r\n const offset = this.rvaToOffset(cliHeader.MetaData.VirtualAddress.value);\r\n if (!offset) return undefined;\r\n\r\n this.metadataRoot = L.loadMetadataRoot(this, offset);\r\n return this.metadataRoot;\r\n }\r\n\r\n public getMetadataStreamHeaders(): S.StructArray<S.MetadataStreamHeader> | undefined {\r\n if (this.metadataStreamHeaders) return this.metadataStreamHeaders;\r\n\r\n const mdRoot = this.getMetadataRoot();\r\n if (!mdRoot || !mdRoot.Streams.value) return undefined;\r\n\r\n this.metadataStreamHeaders = L.loadStructArrayByCount(\r\n this,\r\n mdRoot._offset + mdRoot._size,\r\n L.loadMetadataStreamHeader,\r\n mdRoot.Streams.value\r\n );\r\n return this.metadataStreamHeaders;\r\n }\r\n\r\n public getMetadataStreamHeader(name: F.MetadataStreamName): S.MetadataStreamHeader | undefined {\r\n const headers = this.getMetadataStreamHeaders();\r\n if (!headers) return undefined;\r\n\r\n return headers.items.filter(v => v.Name.value == name).shift();\r\n }\r\n\r\n public getStrongNameSignature(): S.Field | undefined {\r\n if (this.strongNameSignature) return this.strongNameSignature;\r\n\r\n const cliHeader = this.getCliHeader();\r\n if (!cliHeader) return undefined;\r\n\r\n const offset = this.rvaToOffset(cliHeader.StrongNameSignature.VirtualAddress.value);\r\n if (!offset) return undefined;\r\n\r\n this.strongNameSignature = L.loadFixedSizeByteArrayField(\r\n this, offset,\r\n cliHeader.StrongNameSignature.Size.value);\r\n return this.strongNameSignature;\r\n }\r\n\r\n public getMetadataTableHeader(): S.MetadataTableHeader | undefined {\r\n if (this.metadataTableHeader) return this.metadataTableHeader;\r\n\r\n const mdRoot = this.getMetadataRoot();\r\n if (!mdRoot) return undefined;\r\n\r\n const sh = this.getMetadataStreamHeader(F.MetadataStreamName.Table);\r\n if (!sh) return undefined;\r\n\r\n const offset = mdRoot._offset + sh.Offset.value;\r\n this.metadataTableHeader = L.loadMetadataTableHeader(this, offset);\r\n this.fillMetadataTableInfo();\r\n this.fillMetadataTableInfoExtra();\r\n\r\n return this.metadataTableHeader;\r\n }\r\n\r\n public getMdsStringsItem(offset: number): S.StringField | undefined {\r\n const mdRoot = this.getMetadataRoot();\r\n if (!mdRoot) return undefined;\r\n\r\n const sh = this.getMetadataStreamHeader(F.MetadataStreamName.Strings);\r\n if (!sh) return undefined;\r\n\r\n if (offset < 0 || offset >= sh.Size.value) {\r\n return undefined;\r\n } else {\r\n return L.loadNullTerminatedStringField(this,\r\n mdRoot._offset + sh.Offset.value + offset);\r\n }\r\n }\r\n\r\n public getMdsUSItem(offset: number): S.MetadataUSItem | undefined {\r\n const mdRoot = this.getMetadataRoot();\r\n if (!mdRoot) return undefined;\r\n\r\n const sh = this.getMetadataStreamHeader(F.MetadataStreamName.US);\r\n if (!sh) return undefined;\r\n\r\n if (offset < 0 || offset >= sh.Size.value) {\r\n return undefined;\r\n } else {\r\n return L.loadMetadataUSItem(this,\r\n mdRoot._offset + sh.Offset.value + offset);\r\n }\r\n }\r\n\r\n public getMdsGuidItems(): S.StructArray<S.Field> | undefined {\r\n const mdRoot = this.getMetadataRoot();\r\n if (!mdRoot) return undefined;\r\n\r\n const sh = this.getMetadataStreamHeader(F.MetadataStreamName.GUID);\r\n if (!sh) return undefined;\r\n\r\n const count = sh.Size.value / 16;\r\n return L.loadStructArrayByCount(\r\n this,\r\n mdRoot._offset + sh.Offset.value,\r\n (d, p) => L.loadFixedSizeByteArrayField(d, p, 16),\r\n count);\r\n }\r\n\r\n public getMdsBlobItem(offset: number): S.MetadataBlobItem | undefined {\r\n const mdRoot = this.getMetadataRoot();\r\n if (!mdRoot) return undefined;\r\n\r\n const sh = this.getMetadataStreamHeader(F.MetadataStreamName.Blob);\r\n if (!sh) return undefined;\r\n\r\n if (offset < 0 || offset >= sh.Size.value) {\r\n return undefined;\r\n } else {\r\n return L.loadMetadataBlobItem(this,\r\n mdRoot._offset + sh.Offset.value + offset);\r\n }\r\n }\r\n\r\n public getMdtModuleItem(rid /* 1-based */: number): S.MdtModuleItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.Module, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.Module];\r\n return L.loadMdtModule(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtTypeRefItem(rid /* 1-based */: number): S.MdtTypeRefItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.TypeRef, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.Module];\r\n return L.loadMdtTypeRef(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtTypeDefItem(rid /* 1-based */: number): S.MdtTypeDefItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.TypeDef, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.TypeDef];\r\n return L.loadMdtTypeDef(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtFieldPtrItem(rid /* 1-based */: number): S.MdtFieldPtrItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.FieldPtr, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.FieldPtr];\r\n return L.loadMdtFieldPtr(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtFieldItem(rid /* 1-based */: number): S.MdtFieldItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.Field, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.Field];\r\n return L.loadMdtField(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtMethodPtrItem(rid /* 1-based */: number): S.MdtMethodPtrItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.MethodPtr, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.MethodPtr];\r\n return L.loadMdtMethodPtr(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtMethodDefItem(rid /* 1-based */: number): S.MdtMethodDefItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.MethodDef, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.MethodDef];\r\n return L.loadMdtMethodDef(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtParamPtrItem(rid /* 1-based */: number): S.MdtParamPtrItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.ParamPtr, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.ParamPtr];\r\n return L.loadMdtParamPtr(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtParamItem(rid /* 1-based */: number): S.MdtParamItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.Param, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.Param];\r\n return L.loadMdtParam(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtInterfaceImplItem(rid /* 1-based */: number): S.MdtInterfaceImplItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.InterfaceImpl, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.InterfaceImpl];\r\n return L.loadMdtInterfaceImpl(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtMemberRefItem(rid /* 1-based */: number): S.MdtMemberRefItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.MemberRef, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.MemberRef];\r\n return L.loadMdtMemberRef(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtConstantItem(rid /* 1-based */: number): S.MdtConstantItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.Constant, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.Constant];\r\n return L.loadMdtConstant(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtCustomAttributeItem(rid /* 1-based */: number): S.MdtCustomAttributeItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.CustomAttribute, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.CustomAttribute];\r\n return L.loadMdtCustomAttribute(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtFieldMarshalItem(rid /* 1-based */: number): S.MdtFieldMarshalItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.FieldMarshal, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.FieldMarshal];\r\n return L.loadMdtFieldMarshal(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtDeclSecurityItem(rid /* 1-based */: number): S.MdtDeclSecurityItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.DeclSecurity, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.DeclSecurity];\r\n return L.loadMdtDeclSecurity(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtClassLayoutItem(rid /* 1-based */: number): S.MdtClassLayoutItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.ClassLayout, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.ClassLayout];\r\n return L.loadMdtClassLayout(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtFieldLayoutItem(rid /* 1-based */: number): S.MdtFieldLayoutItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.FieldLayout, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.FieldLayout];\r\n return L.loadMdtFieldLayout(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtStandAloneSigItem(rid /* 1-based */: number): S.MdtStandAloneSigItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.StandAloneSig, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.StandAloneSig];\r\n return L.loadMdtStandAloneSig(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtEventMapItem(rid /* 1-based */: number): S.MdtEventMapItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.EventMap, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.EventMap];\r\n return L.loadMdtEventMap(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtEventPtrItem(rid /* 1-based */: number): S.MdtEventPtrItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.EventPtr, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.EventPtr];\r\n return L.loadMdtEventPtr(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtEventItem(rid /* 1-based */: number): S.MdtEventItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.Event, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.Event];\r\n return L.loadMdtEvent(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtPropertyMapItem(rid /* 1-based */: number): S.MdtPropertyMapItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.PropertyMap, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.PropertyMap];\r\n return L.loadMdtPropertyMap(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtPropertyPtrItem(rid /* 1-based */: number): S.MdtPropertyPtrItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.PropertyPtr, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.PropertyPtr];\r\n return L.loadMdtPropertyPtr(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtPropertyItem(rid /* 1-based */: number): S.MdtPropertyItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.Property, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.Property];\r\n return L.loadMdtProperty(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtMethodSemanticsItem(rid /* 1-based */: number): S.MdtMethodSemanticsItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.MethodSemantics, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.MethodSemantics];\r\n return L.loadMdtMethodSemantics(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtMethodImplItem(rid /* 1-based */: number): S.MdtMethodImplItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.MethodImpl, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.MethodImpl];\r\n return L.loadMdtMethodImpl(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtModuleRefItem(rid /* 1-based */: number): S.MdtModuleRefItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.ModuleRef, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.ModuleRef];\r\n return L.loadMdtModuleRef(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtTypeSpecItem(rid /* 1-based */: number): S.MdtTypeSpecItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.TypeSpec, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.TypeSpec];\r\n return L.loadMdtTypeSpec(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtImplMapItem(rid /* 1-based */: number): S.MdtImplMapItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.ImplMap, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.ImplMap];\r\n return L.loadMdtImplMap(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtFieldRVAItem(rid /* 1-based */: number): S.MdtFieldRVAItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.FieldRVA, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.FieldRVA];\r\n return L.loadMdtFieldRVA(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtENCLogItem(rid /* 1-based */: number): S.MdtENCLogItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.ENCLog, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.ENCLog];\r\n return L.loadMdtENCLog(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtENCMapItem(rid /* 1-based */: number): S.MdtENCMapItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.ENCMap, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.ENCMap];\r\n return L.loadMdtENCMap(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtAssemblyItem(rid /* 1-based */: number): S.MdtAssemblyItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.Assembly, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.Assembly];\r\n return L.loadMdtAssembly(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtAssemblyProcessorItem(rid /* 1-based */: number): S.MdtAssemblyProcessorItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.AssemblyProcessor, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.AssemblyProcessor];\r\n return L.loadMdtAssemblyProcessor(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtAssemblyOSItem(rid /* 1-based */: number): S.MdtAssemblyOSItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.AssemblyOS, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.AssemblyOS];\r\n return L.loadMdtAssemblyOS(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtAssemblyRefItem(rid /* 1-based */: number): S.MdtAssemblyRefItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.AssemblyRef, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.AssemblyRef];\r\n return L.loadMdtAssemblyRef(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtAssemblyRefProcessorItem(rid /* 1-based */: number): S.MdtAssemblyRefProcessorItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.AssemblyRefProcessor, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.AssemblyRefProcessor];\r\n return L.loadMdtAssemblyRefProcessor(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtAssemblyRefOSItem(rid /* 1-based */: number): S.MdtAssemblyRefOSItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.AssemblyRefOS, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.AssemblyRefOS];\r\n return L.loadMdtAssemblyRefOS(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtFileItem(rid /* 1-based */: number): S.MdtFileItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.File, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.File];\r\n return L.loadMdtFile(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtExportedTypeItem(rid /* 1-based */: number): S.MdtExportedTypeItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.ExportedType, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.ExportedType];\r\n return L.loadMdtExportedType(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtManifestResourceItem(rid /* 1-based */: number): S.MdtManifestResourceItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.ManifestResource, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.ManifestResource];\r\n return L.loadMdtManifestResource(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtNestedClassItem(rid /* 1-based */: number): S.MdtNestedClassItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.NestedClass, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.NestedClass];\r\n return L.loadMdtNestedClass(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtGenericParamItem(rid /* 1-based */: number): S.MdtGenericParamItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.GenericParam, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.GenericParam];\r\n return L.loadMdtGenericParam(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtMethodSpecItem(rid /* 1-based */: number): S.MdtMethodSpecItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.MethodSpec, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.MethodSpec];\r\n return L.loadMdtMethodSpec(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n public getMdtGenericParamConstraintItem(rid /* 1-based */: number): S.MdtGenericParamConstraintItem | undefined {\r\n if (!this.checkMdt(F.MetadataTableIndex.GenericParamConstraint, rid)) {\r\n return undefined;\r\n }\r\n\r\n const ti = this.metadataTableInfo![F.MetadataTableIndex.GenericParamConstraint];\r\n return L.loadMdtGenericParamConstraint(this, ti.baseOffset + ti.rowSize * (rid - 1));\r\n }\r\n\r\n //\r\n // Metadata sizing.\r\n //\r\n\r\n public getHeapSize(heap: F.MetadataHeapSizeID): number {\r\n if (this.metadataSizingCache.heap) {\r\n return this.metadataSizingCache.heap[heap];\r\n }\r\n\r\n const h = this.getMetadataTableHeader();\r\n if (!h) return 0;\r\n\r\n const getHeapSizeFunc = (heap: F.MetadataHeapSizeID) =>\r\n (h.HeapSizes.value & (1 << heap)) != 0 ? 4 : 2;\r\n\r\n this.metadataSizingCache.heap = [\r\n F.MetadataHeapSizeID.String,\r\n F.MetadataHeapSizeID.GUID,\r\n F.MetadataHeapSizeID.Blob]\r\n .map(v => (h.HeapSizes.value & (1 << v)) != 0 ? 4 : 2);\r\n\r\n return this.metadataSizingCache.heap[heap];\r\n }\r\n\r\n public getTableIDSize(t: F.MetadataTableIndex): number {\r\n const info = this.metadataTableInfo;\r\n if (info && info[t]) {\r\n return info[t].idSize;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n\r\n public getCodedTokenSize(t: F.MetadataCodedTokenIndex): number {\r\n if (this.metadataSizingCache.codedToken) {\r\n return this.metadataSizingCache.codedToken[t];\r\n }\r\n\r\n this.metadataSizingCache.codedToken = F.ctc.map(c => {\r\n const maxRows = 0xFFFF >> c.tagSize;\r\n for (let tid of c.tables) {\r\n if (this.getMetadataTableRows(tid) > maxRows) {\r\n return 4;\r\n }\r\n }\r\n return 2;\r\n });\r\n\r\n return this.metadataSizingCache.codedToken[t];\r\n }\r\n\r\n\r\n //\r\n // Utilities.\r\n //\r\n\r\n public rvaToOffset(rva: number): number {\r\n const sh = this.getSectionHeaderByRva(rva);\r\n if (!sh) return 0;\r\n\r\n return rva - sh.VirtualAddress.value + sh.PointerToRawData.value;\r\n }\r\n\r\n public offsetToRva(offset: number): number {\r\n const sh = this.getSectionHeaderByOffset(offset);\r\n if (!sh) return 0;\r\n\r\n return offset - sh.PointerToRawData.value + sh.VirtualAddress.value;\r\n }\r\n\r\n //\r\n // Private implementations.\r\n //\r\n\r\n private check(p: number, sz: number): void {\r\n if (p < 0 || p >= this.data.byteLength\r\n || sz < 0 || p + sz > this.data.byteLength) {\r\n throw new E.PEError(E.PEErrorType.INVALID_DATA_POSITION, p, sz);\r\n }\r\n }\r\n\r\n private constructor(buf: ArrayBuffer) {\r\n this.data = new DataView(buf);\r\n this.loadHeaders();\r\n }\r\n\r\n private loadHeaders(): void {\r\n let ptr = 0;\r\n this.dosHeader = L.loadImageDosHeader(this, ptr);\r\n\r\n if (this.dosHeader.e_magic.value != F.IMAGE_DOS_SIGNATURE) {\r\n throw new E.PEError(E.PEErrorType.INVALID_DOS_SIGNATURE, ptr, 2);\r\n }\r\n\r\n ptr = this.dosHeader.e_lfanew.value;\r\n this.peSignature = L.loadU4Field(this, ptr);\r\n\r\n if (this.peSignature.value != F.IMAGE_NT_SIGNATURE) {\r\n throw new E.PEError(E.PEErrorType.INVALID_PE_SIGNATURE, ptr, 4);\r\n }\r\n\r\n ptr += this.peSignature._size;\r\n this.fileHeader = L.loadImageFileHeader(this, ptr);\r\n\r\n ptr += this.fileHeader._size;\r\n const magic = L.loadU2Field(this, ptr);\r\n switch (magic.value) {\r\n case F.IMAGE_NT_OPTIONAL_HDR32_MAGIC:\r\n this.optionalHeader = L.loadImageOptionalHeader32(this, ptr);\r\n break;\r\n case F.IMAGE_NT_OPTIONAL_HDR64_MAGIC:\r\n this.optionalHeader = L.loadImageOptionalHeader64(this, ptr);\r\n break;\r\n default:\r\n throw new E.PEError(E.PEErrorType.INVALID_OPTIONAL_HEADER_MAGIC, ptr, 2);\r\n }\r\n\r\n if (this.optionalHeader.NumberOfRvaAndSizes.value != F.IMAGE_NUMBEROF_DIRECTORY_ENTRIES) {\r\n throw new E.PEError(E.PEErrorType.INVALID_DATA_DIRECTORY_COUNT,\r\n this.optionalHeader.NumberOfRvaAndSizes._offset,\r\n this.optionalHeader.NumberOfRvaAndSizes._size);\r\n }\r\n\r\n ptr += this.optionalHeader._size;\r\n this.dataDirectories = L.loadStructArrayByCount(this, ptr,\r\n L.loadImageDataDirectory,\r\n this.optionalHeader.NumberOfRvaAndSizes.value);\r\n\r\n ptr += this.dataDirectories._size;\r\n this.sectionHeaders = L.loadStructArrayByCount(this, ptr,\r\n L.loadImageSectionHeader,\r\n this.fileHeader.NumberOfSections.value);\r\n }\r\n\r\n private getSectionHeaderByOffset(offset: number): S.ImageSectionHeader | undefined {\r\n return this.sectionHeaders && this.sectionHeaders.items.filter(h => {\r\n const p = h.PointerToRawData.value;\r\n const sz = h.SizeOfRawData.value;\r\n return offset >= p && offset < p + sz;\r\n }).shift();\r\n }\r\n\r\n private getSectionHeaderByRva(rva: number): S.ImageSectionHeader | undefined {\r\n return this.sectionHeaders && this.sectionHeaders.items.filter(h => {\r\n const p = h.VirtualAddress.value;\r\n const sz = h.VirtualSize.value;\r\n return rva >= p && rva < p + sz;\r\n }).shift();\r\n }\r\n\r\n private isDataDirectoryValid(dd?: S.ImageDataDirectory): boolean {\r\n return (dd && dd.VirtualAddress.value > 0 && dd.Size.value > 0) || false;\r\n }\r\n\r\n private fillMetadataTableInfo(): void {\r\n const h = this.metadataTableHeader;\r\n if (!h) return;\r\n\r\n let info: A.MetadataTableInfo = {};\r\n let nValid = 0;\r\n for (let id = 0; id < F.NumberOfMdTables; id++) {\r\n const valid = U.isSetLong(h.Valid.high, h.Valid.low, id);\r\n const sorted = U.isSetLong(h.Sorted.high, h.Sorted.low, id);\r\n const rows = valid ? h.Rows.items[nValid++].value : 0;\r\n info[id] = {\r\n valid,\r\n sorted,\r\n rows,\r\n idSize: valid ? (rows > 0xFFFF ? 4 : 2) : 0,\r\n baseOffset: 0,\r\n rowSize: 0\r\n };\r\n }\r\n this.metadataTableInfo = info;\r\n }\r\n\r\n private fillMetadataTableInfoExtra(): void {\r\n const h = this.metadataTableHeader;\r\n if (!h) return;\r\n\r\n const ti = this.metadataTableInfo;\r\n if (!ti) return;\r\n\r\n const ctid = F.MetadataCodedTokenIndex;\r\n const ctsz = this.getCodedTokenSize.bind(this);\r\n\r\n const tid = F.MetadataTableIndex;\r\n\r\n const stringsSize = this.getHeapSize(F.MetadataHeapSizeID.String);\r\n const guidSize = this.getHeapSize(F.MetadataHeapSizeID.GUID);\r\n const blobSize = this.getHeapSize(F.MetadataHeapSizeID.Blob);\r\n\r\n let baseOffset = h._offset + h._size;\r\n\r\n let tbli = ti[tid.Module];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + stringsSize + 3 * guidSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.TypeRef];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ctsz(ctid.ResolutionScope) + 2 * stringsSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.TypeDef];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + 2 * stringsSize + ctsz(ctid.TypeDefOrRef) + ti[tid.Field].idSize + ti[tid.MethodDef].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.FieldPtr];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.Field].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.Field];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + stringsSize + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.MethodPtr];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.MethodDef].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.MethodDef];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + 2 + 2 + stringsSize + blobSize + ti[tid.Param].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.ParamPtr];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.Param].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.Param];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + 2 + stringsSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.InterfaceImpl];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.TypeDef].idSize + ctsz(ctid.TypeDefOrRef);\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.MemberRef];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ctsz(ctid.MemberRefParent) + stringsSize + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.Constant];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 1 + 1 + ctsz(ctid.HasConstant) + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.CustomAttribute];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ctsz(ctid.HasCustomAttribute) + ctsz(ctid.CustomAttributeType) + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.FieldMarshal];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ctsz(ctid.HasFieldMarshall) + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.DeclSecurity];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + ctsz(ctid.HasDeclSecurity) + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.ClassLayout];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + 4 + ti[tid.TypeDef].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.FieldLayout];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + ti[tid.Field].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.StandAloneSig];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.EventMap];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.TypeDef].idSize + ti[tid.Event].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.EventPtr];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.Event].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.Event];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + stringsSize + ctsz(ctid.TypeDefOrRef);\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.PropertyMap];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.TypeDef].idSize + ti[tid.Property].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.PropertyPtr];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.Property].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.Property];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + stringsSize + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.MethodSemantics];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + ti[tid.MethodDef].idSize + ctsz(ctid.HasSemantics);\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.MethodImpl];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.TypeDef].idSize + 2 * ctsz(ctid.MethodDefOrRef);\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.ModuleRef];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = stringsSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.TypeSpec];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.ImplMap];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + ctsz(ctid.MemberForwarded) + stringsSize + ti[tid.ModuleRef].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.FieldRVA];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + ti[tid.Field].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.ENCLog];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + 4;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.ENCMap];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.Assembly];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + 2 + 2 + 2 + 2 + 4 + blobSize + 2 * stringsSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.AssemblyProcessor];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.AssemblyOS];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + 4 + 4;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.AssemblyRef];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + 2 + 2 + 2 + 4 + 2 * blobSize + 2 * stringsSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.AssemblyRefProcessor];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + ti[tid.AssemblyRef].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.AssemblyRefOS];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + 4 + 4 + ti[tid.AssemblyRef].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.File];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + stringsSize + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.ExportedType];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + 4 + 2 * stringsSize + ctsz(ctid.Implementation);\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.ManifestResource];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 4 + 4 + stringsSize + ctsz(ctid.Implementation);\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.NestedClass];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 * ti[tid.TypeDef].idSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.GenericParam];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = 2 + 2 + ctsz(ctid.TypeOrMethodDef) + stringsSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.MethodSpec];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ctsz(ctid.MethodDefOrRef) + blobSize;\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n\r\n tbli = ti[tid.GenericParamConstraint];\r\n if (tbli.valid) {\r\n tbli.baseOffset = baseOffset;\r\n tbli.rowSize = ti[tid.GenericParam].idSize + ctsz(ctid.TypeDefOrRef);\r\n }\r\n baseOffset += tbli.rows * tbli.rowSize;\r\n }\r\n\r\n private checkMdt(tid: F.MetadataTableIndex, rid: number): boolean {\r\n if (!this.metadataTableInfo) {\r\n return false;\r\n }\r\n\r\n const ti = this.metadataTableInfo[tid];\r\n return ti != null && ti.valid && rid > 0 && rid <= ti.rows;\r\n }\r\n\r\n private readonly data: DataView;\r\n\r\n private dosHeader?: S.ImageDosHeader;\r\n private peSignature?: S.U4Field;\r\n private fileHeader?: S.ImageFileHeader;\r\n private optionalHeader?: S.ImageOptionalHeader32 | S.ImageOptionalHeader64;\r\n private dataDirectories?: S.StructArray<S.ImageDataDirectory>;\r\n private sectionHeaders?: S.StructArray<S.ImageSectionHeader>;\r\n\r\n private cliHeader?: S.CliHeader;\r\n private metadataRoot?: S.MetadataRoot;\r\n private metadataStreamHeaders?: S.StructArray<S.MetadataStreamHeader>;\r\n private strongNameSignature?: S.Field;\r\n\r\n private metadataTableHeader?: S.MetadataTableHeader;\r\n private metadataTableInfo?: A.MetadataTableInfo;\r\n\r\n private metadataSizingCache: {\r\n heap?: {\r\n [key: number /* F.MetadataHeapSizeID */]: number;\r\n };\r\n codedToken?: {\r\n [key: number /* F.MetadataCodedTokenIndex */]: number;\r\n }\r\n } = {};\r\n}\r\n","export function createResNavDataMessage(navList: W.NavData[]): W.ResNavDataMessage {\r\n return {\r\n type: W.WorkerMessageType.RES_NAV_DATA,\r\n navList\r\n };\r\n}\r\n\r\nexport function createResPageDataMessage(pageData: W.PageData): W.ResPageDataMessage {\r\n return {\r\n type: W.WorkerMessageType.RES_PAGE_DATA,\r\n pageData\r\n };\r\n}\r\n\r\nexport function createResPEPropsMessage(is32Bit?: boolean, isManaged?: boolean): W.ResPEPropsMessage {\r\n return {\r\n type: W.WorkerMessageType.RES_PE_PROPS,\r\n is32Bit,\r\n isManaged\r\n };\r\n}\r\n\r\nexport function createResPEErrorMessage(error: string): W.ResPEErrorMessage {\r\n return {\r\n type: W.WorkerMessageType.RES_PE_ERROR,\r\n error\r\n };\r\n}\r\n","import * as M from \"./message\";\r\nimport { PEImage } from \"./pe/image\";\r\nimport { generatePageData, clearGeneratorCache } from \"./page-data/generator\";\r\nimport { generateNavList } from \"./page-data/nav-data\";\r\n\r\nlet pe: PEImage | null = null;\r\n\r\nonmessage = (ev) => {\r\n const msg = ev.data as W.WorkerMessage;\r\n switch (msg.type) {\r\n case W.WorkerMessageType.REQ_OPEN_FILE:\r\n handleReqOpenFile(msg as W.ReqOpenFileMessage);\r\n break;\r\n\r\n case W.WorkerMessageType.REQ_OPEN_NAV:\r\n handleReqOpenNav(msg as W.ReqOpenNavMessage);\r\n break;\r\n }\r\n};\r\n\r\nfunction handleReqOpenFile(msg: W.ReqOpenFileMessage): void {\r\n let reader = new FileReader();\r\n\r\n reader.onload = ev => {\r\n try {\r\n const buf = <ArrayBuffer>(<FileReader>ev.target).result;\r\n pe = PEImage.load(buf);\r\n clearGeneratorCache();\r\n\r\n // Response with page data.\r\n const pageData = generatePageData(pe, W.PageID.HEADERS);\r\n const pageDataMsg = M.createResPageDataMessage(pageData);\r\n postMessage(pageDataMsg);\r\n\r\n // Response with PE properties.\r\n const is32Bit = pe.is32Bit();\r\n const isManaged = pe.isManaged();\r\n const pePropsMsg = M.createResPEPropsMessage(is32Bit, isManaged);\r\n postMessage(pePropsMsg);\r\n\r\n // Response with navigation data.\r\n const navList = generateNavList(pe);\r\n const navMsg = M.createResNavDataMessage(navList);\r\n postMessage(navMsg);\r\n } catch (ex) {\r\n const msg = M.createResPEErrorMessage(ex.message\r\n || `Unknown error: ${JSON.stringify(ex)}`);\r\n postMessage(msg);\r\n }\r\n };\r\n\r\n reader.onerror = ev => {\r\n pe = null;\r\n const msg = M.createResPEErrorMessage(\"Can't open file.\");\r\n postMessage(msg);\r\n };\r\n\r\n reader.readAsArrayBuffer(msg.file);\r\n}\r\n\r\nfunction handleReqOpenNav(msg: W.ReqOpenNavMessage): void {\r\n if (pe != null) {\r\n const { pageID, subID, pageNum, elemID } = msg.target;\r\n const pageData = generatePageData(pe, pageID, subID, pageNum);\r\n pageData.nav.elemID = elemID;\r\n const res = M.createResPageDataMessage(pageData);\r\n postMessage(res);\r\n }\r\n}"],"sourceRoot":""}