Skip to content

Commit 5cbcecf

Browse files
author
isayan
committed
エンコード種類指定対応
1 parent 8717f26 commit 5cbcecf

File tree

11 files changed

+316
-64
lines changed

11 files changed

+316
-64
lines changed

help/help-ja.html

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,6 +2047,10 @@ <h5 id="_hashchecksum">Hash/Checksum</h5>
20472047
<dd>
20482048
<p>md2によるハッシュを計算します。</p>
20492049
</dd>
2050+
<dt class="hdlist1">md4</dt>
2051+
<dd>
2052+
<p>md4によるハッシュを計算します。</p>
2053+
</dd>
20502054
<dt class="hdlist1">md5</dt>
20512055
<dd>
20522056
<p>md5によるハッシュを計算します。</p>
@@ -2257,7 +2261,23 @@ <h5 id="_hashchecksum">Hash/Checksum</h5>
22572261
</dd>
22582262
<dt class="hdlist1">SM3</dt>
22592263
<dd>
2260-
<p>SM3Lによるハッシュを計算します。</p>
2264+
<p>SM3によるハッシュを計算します。</p>
2265+
</dd>
2266+
<dt class="hdlist1">PARALLEL128-256</dt>
2267+
<dd>
2268+
<p>PARALLELHASH128-256によるハッシュを計算します。</p>
2269+
</dd>
2270+
<dt class="hdlist1">PARALLEL256-512</dt>
2271+
<dd>
2272+
<p>PARALLELHASH256-512によるハッシュを計算します。</p>
2273+
</dd>
2274+
<dt class="hdlist1">TUPLE128-256</dt>
2275+
<dd>
2276+
<p>TUPLEHASH128-256によるハッシュを計算します。</p>
2277+
</dd>
2278+
<dt class="hdlist1">TUPLE256-512</dt>
2279+
<dd>
2280+
<p>TUPLEHASH256-512によるハッシュを計算します。</p>
22612281
</dd>
22622282
<dt class="hdlist1">CRC32</dt>
22632283
<dd>
@@ -2772,7 +2792,7 @@ <h3 id="_version">3.11. Version</h3>
27722792
<div id="footer">
27732793
<div id="footer-text">
27742794
Version unspecified<br>
2775-
Last updated 2024-07-10 20:23:42 +0900
2795+
Last updated 2024-07-19 21:38:54 +0900
27762796
</div>
27772797
</div>
27782798
</body>

help/help.html

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,6 +2070,10 @@ <h5 id="_hashchecksum">Hash/Checksum</h5>
20702070
<dd>
20712071
<p>Calculate hash with md2</p>
20722072
</dd>
2073+
<dt class="hdlist1">md4</dt>
2074+
<dd>
2075+
<p>Calculate hash with md4</p>
2076+
</dd>
20732077
<dt class="hdlist1">md5</dt>
20742078
<dd>
20752079
<p>Calculate hash with md5</p>
@@ -2270,6 +2274,22 @@ <h5 id="_hashchecksum">Hash/Checksum</h5>
22702274
<dd>
22712275
<p>Calculate hash with Tiger</p>
22722276
</dd>
2277+
<dt class="hdlist1">PARALLEL128-256</dt>
2278+
<dd>
2279+
<p>Calculate hash with PARALLELHASH128-256</p>
2280+
</dd>
2281+
<dt class="hdlist1">PARALLEL256-512</dt>
2282+
<dd>
2283+
<p>Calculate hash with PARALLELHASH256-512</p>
2284+
</dd>
2285+
<dt class="hdlist1">TUPLE128-256</dt>
2286+
<dd>
2287+
<p>Calculate hash with TUPLEHASH128-256</p>
2288+
</dd>
2289+
<dt class="hdlist1">TUPLE256-512</dt>
2290+
<dd>
2291+
<p>Calculate hash with TUPLEHASH256-512</p>
2292+
</dd>
22732293
<dt class="hdlist1">GOST3411</dt>
22742294
<dd>
22752295
<p>Calculate hash with GOST3411</p>
@@ -2280,7 +2300,7 @@ <h5 id="_hashchecksum">Hash/Checksum</h5>
22802300
</dd>
22812301
<dt class="hdlist1">SM3</dt>
22822302
<dd>
2283-
<p>SM3Lによるハッシュを計算します。</p>
2303+
<p>Calculate hash with SM3</p>
22842304
</dd>
22852305
<dt class="hdlist1">CRC32</dt>
22862306
<dd>
@@ -2804,7 +2824,7 @@ <h3 id="_version">3.11. Version</h3>
28042824
<div id="footer">
28052825
<div id="footer-text">
28062826
Version unspecified<br>
2807-
Last updated 2024-07-10 20:31:16 +0900
2827+
Last updated 2024-07-19 21:39:19 +0900
28082828
</div>
28092829
</div>
28102830
</body>

help/images/custom_jtranscoder.png

6.56 KB
Loading

release/YaguraExtension-v3.1.jar

4.51 KB
Binary file not shown.
6.56 KB
Loading

src/main/java/burp/BurpExtension.java

Lines changed: 154 additions & 41 deletions
Large diffs are not rendered by default.

src/main/java/extend/util/external/TransUtil.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,22 @@ public static ChronoUnit toChronoUnit(DateUnit unit) {
7474
}
7575

7676
public enum EncodeType {
77-
ALL, ALPHANUM, STANDARD, LIGHT, BURP_LIKE, JAVA_SCRIPT
77+
ALL("All"), ALPHANUM("Alphanum"), STANDARD("Standard"), LIGHT("Light"), BURP_LIKE("BurpLike");
78+
79+
private final String ident;
80+
81+
EncodeType(final String ident) {
82+
this.ident = ident;
83+
}
84+
85+
public String toIdent() {
86+
return this.ident;
87+
}
88+
7889
};
7990

8091
public enum ConvertCase {
81-
UPPER, LOWLER
92+
UPPER, LOWLER;
8293
};
8394

8495
public static Pattern getEncodeTypePattern(EncodeType type) {
@@ -93,8 +104,6 @@ public static Pattern getEncodeTypePattern(EncodeType type) {
93104
return SmartCodec.ENCODE_PATTERN_LIGHT;
94105
case BURP_LIKE:
95106
return SmartCodec.ENCODE_PATTERN_BURP;
96-
case JAVA_SCRIPT:
97-
return SmartCodec.ENCODE_PATTERN_JS;
98107
default:
99108
break;
100109
}

src/main/java/yagura/model/OptionProperty.java

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,26 @@ public Map<String, String> loadConfigSetting() {
2323
return this.config;
2424
}
2525

26+
/**
27+
* implements YaguraProperty
28+
*/
29+
@Expose
30+
private final YaguraProperty yaguraProperty = new YaguraProperty();
31+
32+
public YaguraProperty getYaguraProperty() {
33+
return this.yaguraProperty;
34+
}
35+
36+
public void setYaguraProperty(YaguraProperty yaguraProperty) {
37+
this.yaguraProperty.setProperty(yaguraProperty);
38+
}
39+
2640
/**
2741
* implements UniversalViewProperty
2842
*/
2943
@Expose
3044
private final UniversalViewProperty universalViewProperty = new UniversalViewProperty();
3145

32-
public void defaultSettingProperty() {
33-
Map<String, String> map = loadConfigSetting();
34-
String value = map.get(UniversalViewProperty.CJK_VIEW_PROPERTY);
35-
if (value == null) {
36-
value = this.universalViewProperty.defaultSetting();
37-
this.universalViewProperty.saveSetting(value);
38-
}
39-
}
40-
4146
public UniversalViewProperty getEncodingProperty() {
4247
return this.universalViewProperty;
4348
}
@@ -176,6 +181,7 @@ public void setDebugMode(boolean debugMode) {
176181
* @return
177182
*/
178183
public Map<String, String> getProperty() {
184+
this.config.put(this.yaguraProperty.getSettingName(), this.yaguraProperty.loadSetting());
179185
this.config.put(this.universalViewProperty.getSettingName(), this.universalViewProperty.loadSetting());
180186
this.config.put(this.matchReplaceProperty.getSettingName(), this.matchReplaceProperty.loadSetting());
181187
this.config.put(this.matchAlertProperty.getSettingName(), this.matchAlertProperty.loadSetting());
@@ -189,6 +195,10 @@ public Map<String, String> getProperty() {
189195
}
190196

191197
public void setProperty(Map<String, String> config) {
198+
String configYaguraProperty = config.get(this.yaguraProperty.getSettingName());
199+
if (configYaguraProperty != null) {
200+
this.yaguraProperty.saveSetting(configYaguraProperty);
201+
}
192202
String configUniversalViewProperty = config.get(this.universalViewProperty.getSettingName());
193203
if (configUniversalViewProperty != null) {
194204
this.universalViewProperty.saveSetting(configUniversalViewProperty);
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package yagura.model;
2+
3+
import com.google.gson.annotations.Expose;
4+
import extend.util.external.TransUtil;
5+
import extension.burp.IPropertyConfig;
6+
import extension.helpers.json.JsonUtil;
7+
import java.nio.charset.StandardCharsets;
8+
9+
/**
10+
*
11+
* @author isayan
12+
*/
13+
public class YaguraProperty implements IPropertyConfig {
14+
15+
public final static String YAGURA_PROPERTY = "YaguraProperty";
16+
17+
@Expose
18+
private String selectEncoding = StandardCharsets.UTF_8.name();
19+
20+
/**
21+
* @return the selectEncoding
22+
*/
23+
public String getSelectEncoding() {
24+
return selectEncoding;
25+
}
26+
27+
/**
28+
* @param selectEncoding the selectEncoding to set
29+
*/
30+
public void setSelectEncoding(String selectEncoding) {
31+
this.selectEncoding = selectEncoding;
32+
}
33+
34+
@Expose
35+
private TransUtil.EncodeType encodeType = TransUtil.EncodeType.ALL;
36+
37+
/**
38+
* @return the encodeType
39+
*/
40+
public TransUtil.EncodeType getEncodeType() {
41+
return encodeType;
42+
}
43+
44+
/**
45+
* @param encodeType the encodeType to set
46+
*/
47+
public void setEncodeType(TransUtil.EncodeType encodeType) {
48+
this.encodeType = encodeType;
49+
}
50+
51+
public void setProperty(YaguraProperty property) {
52+
this.setSelectEncoding(property.getSelectEncoding());
53+
this.setEncodeType(property.getEncodeType());
54+
}
55+
56+
@Override
57+
public String getSettingName() {
58+
return YAGURA_PROPERTY;
59+
}
60+
61+
@Override
62+
public void saveSetting(String value) {
63+
YaguraProperty property = JsonUtil.jsonFromString(value, YaguraProperty.class, true);
64+
this.setProperty(property);
65+
}
66+
67+
@Override
68+
public String loadSetting() {
69+
return JsonUtil.jsonToString(this, true);
70+
}
71+
72+
@Override
73+
public String defaultSetting() {
74+
YaguraProperty property = new YaguraProperty();
75+
return JsonUtil.jsonToString(property, true);
76+
}
77+
78+
}

src/main/java/yagura/view/JTransCoderTab.form

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@
479479
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
480480
<ComponentRef name="btnGrpEncodeType"/>
481481
</Property>
482-
<Property name="selected" type="boolean" value="true"/>
483482
<Property name="text" type="java.lang.String" value="All"/>
484483
</Properties>
485484
<Events>
@@ -491,7 +490,9 @@
491490
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
492491
<ComponentRef name="btnGrpEncodeType"/>
493492
</Property>
494-
<Property name="text" type="java.lang.String" value="[^A-Za-z0-9]"/>
493+
<Property name="selected" type="boolean" value="true"/>
494+
<Property name="text" type="java.lang.String" value="Alphanum"/>
495+
<Property name="toolTipText" type="java.lang.String" value="[^A-Za-z0-9]"/>
495496
</Properties>
496497
<Events>
497498
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdoAlphaNumActionPerformed"/>
@@ -502,7 +503,7 @@
502503
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
503504
<ComponentRef name="btnGrpEncodeType"/>
504505
</Property>
505-
<Property name="text" type="java.lang.String" value="Burp"/>
506+
<Property name="text" type="java.lang.String" value="BurpLike"/>
506507
<Property name="toolTipText" type="java.lang.String" value="[^A-Za-z0-9!\u005c&quot;$&apos;()*,/:&lt;&gt;@\u005c[\u005c\u005c\u005c]^`{|},.~-]" containsInvalidXMLChars="true"/>
507508
</Properties>
508509
<Events>

0 commit comments

Comments
 (0)