A lot of work was done to keep simplicity and zero learning curve for writing Analysis Plugs. Steps to create a Hello World Plug mentioned below
- Using Visual Studio or Visual Studio Express create a 'Class Library' project
- Add reference to PlugFramework.Api
- Inherit the Class from iPlugType
- Override a method called RunAnalysis()
- Build the DLL and copy to 'Plugs' folder
- Add to any Analysis Template!
public class Class1 : iPlugType // Derive your analysis class from iPlugType
{
public override void RunAnalysis() // Override RunAnalysis()
{
// Begin Report & specify Title of Analysis section
BeginReport("Hello World!");
WriteDataLine("1st Line of the report!"); // Normal report line using fixed width font
WriteBlankLine(); // Add blank line in the report
WriteBoldLine("Drawing Graph has become easy as well..."); // Add Bold line
WriteGraphLine(GraphColors.Gray, 70, "msvcrt.dll - 70%"); // Add Graph with color, percentage and label
// Adding HTML content
WriteHTMLLine("Testing for HTML content inline like <b>bold</b> <i>italics</i> <u>underline</u> words");
// Adding analysis recommendation
WriteRecommendation(ResultSeverity.Information,
"Process crashed during Heap function call normally indicates Heap Corruption",
"Please Enable page heap and configure DebugDiag with Crash Rule"
);
// End Reporting
EndReport();
}
}
This is a sample plug to show the different functions available but does not do any analysis by itself!