예제 #1
0
        /// <summary>
        ///     Preform a pattern scan from a byte[] array pattern.
        /// </summary>
        /// <param name="pattern">The byte array that contains the pattern of bytes we're looking for.</param>
        /// <param name="offsetToAdd">The offset to add to the offset result found from the pattern.</param>
        /// <param name="rebaseResult">
        ///     If the final address result should be rebased to the base address of the
        ///     <see cref="ProcessModule" /> the pattern data resides in.
        /// </param>
        /// <returns>A new <see cref="PatternScanResult" /> instance.</returns>
        public PatternScanResult FindPattern(byte[] pattern, int offsetToAdd, bool rebaseResult)
        {
            var mask = PatternCore.MaskFromPattern(pattern);

            return(FindPattern(pattern, mask, offsetToAdd, rebaseResult));
        }
예제 #2
0
        /// <summary>
        ///     Preform a pattern scan from a dword string based pattern.
        /// </summary>
        /// m>
        /// <param name="patternText">
        ///     The dword string based pattern text containing the pattern to try and find matches against.
        ///     <example>
        ///         <code>
        /// var bytes = new byte[]{55,45,00,00,55} ;
        /// var mask = "xx??x";
        /// </code>
        ///     </example>
        /// </param>
        /// <param name="offsetToAdd">The offset to add to the offset result found from the pattern.</param>
        /// <param name="reBase">If the address should be rebased to this <see cref="RemoteModule" /> Instance's base address.</param>
        /// <returns>A new <see cref="PatternScanResult" /> instance.</returns>
        public PatternScanResult FindPattern(string patternText, int offsetToAdd, bool reBase)
        {
            var bytes = PatternCore.GetBytesFromDwordPattern(patternText);

            return(FindPattern(bytes, offsetToAdd, reBase));
        }