fe11151e7c38c9f3069048235f8cfd6ec7ef69e0
				
			
			
		
	Super Script Materializer
The project consist of two parts:
- SuperScriptMaterializer - Custom Virtools Interface Plugin that allows you to export all scripts/schematics into a SQLite database file
 - SuperScriptViewer - a python parser that creates a web page based on the exported databases to view the schematic in Behavior Graph mode similar to how Virtools Dev displays.
 
The purpose of the project is to allow users to have a backup graph of their scripts from Virtools while providing support for analyzing --Script Hidden-- scripts by decoding the bytecode of .NMS virtools files from .CMO and .VMO.
The inspiration came from:
- BearKidsTeam/Script-Materializer - Allows exporting specific scripts into a JSON file
 - BearKidsTeam/VirtoolsScriptDeobfuscation - A custom interface plugin that loads 
.CMOfiles with hidden scripts and makes them visible and editable. 
NOTE: This project does not give ability to edit hidden scripts within the file. It simply exports and views.
Requirements
- Virtools Dev 3.5, 4.0, or 5.0 with SDK (May work for others)
 - Python 3.0 with Flask module
 - Visual Studio 2015 with at least v140 toolset
 
Build
- Download repository.
 - Get SQLite SDK (amalgamation) and binaries (sqlite-dll-win32-x86) from sqlite.org
 - Extract both SQLite SDK and binaries to the same folder.
 - Open Developer Command Prompt for VS 2015 by typing Developer Command in Windows Search
 - Go to directory where you've extracted SDK and binaries and type 
lib /DEF:sqlite3.def /OUT:sqlite3.lib /MACHINE:x86which will build a lib file for SQLite. - Open SuperScriptMaterializer solution.
 - Edit SuperScriptMaterializer Properties page as necessary:
- General -> Target Platform Version
 - General -> Output Directory
 - General -> Platform Toolset
 - C/C++ -> General -> Additional Include Directories (Add your SQLite path and Virtools Includes Path)
 - Linker -> General -> Output File
 - Linker -> General -> Additional Library Dependencies (Add your SQLite path and Virtools Lib/Win32/Release Path)
 - Linker -> Debugging -> Generate Program Database File
 
 - Clean and Build as Release
 
Usage
Exporting Scripts from Virtools
- Make Sure Virtools Dev is closed.
 - Copy compiled SuperScriptMaterializer.dll into Virtools's InterfacePlugins folder.
 - Copy 
sqlite3.dllyou downloaded into Virtool's base folder (wheredevr.exeexist) - Open Virtools and load a 
.CMOof your choice. - Go to the menu bar and click 
Super Script MaterializerandExport all script. Name itexport.dband save it intoSuperScriptViewerfolder - Go to the menu bar and click 
Super Script MaterializerandExport environment. Name itenv.dband save it intoSuperScriptViewerfolder 
Viewing Exported Databases
- Run the viewer by 
python3 SuperScriptViewer.py - It will generate a unique dectorated database (
decorated.db) used for viewing based onexport.dbandenv.db - Once generated, a webpage will be hosted (default 127.0.0.1:5000) to view all graphs.
 
There is advanced command line switches if needed for the SuperScriptViewer
-i filename.dbspecify an input file to be used asexport.db-e filename.dbspecify an input file to be used asenv.db-o filename.dbspecify an output file to generatedecorated.db. If it already exists, it will used that instead of generating a new one.-fforces the output database to be regenerated (useful if you are unsure if decorated.db matches what export.db and env.db used)
Troubleshooting
- If 
SuperScriptViewer.pydisplaysTEXTtype decoding error, you will need to modifyCustomConfig.pyand edit thedatabase_encodingto whatever encoding system your OS uses since Virtools uses multi-byte encoding and depends on your system's locale. - If Virtools closes upon exporting any databases, please create an issues page noting what Virtools version you have and a link to your file you used to export.
 
Description
				
					Languages
				
				
								
								
									C++
								
								38.6%
							
						
							
								
								
									Python
								
								38.6%
							
						
							
								
								
									HTML
								
								15.4%
							
						
							
								
								
									JavaScript
								
								6.2%
							
						
							
								
								
									CSS
								
								1.1%
							
						
							
								
								
									Other
								
								0.1%