Commit 42602cc9 authored by Medicean's avatar Medicean

(Move: Core/JSPJS) JSP_JS 类型改为 JSPJS

parent a9b39301
......@@ -174,7 +174,7 @@ antSword['encoders'] = (function () {
asp: [],
aspx: [],
jsp: [],
jsp_js: [],
jspjs: [],
php: [],
custom: []
};
......@@ -182,7 +182,7 @@ antSword['encoders'] = (function () {
asp: [],
aspx: [],
jsp: [],
jsp_js: [],
jspjs: [],
php: [],
custom: []
};
......@@ -191,7 +191,7 @@ antSword['encoders'] = (function () {
!fs.existsSync(userencoder_path) ?
fs.mkdirSync(userencoder_path) :
null;
['asp', 'aspx', 'php', 'jsp', 'jsp_js','custom'].map((t) => {
['asp', 'aspx', 'php', 'jsp', 'jspjs','custom'].map((t) => {
!fs.existsSync(path.join(userencoder_path, `${t}`)) ?
fs.mkdirSync(path.join(userencoder_path, `${t}`)) :
null;
......@@ -232,7 +232,7 @@ antSword['decoders'] = (function () {
aspx: [],
php: [],
jsp: [],
jsp_js: [],
jspjs: [],
custom: []
};
var decoders_path = {
......@@ -240,7 +240,7 @@ antSword['decoders'] = (function () {
aspx: [],
php: [],
jsp: [],
jsp_js: [],
jspjs: [],
custom: []
};
let userdecoder_path = path.join(remote.process.env.AS_WORKDIR, 'antData/encoders');
......@@ -248,7 +248,7 @@ antSword['decoders'] = (function () {
!fs.existsSync(userdecoder_path) ?
fs.mkdirSync(userdecoder_path) :
null;
['asp', 'aspx', 'php', 'jsp','jsp_js', 'custom'].map((t) => {
['asp', 'aspx', 'php', 'jsp','jspjs', 'custom'].map((t) => {
!fs.existsSync(path.join(userdecoder_path, `${t}`)) ?
fs.mkdirSync(path.join(userdecoder_path, `${t}`)) :
null;
......
......@@ -14,7 +14,7 @@ class Core {
constructor() {
// 加载子模块列表
let cores = {};
['php', 'asp', 'aspx', 'jsp','jsp_js', 'custom', 'php4'].map((_) => {
['php', 'asp', 'aspx', 'jsp','jspjs', 'custom', 'php4'].map((_) => {
cores[_] = require(`./${_}/index`);
});
// 返回子模块对象
......
/**
* jspjs::b64reverse解码器
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc 将返回数据反转
*/
asoutput: () => {
return `function asenc(str){
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return new StringBuffer(ret).reverse();
}
`.replace(/\n\s+/g, '');
},
/**
* 解码 Buffer
* @param {Buffer} buff 要被解码的 Buffer
* @returns {Buffer} 解码后的 Buffer
*/
decode_buff: (buff) => {
return Buffer.from(Buffer.from(buff).reverse().toString(), 'base64');
}
}
\ No newline at end of file
/**
* jspjs::rot13解码器
*/
'use strict';
const rot13encode = (s) => {
//use a Regular Expression to Replace only the characters that are a-z or A-Z
return s.replace(/[a-zA-Z]/g, function (c) {
// Get the character code of the current character and add 13 to it If it is
// larger than z's character code then subtract 26 to support wrap around.
return String.fromCharCode((c <= "Z" ?
90 :
122) >= (c = c.charCodeAt(0) + 13) ?
c :
c - 26);
});
};
module.exports = {
asoutput: (tag_s, tag_e) => {
return `function asenc(str){
importPackage(Packages.sun.misc);
importPackage(Packages.java.util);
var ret = "";
try {
ret = new Base64().getEncoder().encodeToString(str.getBytes());
} catch (e) {
ret = new BASE64Encoder().encode(str.getBytes());
}
ret = ret.replaceAll("\\r|\\n", "");
return ret.replace(/[a-zA-Z]/g,function(c){
return String.fromCharCode((c <= "Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);
});
}
`.replace(/\n\s+/g, '');
},
decode_buff: (buff) => {
return Buffer.from(rot13encode(buff.toString()), 'base64');
}
}
/**
* jsp_js::base64解码器
* jspjs::base64解码器
*/
'use strict';
......
/**
* jspjs::reverse解码器
*/
'use strict';
module.exports = {
/**
* @returns {string} asenc 将返回数据反转
*/
asoutput: () => {
return `function asenc(str){
var h = "0123456789ABCDEF";
var bytes = str.getBytes(cs);
var sb = new StringBuilder(bytes.length * 2);
for (var i = 0; i < bytes.length; i++) {
sb.append(h.charAt((bytes[i] & 0xf0) >> 4));
sb.append(h.charAt((bytes[i] & 0x0f) >> 0));
}
return sb.toString();
}
`.replace(/\n\s+/g, '');
},
/**
* 解码 Buffer
* @param {Buffer} buff 要被解码的 Buffer
* @returns {Buffer} 解码后的 Buffer
*/
decode_buff: (buff) => {
return Buffer.from(buff.toString(), 'hex');
}
}
/**
* JSP_JS服务端脚本模板
* JSPJS服务端脚本模板
* 开写:2021/04/06
* 更新:-
* 作者:yzddMr6 <https://github.com/yzddmr6>
......@@ -8,7 +8,7 @@
const Base = require('../base');
class JSP_JS extends Base {
class JSPJS extends Base {
constructor(opts) {
super(opts);
// 解析模板
......@@ -20,18 +20,18 @@ class JSP_JS extends Base {
'database/mysql',
'database/oracle'
].map((_) => {
this.parseTemplate(`./jsp_js/template/${_}`);
this.parseTemplate(`./jspjs/template/${_}`);
});
// 解析编码器
this
.encoders
.map((_) => {
this.parseEncoder(`./jsp_js/encoder/${_}`);
this.parseEncoder(`./jspjs/encoder/${_}`);
});
this
.decoders
.map((_) => {
this.parseDecoder(`./jsp_js/decoder/${_}`);
this.parseDecoder(`./jspjs/decoder/${_}`);
});
}
......@@ -45,7 +45,7 @@ class JSP_JS extends Base {
}
get decoders() {
return ["default", "base64"];
return ["default", "base64", "hex", "b64reverse", "b64rot13"];
}
/**
* HTTP请求数据组合函数
......@@ -132,4 +132,4 @@ class JSP_JS extends Base {
}
}
module.exports = JSP_JS;
\ No newline at end of file
module.exports = JSPJS;
\ No newline at end of file
//
// 数据库驱动::JSP_JS 支持数据库: Any
// 数据库驱动::JSPJS 支持数据库: Any
// time: 2021/6/5
// by: yzddMr6
//
......@@ -10,7 +10,7 @@ const dialog = antSword.remote.dialog;
const fs = require('fs');
const Decodes = antSword.Decodes;
class JSP_JS {
class JSPJS {
constructor(opt) {
this.opt = opt;
......@@ -930,4 +930,4 @@ class JSP_JS {
}
module.exports = JSP_JS;
\ No newline at end of file
module.exports = JSPJS;
\ No newline at end of file
......@@ -66,10 +66,10 @@ class Encoders {
type: 'button',
text: "JSP"
}, {
id: 'new_jsp_js',
id: 'new_jspjs',
icon: 'file-code-o',
type: 'button',
text: "JSP_JS"
text: "JSPJS"
}, {
type: 'separator'
}, {
......@@ -102,10 +102,10 @@ class Encoders {
type: 'button',
text: "JSP"
}, {
id: 'new_jsp_js_decoder',
id: 'new_jspjs_decoder',
icon: 'file-code-o',
type: 'button',
text: "JSP_JS"
text: "JSPJS"
}, {
type: 'separator'
}, {
......@@ -153,7 +153,7 @@ class Encoders {
case "new_jsp":
that.createEncoder(id);
break;
case "new_jsp_js":
case "new_jspjs":
that.createEncoder(id);
break;
case "new_php":
......@@ -169,7 +169,7 @@ class Encoders {
case "new_jsp_decoder":
that.createEncoder(id, 'decoder');
break;
case "new_jsp_js_decoder":
case "new_jspjs_decoder":
that.createEncoder(id, 'decoder');
break;
case "new_custom_decoder":
......@@ -211,7 +211,7 @@ class Encoders {
combobox.put("aspx", "ASPX");
combobox.put("php", "PHP");
combobox.put("jsp", "JSP");
combobox.put("jsp_js", "JSP_JS");
combobox.put("jspjs", "JSPJS");
combobox.put("custom", "CUSTOM");
grid.attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) {
......@@ -243,7 +243,7 @@ class Encoders {
break
case 2:
// type
if (nValue != "asp" && nValue != "aspx" && nValue != "php" && nValue != "jsp"&& nValue != "jsp_js"&&nValue != "custom") {
if (nValue != "asp" && nValue != "aspx" && nValue != "php" && nValue != "jsp"&& nValue != "jspjs"&&nValue != "custom") {
toastr.error(LANG['message']["etype_error"], LANG_T['error']);
return
}
......@@ -783,23 +783,23 @@ module.exports = {
aspx: [],
php: [],
jsp: [],
jsp_js: [],
custom: []
jspjs: [],
custom: [],
};
var encoders_path = {
asp: [],
aspx: [],
php: [],
jsp: [],
jsp_js: [],
custom: []
jspjs: [],
custom: [],
};
let userencoder_path = path.join(remote.process.env.AS_WORKDIR, 'antData/encoders');
// 初始化
!fs.existsSync(userencoder_path) ?
fs.mkdirSync(userencoder_path) :
null;
['asp', 'aspx', 'php', 'jsp','jsp_js' , 'custom'].map((t) => {
['asp', 'aspx', 'php', 'jsp','jspjs' , 'custom'].map((t) => {
!fs.existsSync(path.join(userencoder_path, `${t}`)) ?
fs.mkdirSync(path.join(userencoder_path, `${t}`)) :
null;
......@@ -834,7 +834,7 @@ module.exports = {
aspx: [],
php: [],
jsp: [],
jsp_js: [],
jspjs: [],
custom: []
};
var decoders_path = {
......@@ -842,7 +842,7 @@ module.exports = {
aspx: [],
php: [],
jsp: [],
jsp_js: [],
jspjs: [],
custom: []
};
let userdecoder_path = path.join(remote.process.env.AS_WORKDIR, 'antData/encoders');
......@@ -850,7 +850,7 @@ module.exports = {
!fs.existsSync(userdecoder_path) ?
fs.mkdirSync(userdecoder_path) :
null;
['asp', 'aspx', 'php', 'jsp','jsp_js', 'custom'].map((t) => {
['asp', 'aspx', 'php', 'jsp','jspjs', 'custom'].map((t) => {
!fs.existsSync(path.join(userdecoder_path, `${t}`)) ?
fs.mkdirSync(path.join(userdecoder_path, `${t}`)) :
null;
......
......@@ -281,7 +281,7 @@ class Form {
} else if (file_match.jsp.test(id) == true) {
typecombo.selectOption(typecombo.getOption('jsp').index);
} else if (file_match.jsp.test(id) == true) {
typecombo.selectOption(typecombo.getOption('jsp_js').index);
typecombo.selectOption(typecombo.getOption('jspjs').index);
} else if (file_match.custom.test(id) == true) {
typecombo.selectOption(typecombo.getOption('custom').index);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment