Skip to content

Commit 98d8416

Browse files
author
isayan
committed
IP v4 Address Paste対応
1 parent 40f57cb commit 98d8416

File tree

5 files changed

+82
-17
lines changed

5 files changed

+82
-17
lines changed

release/YaguraExtension-v3.1.jar

1.07 KB
Binary file not shown.

src/main/java/yagura/model/Logging.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ protected File mkLogZip(String logBaseDir, String logdirFormat) throws IOExcepti
167167
break;
168168
}
169169
} while (true);
170-
BurpExtension.helpers().outPrintln("TargetZip:" + targetZip.getAbsolutePath());
171170
return targetZip;
172171
}
173172

@@ -202,7 +201,6 @@ protected File mkLogDir(String logBaseDir, String logdirFormat) throws IOExcepti
202201
break;
203202
}
204203
} while (true);
205-
BurpExtension.helpers().outPrintln("TargetDir:" + targetDir.getAbsolutePath());
206204
return targetDir;
207205
}
208206

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,36 +2793,39 @@
27932793
<Group type="102" alignment="0" attributes="0">
27942794
<Component id="pnlDotDecIP" min="-2" pref="300" max="-2" attributes="0"/>
27952795
<EmptySpace max="-2" attributes="0"/>
2796-
<Component id="lblIPValid" pref="673" max="32767" attributes="0"/>
2796+
<Component id="btnDecIPPaste" max="32767" attributes="0"/>
2797+
<EmptySpace min="-2" pref="84" max="-2" attributes="0"/>
2798+
<Component id="lblIPValid" pref="517" max="32767" attributes="0"/>
27972799
</Group>
27982800
<Component id="txtDotOctIP" alignment="0" max="32767" attributes="0"/>
27992801
</Group>
28002802
<EmptySpace max="-2" attributes="0"/>
2801-
<Group type="103" groupAlignment="0" max="-2" attributes="0">
2803+
<Group type="103" groupAlignment="0" attributes="0">
28022804
<Component id="btnOctIP" max="32767" attributes="0"/>
2803-
<Component id="btnDecIPConvert" alignment="0" max="32767" attributes="0"/>
28042805
<Component id="btnHexIP" alignment="0" max="32767" attributes="0"/>
28052806
<Component id="btnDotOctIP" alignment="0" max="32767" attributes="0"/>
28062807
<Component id="btnDotHexIP" alignment="0" max="32767" attributes="0"/>
28072808
<Component id="btnIntIP" alignment="0" max="32767" attributes="0"/>
2809+
<Component id="btnDecIPConvert" max="32767" attributes="0"/>
28082810
</Group>
2809-
<EmptySpace min="-2" max="-2" attributes="0"/>
2811+
<EmptySpace max="-2" attributes="0"/>
28102812
</Group>
28112813
</Group>
28122814
</DimensionLayout>
28132815
<DimensionLayout dim="1">
28142816
<Group type="103" groupAlignment="0" attributes="0">
28152817
<Group type="102" alignment="0" attributes="0">
2818+
<EmptySpace max="-2" attributes="0"/>
28162819
<Group type="103" groupAlignment="0" attributes="0">
2817-
<Group type="102" attributes="0">
2818-
<EmptySpace max="-2" attributes="0"/>
2820+
<Group type="103" groupAlignment="1" attributes="0">
28192821
<Group type="103" groupAlignment="1" max="-2" attributes="0">
28202822
<Component id="lblDotDeclIP" alignment="0" max="32767" attributes="0"/>
28212823
<Component id="lblIPValid" alignment="0" max="32767" attributes="0"/>
28222824
<Component id="pnlDotDecIP" alignment="0" max="32767" attributes="0"/>
28232825
</Group>
2826+
<Component id="btnDecIPConvert" min="-2" max="-2" attributes="0"/>
28242827
</Group>
2825-
<Component id="btnDecIPConvert" alignment="0" min="-2" max="-2" attributes="0"/>
2828+
<Component id="btnDecIPPaste" min="-2" max="-2" attributes="0"/>
28262829
</Group>
28272830
<EmptySpace type="unrelated" max="-2" attributes="0"/>
28282831
<Group type="103" groupAlignment="0" attributes="0">
@@ -3011,6 +3014,14 @@
30113014
<Property name="toolTipText" type="java.lang.String" value=""/>
30123015
</Properties>
30133016
</Component>
3017+
<Component class="javax.swing.JButton" name="btnDecIPPaste">
3018+
<Properties>
3019+
<Property name="text" type="java.lang.String" value="Paste"/>
3020+
</Properties>
3021+
<Events>
3022+
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDecIPPasteActionPerformed"/>
3023+
</Events>
3024+
</Component>
30143025
</SubComponents>
30153026
</Container>
30163027
</SubComponents>

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ private void initComponents() {
652652
txtIntIP = new javax.swing.JTextField();
653653
btnIntIP = new javax.swing.JButton();
654654
lblIPValid = new javax.swing.JLabel();
655+
btnDecIPPaste = new javax.swing.JButton();
655656

656657
setLayout(new java.awt.BorderLayout());
657658

@@ -2442,6 +2443,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
24422443
lblIPValid.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
24432444
lblIPValid.setToolTipText("");
24442445

2446+
btnDecIPPaste.setText("Paste");
2447+
btnDecIPPaste.addActionListener(new java.awt.event.ActionListener() {
2448+
public void actionPerformed(java.awt.event.ActionEvent evt) {
2449+
btnDecIPPasteActionPerformed(evt);
2450+
}
2451+
});
2452+
24452453
javax.swing.GroupLayout tabIPFormatConverterLayout = new javax.swing.GroupLayout(tabIPFormatConverter);
24462454
tabIPFormatConverter.setLayout(tabIPFormatConverterLayout);
24472455
tabIPFormatConverterLayout.setHorizontalGroup(
@@ -2464,29 +2472,32 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
24642472
.addGroup(tabIPFormatConverterLayout.createSequentialGroup()
24652473
.addComponent(pnlDotDecIP, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
24662474
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
2467-
.addComponent(lblIPValid, javax.swing.GroupLayout.DEFAULT_SIZE, 673, Short.MAX_VALUE))
2475+
.addComponent(btnDecIPPaste, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
2476+
.addGap(84, 84, 84)
2477+
.addComponent(lblIPValid, javax.swing.GroupLayout.DEFAULT_SIZE, 517, Short.MAX_VALUE))
24682478
.addComponent(txtDotOctIP))
24692479
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
2470-
.addGroup(tabIPFormatConverterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
2480+
.addGroup(tabIPFormatConverterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
24712481
.addComponent(btnOctIP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
2472-
.addComponent(btnDecIPConvert, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
24732482
.addComponent(btnHexIP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
24742483
.addComponent(btnDotOctIP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
24752484
.addComponent(btnDotHexIP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
2476-
.addComponent(btnIntIP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
2485+
.addComponent(btnIntIP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
2486+
.addComponent(btnDecIPConvert, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
24772487
.addContainerGap())
24782488
);
24792489
tabIPFormatConverterLayout.setVerticalGroup(
24802490
tabIPFormatConverterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
24812491
.addGroup(tabIPFormatConverterLayout.createSequentialGroup()
2492+
.addContainerGap()
24822493
.addGroup(tabIPFormatConverterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
2483-
.addGroup(tabIPFormatConverterLayout.createSequentialGroup()
2484-
.addContainerGap()
2494+
.addGroup(tabIPFormatConverterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
24852495
.addGroup(tabIPFormatConverterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
24862496
.addComponent(lblDotDeclIP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
24872497
.addComponent(lblIPValid, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
2488-
.addComponent(pnlDotDecIP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
2489-
.addComponent(btnDecIPConvert))
2498+
.addComponent(pnlDotDecIP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
2499+
.addComponent(btnDecIPConvert))
2500+
.addComponent(btnDecIPPaste))
24902501
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
24912502
.addGroup(tabIPFormatConverterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
24922503
.addComponent(btnDotOctIP)
@@ -3636,6 +3647,18 @@ private void btnSHAKE256ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
36363647
}
36373648
}//GEN-LAST:event_btnSHAKE256ActionPerformed
36383649

3650+
private void btnDecIPPasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDecIPPasteActionPerformed
3651+
try {
3652+
byte ipv4 [] = IpUtil.parseIPv4AddressByte(SwingUtil.systemClipboardPaste());
3653+
this.txtDec1.setText(String.valueOf(Byte.toUnsignedInt(ipv4[0])));
3654+
this.txtDec2.setText(String.valueOf(Byte.toUnsignedInt(ipv4[1])));
3655+
this.txtDec3.setText(String.valueOf(Byte.toUnsignedInt(ipv4[2])));
3656+
this.txtDec4.setText(String.valueOf(Byte.toUnsignedInt(ipv4[4])));
3657+
} catch (ParseException ex) {
3658+
logger.log(Level.SEVERE, ex.getMessage(), ex);
3659+
}
3660+
}//GEN-LAST:event_btnDecIPPasteActionPerformed
3661+
36393662
private final java.awt.event.ActionListener historyActionPerformed = new java.awt.event.ActionListener() {
36403663
@Override
36413664
public void actionPerformed(java.awt.event.ActionEvent evt) {
@@ -3658,6 +3681,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
36583681
private javax.swing.ButtonGroup btnConvertCase;
36593682
private javax.swing.JButton btnDecCopy;
36603683
private javax.swing.JButton btnDecIPConvert;
3684+
private javax.swing.JButton btnDecIPPaste;
36613685
private javax.swing.JButton btnDecode;
36623686
private javax.swing.JButton btnDotHexIP;
36633687
private javax.swing.JButton btnDotOctIP;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright 2024 isayan.
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
package yagura.view;
25+
26+
/**
27+
*
28+
* @author isayan
29+
*/
30+
class ipv4 {
31+
32+
}

0 commit comments

Comments
 (0)