Merge branch 'master' into fix-ipv4-uint8array-concat

This commit is contained in:
Shivam Kumar 2026-06-10 22:24:04 +05:30 committed by GitHub
commit 8129e61923
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 135 additions and 4 deletions

View File

@ -144,7 +144,8 @@ module.exports = function (grunt) {
new BundleAnalyzerPlugin({ new BundleAnalyzerPlugin({
analyzerMode: "static", analyzerMode: "static",
reportFilename: "BundleAnalyzerReport.html", reportFilename: "BundleAnalyzerReport.html",
openAnalyzer: false openAnalyzer: false,
excludeAssets: /.*Worker.js/
}), }),
] ]
}; };

6
package-lock.json generated
View File

@ -16373,9 +16373,9 @@
} }
}, },
"node_modules/shell-quote": { "node_modules/shell-quote": {
"version": "1.8.3", "version": "1.8.4",
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.4.tgz",
"integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", "integrity": "sha512-VsC6n6vz1ihYYyZZwX7YZSF5l5x36ca17OC+a69h94YqB7X6XLwf+5MOgynYir2SLFUbl8gIYvBo8K8RoNQ6bQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {

View File

@ -119,6 +119,7 @@
"GOST Verify", "GOST Verify",
"GOST Key Wrap", "GOST Key Wrap",
"GOST Key Unwrap", "GOST Key Unwrap",
"ROR13",
"ROT13", "ROT13",
"ROT13 Brute Force", "ROT13 Brute Force",
"ROT47", "ROT47",
@ -240,6 +241,7 @@
"Bit shift right", "Bit shift right",
"Rotate left", "Rotate left",
"Rotate right", "Rotate right",
"ROR13",
"ROT13", "ROT13",
"ROT8000" "ROT8000"
] ]

View File

@ -0,0 +1,83 @@
/**
* ROR13 Hash operation (Windows API hashing convention)
* @author fufu_btw
* @license Apache-2.0
*/
import Operation from "../Operation.mjs";
/**
* Implements a ROR13 hash used for API name hashing techniques.
*/
class ROR13 extends Operation {
/**
* Constructor
*/
constructor() {
super();
this.name = "ROR13";
this.module = "Default";
this.description = "Computes a ROR13 hash used in API hashing techniques.";
this.infoURL = "";
this.inputType = "byteArray";
this.outputType = "string";
this.args = [];
}
/**
* Rotate right (32-bit)
*
* @param {number} value - input value
* @param {number} bits - rotation bits
* @returns {number} rotated value
*/
ror(value, bits) {
return ((value >>> bits) | (value << (32 - bits))) >>> 0;
}
/**
* Execute ROR13 hash
*
* @param {byteArray} input - input bytes
* @param {Object[]} args - operation arguments
* @returns {string} hex hash
*/
run(input, args) {
let hash = 0;
for (let i = 0; i < input.length; i++) {
const chr = input[i] & 0xFF;
hash = this.ror(hash, 13);
hash = (hash + chr) >>> 0;
}
return "0x" + hash.toString(16).padStart(8, "0").toUpperCase();
}
/**
* Highlight input
*
* @param {Object[]} pos
* @param {Object[]} args
* @returns {Object[]}
*/
highlight(pos, args) {
return pos;
}
/**
* Reverse highlight
*
* @param {Object[]} pos
* @param {Object[]} args
* @returns {Object[]}
*/
highlightReverse(pos, args) {
return pos;
}
}
export default ROR13;

View File

@ -0,0 +1,45 @@
/**
* ROR13 tests.
*
* @author fufu_btw [contact@fufu.red]
* @copyright Crown Copyright 2026
* @license Apache-2.0
*/
import TestRegister from "../../lib/TestRegister.mjs";
TestRegister.addTests([
{
name: "ROR13: AddConsoleAliasW",
input: "AddConsoleAliasW",
expectedOutput: "0x9916128C",
recipeConfig: [
{
op: "ROR13",
args: []
},
],
},
{
name: "ROR13 Hash: LoadLibraryA",
input: "LoadLibraryA",
expectedOutput: "0xEC0E4E8E",
recipeConfig: [
{
op: "ROR13",
args: []
},
],
},
{
name: "ROR13 Hash: CloseHandle",
input: "CloseHandle",
expectedOutput: "0x0FFD97FB",
recipeConfig: [
{
op: "ROR13",
args: []
},
],
},
]);