fix decode error and write some doc
This commit is contained in:
parent
4f941f606b
commit
71885d70ba
10
README.md
10
README.md
|
@ -1,12 +1,14 @@
|
|||
# Super Script Materializer
|
||||
|
||||
Advanced Virtools Script Materializer.
|
||||
[中文文档](./README_ZH.md)
|
||||
|
||||
Export all script into a SQLite database file.
|
||||
Super Virtools Script Materializer.
|
||||
|
||||
Some code come from [BearKidsTeam/Script-Materializer](https://github.com/BearKidsTeam/Script-Materializer) (this project export specific script into a JSON file)
|
||||
Export all script into a SQLite database file. And provide a web page to broswer graph.
|
||||
|
||||
WIP
|
||||
Some code come from [BearKidsTeam/Script-Materializer](https://github.com/BearKidsTeam/Script-Materializer)(this project export specific script into a JSON file) and [BearKidsTeam/VirtoolsScriptDeobfuscation](https://github.com/BearKidsTeam/VirtoolsScriptDeobfuscation).
|
||||
|
||||
WIP. It still lack some function and have some bugs, but it can be used for some normal deobfiscation.
|
||||
|
||||
## Install
|
||||
|
||||
|
|
37
README_ZH.md
Normal file
37
README_ZH.md
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Super Script Materializer
|
||||
|
||||
[English document](./README.md)
|
||||
|
||||
超级Virtools脚本物化器(机翻(确信))
|
||||
|
||||
将Virtools文档中的所有脚本导出成一个SQLite数据库文件,然后经过Python进行排布处理,最后提供一个本地Web前端查看脚本。这同样适用于`Script Hidden`的Virtools脚本,也适用于其中含有不可展开的`Behavior Graph`的脚本。
|
||||
|
||||
物化器不能完全恢复脚本的原有排布,无论原有排布是否存在,物化器都将重新自动生成脚本中的各个元素的位置。某些结构的关系可能会改变(例如Export parameter)但是逻辑思路将不会改变。同时物化器不能将已经生成的结构回写成Virtools可接受的格式,因此物化器只能提供无视脚本隐藏的分析功能。
|
||||
|
||||
本工程代码源于另两个工程:[BearKidsTeam/Script-Materializer](https://github.com/BearKidsTeam/Script-Materializer)(该工程用于将指定脚本导出为JSON文档)和[BearKidsTeam/VirtoolsScriptDeobfuscation](https://github.com/BearKidsTeam/VirtoolsScriptDeobfuscation)(该工程能够在Virtools 3.5中提供内置的隐藏脚本解析功能,将解析结果解析为可以被Virtools识别的格式)
|
||||
|
||||
本项目分为2个部分,`SuperScriptMaterializer`是一个C++工程,将生成一个Virtools界面插件用于导出初步数据,`SuperScriptViewer`是一个Python工程,将解析导出的数据,然后使用Flask提供一个本地Web界面进行脚本查看。
|
||||
|
||||
此项目仍在开发。
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 基本方法
|
||||
|
||||
将Virtools插件投入`InterfacePlugins`目录下,将`sqlite3.dll`和`Dev.exe`放在同一目录。然后启动Virtools,打开需要解析的文档,点击菜单栏的`Super Script Materializer`-`Export all script`,选择要保存到的文件,然后等待Virtools提示你已经导出完成。
|
||||
|
||||
将导出文件重命名为`export.db`并和`SuperScriptViewer.py`放在一起。然后在此目录中运行`python ./SuperScriptViewer.py`,等待Python交互界面提示可以打开本地的网页即可。
|
||||
|
||||
### 使用注意
|
||||
|
||||
- 您需要先安装Virtools, Python和任意一种浏览器才能使用本工程。Python需要先安装`Flask`库。
|
||||
- 导出插件目前只支持Virtools 5,后期会支持Virtools 3.5
|
||||
- 导出插件选择完文件后卡住,或者Python交互界面弹出错误堆栈,这可能是设计失误,请附带您引起bug的文件提交bug
|
||||
- 如果Python交互界面提示数据库`TEXT`类型解码失败,那么可能您需要手动在`DecoratorCore.py`中指定数据库文本解码方式。因为Virtools使用多字节编码,依赖于当前操作系统的代码页,`DecoratorCore.py`做了特殊获取以保证大多数计算机可以直接运行,但仍然不能排除一些特殊情况。
|
||||
- 如果您使用本工程的Release页面中提供的已编译好的Virtools界面插件(现在因为仍然在开发所以没有),您需要放入的`sqlite3.dll`版本应为`sqlite-dll-win32-x86-3310100`
|
||||
|
||||
## 编译
|
||||
|
||||
只有Virtools界面插件需要编译,其余均为解释性语言无需编译。
|
||||
|
||||
需要手动配置Virtools插件的编译参数,例如包含路径等,需要指向您自己的Virtools SDK。对于SQLite SDK,您可以从[sqlite.org](http://www.sqlite.org/)下载,然后使用Visual C++的工具集执行`LIB /DEF:sqlite3.def /machine:IX86`以获取可以用于编译的文件。
|
|
@ -1,9 +1,11 @@
|
|||
import sqlite3
|
||||
import DecoratorConstValue as dcv
|
||||
import json
|
||||
import locale
|
||||
|
||||
def run():
|
||||
exportDb = sqlite3.connect('export.db')
|
||||
exportDb.text_factory = lambda x: x.decode(locale.getpreferredencoding())
|
||||
decorateDb = sqlite3.connect('decorate.db')
|
||||
|
||||
# init table
|
||||
|
|
|
@ -3,6 +3,7 @@ from flask import g
|
|||
from flask import render_template
|
||||
from flask import url_for
|
||||
from flask import request
|
||||
from flask import abort
|
||||
|
||||
from functools import reduce
|
||||
import sqlite3
|
||||
|
@ -47,6 +48,10 @@ def indexHandle():
|
|||
|
||||
@app.route('/<path:scriptPath>', methods=['GET'])
|
||||
def scriptHandle(scriptPath):
|
||||
# fuck favition.ico
|
||||
if '.' in scriptPath:
|
||||
abort(404)
|
||||
|
||||
# comput hamburger
|
||||
pathSlice = scriptPath.split('/')
|
||||
cur = get_db().cursor()
|
||||
|
|
|
@ -15,17 +15,23 @@ function highlightLink(target) {
|
|||
});
|
||||
}
|
||||
|
||||
//apply new highlight
|
||||
$(realTarget).each(function() {
|
||||
if ($(this).hasClass("link-blink")) {
|
||||
$(this).attr("stroke", "yellow")
|
||||
}
|
||||
if ($(this).hasClass("link-blinkDelay")) {
|
||||
$(this).attr("fill", "yellow")
|
||||
}
|
||||
});
|
||||
// double one-click, only cancel highlight and don't apply any hightlight
|
||||
if (realTarget == previousHighlight) {
|
||||
previousHighlight = "";
|
||||
} else {
|
||||
//apply new highlight
|
||||
$(realTarget).each(function() {
|
||||
if ($(this).hasClass("link-blink")) {
|
||||
$(this).attr("stroke", "yellow")
|
||||
}
|
||||
if ($(this).hasClass("link-blinkDelay")) {
|
||||
$(this).attr("fill", "yellow")
|
||||
}
|
||||
});
|
||||
|
||||
previousHighlight = realTarget
|
||||
}
|
||||
|
||||
previousHighlight = realTarget
|
||||
//cancel event seperate
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
|
17
SuperScriptViewer/templates/help.html
Normal file
17
SuperScriptViewer/templates/help.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Super Script Viewer Help</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Super Script Viewer Help</h1>
|
||||
<p>In this file, I will introduce how to use this viewer.</p>
|
||||
<br />
|
||||
<br />
|
||||
<!-- todo: finish this-->
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -19,7 +19,12 @@
|
|||
{% endfor %}
|
||||
</ol>
|
||||
{% endfor %}
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<p>Generated by <a href="https://github.com/yyc12345/SuperScriptMaterializer">SuperScriptMaterializer</a>. All codes are under GPLv3.<br />
|
||||
Powered by <a href="https://github.com/pallets/flask">Flask</a>.<br />
|
||||
Ancestor projects: <a href="https://github.com/BearKidsTeam/VirtoolsScriptDeobfuscation">BearKidsTeam/VirtoolsScriptDeobfuscation</a> and <a href="https://github.com/BearKidsTeam/Script-Materializer">BearKidsTeam/Script-Materializer</a>.<br />
|
||||
Thank <a href="https://github.com/chirs241097">chirs241097</a> and <a href="https://github.com/instr3">2jjy</a>.</p>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
</div>
|
||||
<div style="width: 100px;">
|
||||
<button style="width: 100px; height: 50px;">LEGEND</button>
|
||||
<button style="width: 100px; height: 50px;">Help</button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background: #7f7f7f; width: 100%; height: 100%; overflow: scroll; position: relative;">
|
||||
|
|
Loading…
Reference in New Issue
Block a user