MCPcopy Index your code
hub / github.com/f0ng/autoDecoder / createMenuItems

Method createMenuItems

src/burp/BurpExtender.java:131–171  ·  view source on GitHub ↗
( IContextMenuInvocation invocation )

Source from the content-addressed store, hash-verified

129 }
130
131 @Override
132 public List<JMenuItem> createMenuItems ( IContextMenuInvocation invocation ) {
133// this.currentInvocation = invocation;
134 JMenuItem jMenuItem = new JMenuItem("Decode-Autodecoder");
135 JMenuItem jMenuItem2 = new JMenuItem("Encode-Autodecoder");
136 List<JMenuItem> jMenuItemList = new ArrayList<>();
137 jMenuItemList.add(jMenuItem);
138 jMenuItemList.add(jMenuItem2);
139
140 // 监听上下文菜单点击事件
141 jMenuItem.addActionListener(a -> { // 解密
142 int[] selectedIndex = invocation.getSelectionBounds();
143 IHttpRequestResponse req = invocation.getSelectedMessages()[0];
144 byte[] request = req.getRequest();
145 byte[] param = new byte[selectedIndex[1] - selectedIndex[0]];
146 System.arraycopy(request, selectedIndex[0], param, 0, selectedIndex[1] - selectedIndex[0]);
147 String selectString = new String(param);
148 try {
149 ClickEncodeDecode.Decode(invocation,selectString);
150 } catch (Exception e) {
151 e.printStackTrace();
152 }
153// stdout.println(selectString);// 获取选中的内容
154 });
155
156 // 监听上下文菜单点击事件
157 jMenuItem2.addActionListener(a -> { // 加密
158 int[] selectedIndex = invocation.getSelectionBounds();
159 IHttpRequestResponse req = invocation.getSelectedMessages()[0];
160 byte[] request = req.getRequest();
161 byte[] param = new byte[selectedIndex[1] - selectedIndex[0]];
162 System.arraycopy(request, selectedIndex[0], param, 0, selectedIndex[1] - selectedIndex[0]);
163 String selectString = new String(param);
164 try {
165 ClickEncodeDecode.Encode(invocation,selectString);
166 } catch (Exception e) {
167 e.printStackTrace();
168 }
169 });
170 return jMenuItemList;
171 }
172
173 @Override
174 public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse iHttpRequestResponse) { //处理请求包

Callers

nothing calls this directly

Calls 4

DecodeMethod · 0.95
EncodeMethod · 0.95
getSelectionBoundsMethod · 0.80
getRequestMethod · 0.80

Tested by

no test coverage detected