Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
e71f22d0
Commit
e71f22d0
authored
May 14, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance:Core) 优化解码器
1. 移除解码器 `decode_str` 方法, 统一调用 `decode_buff` 方法 2. 解码器解码后, 增加猜解字符编码流程
parent
9ff2d35f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
46 deletions
+32
-46
CHANGELOG.md
CHANGELOG.md
+10
-0
package.json
package.json
+1
-1
default.js
source/core/asp/decoder/default.js
+2
-5
default.js
source/core/aspx/decoder/default.js
+2
-5
base.js
source/core/base.js
+7
-3
default.js
source/core/custom/decoder/default.js
+0
-3
base64.js
source/core/php/decoder/base64.js
+4
-12
default.js
source/core/php/decoder/default.js
+4
-12
rot13.js
source/core/php/decoder/rot13.js
+2
-5
No files found.
CHANGELOG.md
View file @
e71f22d0
...
...
@@ -2,6 +2,16 @@
> 有空会补补BUG、添添新功能。
> 同时也欢迎大家的参与!感谢各位朋友的支持! .TAT.
## `v(2.1.3)`
### 核心模块
*
移除解码器
`decode_str`
方法, 统一调用
`decode_buff`
方法
> `decode_str` 其实相当于是 `decode_buff` 执行后调用了 `toString`
*
解码器解码后, 增加猜解字符编码流程
## 2019/05/13 `v(2.1.2)`
### 核心模块
...
...
package.json
View file @
e71f22d0
{
"name"
:
"antsword"
,
"version"
:
"2.1.2"
,
"version"
:
"2.1.2
.1
"
,
"description"
:
"中国蚁剑是一款跨平台的开源网站管理工具"
,
"main"
:
"app.js"
,
"dependencies"
:
{
...
...
source/core/asp/decoder/default.js
View file @
e71f22d0
...
...
@@ -8,10 +8,7 @@ module.exports = {
asoutput
:
()
=>
{
return
``
.
replace
(
/
\n\s
+/g
,
''
);
},
decode_str
:
(
data
)
=>
{
return
data
;
},
decode_buff
:
(
data
)
=>
{
return
data
;
decode_buff
:
(
buff
)
=>
{
return
buff
;
}
}
\ No newline at end of file
source/core/aspx/decoder/default.js
View file @
e71f22d0
...
...
@@ -8,10 +8,7 @@ module.exports = {
asoutput
:
()
=>
{
return
``
.
replace
(
/
\n\s
+/g
,
''
);
},
decode_str
:
(
data
)
=>
{
return
data
;
},
decode_buff
:
(
data
)
=>
{
return
data
;
decode_buff
:
(
buff
)
=>
{
return
buff
;
}
}
\ No newline at end of file
source/core/base.js
View file @
e71f22d0
...
...
@@ -261,10 +261,14 @@ class Base {
antSword
[
'ipcRenderer'
]
// 请求完毕返回数据{text,buff}
.
once
(
`request-
${
hash
}
`
,
(
event
,
ret
)
=>
{
let
buff
=
this
.
__decoder__
[
this
.
__opts__
[
'decoder'
]
||
'default'
].
decode_buff
(
ret
[
'buff'
],
ext
);
let
encoding
=
antSword
.
Decodes
.
detectEncoding
(
buff
,
{
defaultEncoding
:
"unknown"
});
encoding
=
encoding
!=
"unknown"
?
encoding
:
this
.
__opts__
[
'encode'
];
let
text
=
antSword
.
Decodes
.
decode
(
buff
,
encoding
);
return
res
({
'encoding'
:
ret
[
'encoding'
]
||
""
,
'text'
:
t
his
.
__decoder__
[
this
.
__opts__
[
'decoder'
]
||
'default'
].
decode_str
(
ret
[
'text'
],
ext
)
,
'buff'
:
this
.
__decoder__
[
this
.
__opts__
[
'decoder'
]
||
'default'
].
decode_buff
(
ret
[
'buff'
],
ext
)
'encoding'
:
encoding
||
""
,
'text'
:
t
ext
,
'buff'
:
buff
,
});
})
// HTTP请求返回字节流
...
...
source/core/custom/decoder/default.js
View file @
e71f22d0
...
...
@@ -8,9 +8,6 @@ module.exports = {
asoutput
:
()
=>
{
return
``
.
replace
(
/
\n\s
+/g
,
''
);
},
decode_str
:
(
data
)
=>
{
return
data
;
},
decode_buff
:
(
data
)
=>
{
return
data
;
}
...
...
source/core/php/decoder/base64.js
View file @
e71f22d0
...
...
@@ -14,20 +14,12 @@ module.exports = {
}
`
.
replace
(
/
\n\s
+/g
,
''
);
},
/**
* 解码字符串
* @param {string} data 要被解码的字符串
* @returns {string} 解码后的字符串
*/
decode_str
:
(
data
)
=>
{
return
Buffer
.
from
(
data
,
'base64'
).
toString
();
},
/**
* 解码 Buffer
* @param {
string} data
要被解码的 Buffer
* @returns {
string
} 解码后的 Buffer
* @param {
Buffer} buff
要被解码的 Buffer
* @returns {
Buffer
} 解码后的 Buffer
*/
decode_buff
:
(
data
)
=>
{
return
Buffer
.
from
(
data
.
toString
(),
'base64'
);
decode_buff
:
(
buff
)
=>
{
return
Buffer
.
from
(
buff
.
toString
(),
'base64'
);
}
}
\ No newline at end of file
source/core/php/decoder/default.js
View file @
e71f22d0
...
...
@@ -14,20 +14,12 @@ module.exports = {
}
`
.
replace
(
/
\n\s
+/g
,
''
);
},
/**
* 解码字符串
* @param {string} data 要被解码的字符串
* @returns {string} 解码后的字符串
*/
decode_str
:
(
data
)
=>
{
return
data
;
},
/**
* 解码 Buffer
* @param {
string} data
要被解码的 Buffer
* @returns {
string
} 解码后的 Buffer
* @param {
Buffer} buff
要被解码的 Buffer
* @returns {
Buffer
} 解码后的 Buffer
*/
decode_buff
:
(
data
)
=>
{
return
data
;
decode_buff
:
(
buff
)
=>
{
return
buff
;
}
}
\ No newline at end of file
source/core/php/decoder/rot13.js
View file @
e71f22d0
...
...
@@ -20,10 +20,7 @@ module.exports = {
}
`
.
replace
(
/
\n\s
+/g
,
''
);
},
decode_str
:
(
data
)
=>
{
return
rot13encode
(
data
);
},
decode_buff
:
(
data
)
=>
{
return
Buffer
.
from
(
rot13encode
(
data
.
toString
()));
decode_buff
:
(
buff
)
=>
{
return
Buffer
.
from
(
rot13encode
(
buff
.
toString
()));
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment