MCPcopy Create free account
hub / github.com/f0ng/captcha-killer-modified / getValueAt

Method getValueAt

src/main/java/ui/model/TableModel.java:55–108  ·  view source on GitHub ↗
(int row, int column)

Source from the content-addressed store, hash-verified

53 }
54
55 @Override
56 public Object getValueAt(int row, int column) {
57 CaptchaEntity captcha = GUI.captcha.get(row);
58 //String words = tfWords
59 try {
60 switch (column) {
61 case 0:
62 String strr = new String(captcha.getImage());
63 String words = BurpExtender.gui.getTfwords().getText();
64
65 if (!words.equals("") && strr.contains(words)){
66 byte[] byteImage = dataimgToimg(new String(captcha.getImage()) ,words);
67 ImageIcon icon = byte2img(byteImage);
68 table.setRowHeight(row, icon.getIconHeight() + 5);//让行高自动适应图片高
69 return icon;
70 }else {
71 if ((strr.contains("data:image") ) || (strr.contains("data%3Aimage"))) {
72// if ((strr.contains("data:image") && !strr.startsWith("data:image")) || (strr.contains("data%3Aimage") && !strr.startsWith("data%3Aimage"))) {
73 String pattern = "(data:image.*?)[\"|&]|(data%2Aimage.*?)[\"|&]";
74 Pattern r = Pattern.compile(pattern);
75 Matcher m = r.matcher(strr);
76
77 if (m.find()) {
78 strr = m.group(0).replace("\"", "").replace("&", "").replace("Base64:", "").replace("base64:", "");
79 }
80 if (!strr.contains("data:image")) {
81 strr = "data:image/jpeg;base64," + strr;
82 }
83 System.out.println("*****");
84 System.out.println(strr);
85
86 strr = strr.replace("\\r\\n","").replace("\\n","");
87 strr = strr.replace("\\","");
88 byte[] byteImage = DatatypeConverter.parseBase64Binary(strr.substring(strr.indexOf(",") + 1));
89 ImageIcon icon = byte2img(byteImage);
90 table.setRowHeight(row, icon.getIconHeight() + 5);//让行高自动适应图片高
91 return icon;
92 } else {
93 ImageIcon icon = byte2img(captcha.getImage());
94 table.setRowHeight(row, icon.getIconHeight() + 5);//让行高自动适应图片高
95 return icon;
96 }
97 }
98
99 case 1:
100 return captcha.getResult();
101 default:
102 return "";
103 }
104 }catch (Exception e ){
105
106 }
107 return "";
108 }
109}

Callers

nothing calls this directly

Calls 5

getImageMethod · 0.95
getResultMethod · 0.95
getTfwordsMethod · 0.80
dataimgToimgMethod · 0.80
byte2imgMethod · 0.80

Tested by

no test coverage detected