Skip to content

Commit

Permalink
避免大数据包卡死界面 #84
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed May 11, 2024
1 parent c54f6cd commit 72f82cd
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions src/messageTab/U2C/ChineseTab.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
package messageTab.U2C;

import burp.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.awt.*;
import java.awt.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.swing.SwingWorker;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;

import burp.BurpExtender;
import burp.IBurpExtenderCallbacks;
import burp.IExtensionHelpers;
import burp.IMessageEditorController;
import burp.IMessageEditorTab;

/**
* @author bit4woo
* @version CreateTime:2022年1月15日 下午11:07:59
Expand Down Expand Up @@ -86,13 +93,20 @@ public String getNextCharSet() {

@Override
public void setMessage(byte[] content, boolean isRequest) {
originContent = content;
detectedCharset = BurpExtender.getHelperPlus().detectCharset(isRequest, content);
if (StringUtils.isEmpty(detectedCharset)) {
panel.display(content, isRequest, "UTF-8");
} else {
panel.display(content, isRequest, detectedCharset);
}
SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
originContent = content;
detectedCharset = BurpExtender.getHelperPlus().detectCharset(isRequest, content);
if (StringUtils.isEmpty(detectedCharset)) {
panel.display(content, isRequest, "UTF-8");
} else {
panel.display(content, isRequest, detectedCharset);
}
return null;
}
};
worker.execute();
}

/**
Expand All @@ -111,7 +125,7 @@ public boolean isModified() {

@Override
public byte[] getSelectedData() {
// return txtInput.getSelectedText();
// return txtInput.getSelectedText();
return null;
}

Expand Down

0 comments on commit 72f82cd

Please sign in to comment.