Skip to content

Commit

Permalink
Merge pull request #10 from augustd/get-instance
Browse files Browse the repository at this point in the history
Statically retrieve the BurpExtender
  • Loading branch information
augustd authored Mar 20, 2017
2 parents 8cd07e5 + ddb72b8 commit d86b3ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.codemagi</groupId>
<artifactId>burp-suite-utils</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
<packaging>jar</packaging>
<name>Burp Suite Utils</name>
<description>The Burp Suite Utils project provides developers with APIs for building Burp Suite Extensions.</description>
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/codemagi/burp/BaseExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public abstract class BaseExtender implements IBurpExtender {
protected IExtensionHelpers helpers;
protected OutputStream stdout;
protected OutputStream stderr;

private static IBurpExtender instance;

/**
* implement IBurpExtender
Expand All @@ -39,6 +41,9 @@ public void registerExtenderCallbacks(final IBurpExtenderCallbacks callbacks) {
//get the output streams for info and error messages
stdout = callbacks.getStdout();
stderr = callbacks.getStderr();

//put this into the local instance variable
instance = this;

//initialize the extension
initialize();
Expand All @@ -56,6 +61,10 @@ public void registerExtenderCallbacks(final IBurpExtenderCallbacks callbacks) {
*/
protected abstract void initialize();

public static IBurpExtender getInstance() {
return instance;
}

/**
* Print a stack trace to the extender errors UI
*
Expand Down

0 comments on commit d86b3ad

Please sign in to comment.