forked from hackvertor/hackvertor
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/hackvertor/hackvertor
- Loading branch information
Showing
17 changed files
with
321 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,19 +6,40 @@ name: Java CI with Maven | |
on: | ||
push: | ||
branches: [ master ] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: [ master ] | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'oracle' | ||
java-version: '17' | ||
cache: 'gradle' | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Creating the jar file | ||
run: ./gradlew jar | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./releases/*.jar | ||
name: Downloadable Extension File | ||
- name: Release | ||
uses: hackvertor/[email protected] | ||
with: | ||
tag: "latest_hackvertor_release" | ||
allowUpdates: true | ||
artifacts: "releases/*.jar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,10 @@ bin/ | |
build/ | ||
target/ | ||
out/ | ||
/releases/ | ||
#intellij | ||
.idea/ | ||
.classpath/ | ||
.project/ | ||
/build/ | ||
/.gradle/ | ||
/.gradle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package burp; | ||
|
||
import java.math.BigInteger; | ||
|
||
public class Base58 { | ||
private static final char[] ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray(); | ||
private static final BigInteger BASE = BigInteger.valueOf(58); | ||
|
||
public static String encode(byte[] input) { | ||
if (input.length == 0) { | ||
return ""; | ||
} | ||
|
||
// Convert the input bytes to a BigInteger | ||
BigInteger num = new BigInteger(1, input); | ||
|
||
// Encode the BigInteger as base58 | ||
StringBuilder sb = new StringBuilder(); | ||
while (num.compareTo(BigInteger.ZERO) > 0) { | ||
BigInteger[] qr = num.divideAndRemainder(BASE); | ||
sb.append(ALPHABET[qr[1].intValue()]); | ||
num = qr[0]; | ||
} | ||
|
||
// Add leading '1' characters for each leading zero byte in the input | ||
for (int i = 0; i < input.length && input[i] == 0; i++) { | ||
sb.append(ALPHABET[0]); | ||
} | ||
|
||
return sb.reverse().toString(); | ||
} | ||
|
||
public static byte[] decode(String input) { | ||
if (input.length() == 0) { | ||
return new byte[0]; | ||
} | ||
|
||
// Convert the base58 input to a BigInteger | ||
BigInteger num = BigInteger.ZERO; | ||
for (int i = 0; i < input.length(); i++) { | ||
char c = input.charAt(i); | ||
int digit = -1; | ||
for (int j = 0; j < ALPHABET.length; j++) { | ||
if (ALPHABET[j] == c) { | ||
digit = j; | ||
break; | ||
} | ||
} | ||
if (digit == -1) { | ||
throw new IllegalArgumentException("Invalid character '" + c + "' at position " + i); | ||
} | ||
num = num.multiply(BASE).add(BigInteger.valueOf(digit)); | ||
} | ||
|
||
// Convert the BigInteger to a byte array | ||
byte[] bytes = num.toByteArray(); | ||
|
||
// Remove any leading zero bytes | ||
if (bytes.length > 0 && bytes[0] == 0) { | ||
byte[] tmp = new byte[bytes.length - 1]; | ||
System.arraycopy(bytes, 1, tmp, 0, tmp.length); | ||
bytes = tmp; | ||
} | ||
|
||
// Add leading zero bytes for each leading '1' character in the input | ||
int numZeros = 0; | ||
for (int i = 0; i < input.length() && input.charAt(i) == ALPHABET[0]; i++) { | ||
numZeros++; | ||
} | ||
byte[] result = new byte[numZeros + bytes.length]; | ||
System.arraycopy(bytes, 0, result, numZeros, bytes.length); | ||
|
||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.