浏览代码

Merge branch 'artemisbot-feature_rot47'

n1474335 8 年之前
父节点
当前提交
b0fd297069

文件差异内容过多而无法显示
+ 0 - 0
build/prod/cyberchef.htm


文件差异内容过多而无法显示
+ 0 - 0
build/prod/index.html


文件差异内容过多而无法显示
+ 0 - 0
build/prod/scripts.js


+ 1 - 0
src/js/config/Categories.js

@@ -77,6 +77,7 @@ var Categories = [
             "RC4",
             "RC4",
             "RC4 Drop",
             "RC4 Drop",
             "ROT13",
             "ROT13",
+            "ROT47",
             "XOR",
             "XOR",
             "XOR Brute Force",
             "XOR Brute Force",
             "Derive PBKDF2 key",
             "Derive PBKDF2 key",

+ 15 - 0
src/js/config/OperationConfig.js

@@ -1390,6 +1390,21 @@ var OperationConfig = {
             },
             },
         ]
         ]
     },
     },
+    "ROT47": {
+        description: "A slightly more complex variation of a caesar cipher, which includes ASCII characters from 33 '!' to 126 '~'. Default rotation: 47.",
+        run: Rotate.run_rot47,
+        highlight: true,
+        highlight_reverse: true,
+        input_type: "byte_array",
+        output_type: "byte_array",
+        args: [
+            {
+                name: "Amount",
+                type: "number",
+                value: Rotate.ROT47_AMOUNT
+            },
+        ]
+    },
     "Strip HTTP headers": {
     "Strip HTTP headers": {
         description: "Removes HTTP headers from a request or response by looking for the first instance of a double newline.",
         description: "Removes HTTP headers from a request or response by looking for the first instance of a double newline.",
         run: HTTP.run_strip_headers,
         run: HTTP.run_strip_headers,

+ 39 - 3
src/js/operations/Rotate.js

@@ -91,7 +91,7 @@ var Rotate = {
      * @default
      * @default
      */
      */
     ROT13_UPPERCASE: true,
     ROT13_UPPERCASE: true,
-    
+
     /**
     /**
      * ROT13 operation.
      * ROT13 operation.
      *
      *
@@ -124,8 +124,44 @@ var Rotate = {
         }
         }
         return output;
         return output;
     },
     },
-    
-    
+
+
+    /**
+     * @constant
+     * @default
+     */
+    ROT47_AMOUNT: 47,
+
+    /**
+     * ROT47 operation.
+     *
+     * @author Matt C [matt@artemisbot.pw]
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_rot47: function(input, args) {
+        var amount = args[0],
+            output = input,
+            chr;
+
+        if (amount) {
+            if (amount < 0) {
+                amount = 94 - (Math.abs(amount) % 94);
+            }
+
+            for (var i = 0; i < input.length; i++) {
+                chr = input[i];
+                if (chr >= 33 && chr <= 126) {
+                    chr = (chr - 33 + amount) % 94;
+                    output[i] = chr + 33;
+                }
+            }
+        }
+        return output;
+    },
+
+
     /**
     /**
      * Rotate right bitwise op.
      * Rotate right bitwise op.
      *
      *

+ 6 - 6
src/static/stats.txt

@@ -1,21 +1,21 @@
 203	source files
 203	source files
-104222	lines
+104274	lines
 4.0M	size
 4.0M	size
 
 
 136	JavaScript source files
 136	JavaScript source files
-95132	lines
-3.4M	size
+95184	lines
+3.5M	size
 
 
 78	third party JavaScript source files
 78	third party JavaScript source files
 76377	lines
 76377	lines
 2.7M	size
 2.7M	size
 
 
 58	first party JavaScript source files
 58	first party JavaScript source files
-18755	lines
-724K	size
+18807	lines
+728K	size
 
 
 3.1M	uncompressed JavaScript size
 3.1M	uncompressed JavaScript size
 1.7M	compressed JavaScript size
 1.7M	compressed JavaScript size
 
 
 15	categories
 15	categories
-152	operations
+153	operations

部分文件因为文件数量过多而无法显示