Constant values and helper code used by buffer security ("GS") checks.
Esempio n. 1
0
        public override AnalysisApplicability CanAnalyze(BinaryAnalyzerContext context, out string reasonForNotAnalyzing)
        {
            AnalysisApplicability applicability = StackProtectionUtilities.CommonCanAnalyze(context, out reasonForNotAnalyzing);

            // Checks for missing policy should always be evaluated as the last action, so that
            // we do not raise an error in cases where the analysis would not otherwise be applied.
            if (applicability == AnalysisApplicability.ApplicableToSpecifiedTarget)
            {
                reasonForNotAnalyzing = RuleResources.BA2005_MissingRequiredConfiguration;
                if (context.Policy == null)
                {
                    return(AnalysisApplicability.NotApplicableDueToMissingConfiguration);
                }
            }
            return(applicability);
        }
 public override AnalysisApplicability CanAnalyze(BinaryAnalyzerContext context, out string reasonForNotAnalyzing)
 {
     return(StackProtectionUtilities.CommonCanAnalyze(context, out reasonForNotAnalyzing));
 }
 public override AnalysisApplicability CanAnalyzePE(PEBinary target, Sarif.PropertiesDictionary policy, out string reasonForNotAnalyzing)
 {
     return(StackProtectionUtilities.CommonCanAnalyze(target, out reasonForNotAnalyzing));
 }