Example #1
0
        MDSigPatcher(List <byte> sigBuilder, RemappedTypeTokens remappedTypeTokens, RawModuleBytes moduleData, uint blobOffset, uint sigOffset)
        {
            this.sigBuilder         = sigBuilder;
            this.remappedTypeTokens = remappedTypeTokens;
            currPos = (byte *)moduleData.Pointer + blobOffset + sigOffset;
            uint size = MDPatcherUtils.ReadCompressedUInt32(ref currPos, (byte *)moduleData.Pointer + moduleData.Size);

            startPos         = currPos;
            endPos           = currPos + size;
            usingBuilder     = false;
            recursionCounter = 0;
        }
Example #2
0
        MDSigPatcher(List <byte> sigBuilder, Dictionary <uint, uint> remappedTypeTokens, byte[] moduleData, uint blobOffset, uint sigOffset)
        {
            this.sigBuilder         = sigBuilder;
            this.remappedTypeTokens = remappedTypeTokens;
            this.moduleData         = moduleData;
            startOffset             = blobOffset + sigOffset;
            uint size = MDPatcherUtils.ReadCompressedUInt32(moduleData, ref startOffset);

            endOffset        = startOffset + size;
            currOffset       = startOffset;
            usingBuilder     = false;
            recursionCounter = 0;
        }
Example #3
0
        MDSigPatcher(List <byte> sigBuilder, RemappedTypeTokens remappedTypeTokens, RawModuleBytes moduleData, uint blobOffset, uint sigOffset)
        {
            if ((ulong)blobOffset + sigOffset > (ulong)moduleData.Size)
            {
                ThrowInvalidSignatureException();
            }
            this.sigBuilder         = sigBuilder;
            this.remappedTypeTokens = remappedTypeTokens;
            currPos = (byte *)moduleData.Pointer + blobOffset + sigOffset;
            uint size = MDPatcherUtils.ReadCompressedUInt32(ref currPos, (byte *)moduleData.Pointer + moduleData.Size);

            startPos = currPos;
            endPos   = currPos + size;
            if ((ulong)(endPos - (byte *)moduleData.Pointer) > (ulong)moduleData.Size)
            {
                ThrowInvalidSignatureException();
            }
            usingBuilder     = false;
            recursionCounter = 0;
        }