├── .gitignore ├── data ├── icons │ ├── form.png │ ├── info.png │ ├── import.png │ ├── settings.png │ ├── search-property.png │ ├── import.svg │ ├── export.svg │ ├── mine-cart.svg │ ├── file-explorer.svg │ ├── save.svg │ ├── settings.svg │ ├── create-document.svg │ ├── microscope.svg │ └── open-archive.svg ├── fonts │ ├── VICTORMONO-BOLD.TTF │ ├── VICTORMONO-THIN.TTF │ ├── VICTORMONO-ITALIC.TTF │ ├── VICTORMONO-LIGHT.TTF │ ├── VICTORMONO-MEDIUM.TTF │ ├── VICTORMONO-OBLIQUE.TTF │ ├── VICTORMONO-REGULAR.TTF │ ├── VICTORMONO-SEMIBOLD.TTF │ ├── VICTORMONO-BOLDITALIC.TTF │ ├── VICTORMONO-BOLDOBLIQUE.TTF │ ├── VICTORMONO-EXTRALIGHT.TTF │ ├── VICTORMONO-LIGHTITALIC.TTF │ ├── VICTORMONO-MEDIUMITALIC.TTF │ ├── VICTORMONO-THINITALIC.TTF │ ├── VICTORMONO-SEMIBOLDITALIC.TTF │ ├── VICTORMONO-EXTRALIGHTITALIC.TTF │ └── load.css ├── tab-content │ ├── home.html │ ├── share.css │ ├── vtable.html │ └── search.html ├── common │ ├── vlist.css │ ├── font.css │ ├── plus-routes.css │ ├── base.css │ ├── lib.tis │ ├── folder-tree.css │ ├── animate.tis │ ├── plus.css │ ├── plus-routes.tis │ ├── folder-tree.tis │ ├── frame.css │ ├── controls.css │ ├── sqlite3.tis │ ├── virtual-tree.tis │ └── controls.tis ├── settings.html ├── wizard │ ├── share.css │ ├── index.html │ ├── export.html │ ├── import.html │ └── process.html ├── menu.html ├── main.htm ├── wizard.html ├── explorer.html └── browser.html ├── common ├── CMakeLists.txt ├── dumpcommon.h └── windowscommon.h ├── TaskPool ├── CMakeLists.txt ├── TaskPool.h └── TaskPool.cpp ├── BedrockExt ├── version.h.in ├── UI.manifest ├── CMakeLists.txt ├── version.rc.in └── main.cpp ├── CLI ├── CMakeLists.txt └── ostream_joiner.h ├── ELF ├── CMakeLists.txt ├── elf.cpp └── include │ └── elf.h ├── Adapter ├── CMakeLists.txt ├── include │ └── adapter.h ├── itanium.cpp └── msvc.cpp ├── sqlite3 ├── SymbolTokenizer.h ├── sciter-sqlite.cpp ├── CMakeLists.txt ├── sciter-sqlite.h ├── sciter-sqlite-db.cpp ├── sciter-sqlite-rs.cpp └── SymbolTokenizer.cpp ├── WindowExt ├── CMakeLists.txt ├── hiddenapi.h └── main.cpp ├── PDB ├── include │ └── pdb.h ├── CMakeLists.txt └── pdb.cpp ├── Demangler ├── CMakeLists.txt ├── Demangler.cpp └── include │ ├── DemangleConfig.h │ ├── StringView.h │ ├── Demangle.h │ ├── Utility.h │ └── MicrosoftDemangle.h ├── .clang-format └── CMakeLists.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .vs 2 | .vscode 3 | build 4 | out 5 | CMakeSettings.json -------------------------------------------------------------------------------- /data/icons/form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/icons/form.png -------------------------------------------------------------------------------- /data/icons/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/icons/info.png -------------------------------------------------------------------------------- /data/icons/import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/icons/import.png -------------------------------------------------------------------------------- /data/icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/icons/settings.png -------------------------------------------------------------------------------- /common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (common INTERFACE) 2 | target_include_directories (common INTERFACE .) -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-BOLD.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-BOLD.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-THIN.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-THIN.TTF -------------------------------------------------------------------------------- /data/icons/search-property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/icons/search-property.png -------------------------------------------------------------------------------- /TaskPool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (TaskPool TaskPool.cpp) 2 | target_include_directories (TaskPool PUBLIC .) -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-ITALIC.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-ITALIC.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-LIGHT.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-LIGHT.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-MEDIUM.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-MEDIUM.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-OBLIQUE.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-OBLIQUE.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-REGULAR.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-REGULAR.TTF -------------------------------------------------------------------------------- /BedrockExt/version.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define BDSDVERSION L"@BDSD_NUMBER@.@BDSD_VERSION@.@BDSD_BUILD_NUMBER@" -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-SEMIBOLD.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-SEMIBOLD.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-BOLDITALIC.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-BOLDITALIC.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-BOLDOBLIQUE.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-BOLDOBLIQUE.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-EXTRALIGHT.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-EXTRALIGHT.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-LIGHTITALIC.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-LIGHTITALIC.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-MEDIUMITALIC.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-MEDIUMITALIC.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-THINITALIC.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-THINITALIC.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-SEMIBOLDITALIC.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-SEMIBOLDITALIC.TTF -------------------------------------------------------------------------------- /data/fonts/VICTORMONO-EXTRALIGHTITALIC.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codehz/BDSD/HEAD/data/fonts/VICTORMONO-EXTRALIGHTITALIC.TTF -------------------------------------------------------------------------------- /data/tab-content/home.html: -------------------------------------------------------------------------------- 1 | 7 |
8 | home 9 |
-------------------------------------------------------------------------------- /CLI/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable (symutils "main.cpp" "ostream_joiner.h") 2 | target_link_libraries (symutils elf pdb Demangler adapter sqlite3 SymbolTokenizer) -------------------------------------------------------------------------------- /ELF/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (elf "elf.cpp" "include/elf.h") 2 | target_link_libraries (elf PUBLIC common) 3 | target_include_directories (elf INTERFACE include) -------------------------------------------------------------------------------- /data/common/vlist.css: -------------------------------------------------------------------------------- 1 | vlist { 2 | display: block; 3 | overflow: scroll-indicator; 4 | prototype: VList url(vlist.tis); 5 | } 6 | 7 | vlist > li { 8 | display:block; 9 | } -------------------------------------------------------------------------------- /data/settings.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /data/common/font.css: -------------------------------------------------------------------------------- 1 | @import url(../fonts/load.css); 2 | 3 | html { 4 | font-family: 'Victor Mono'; 5 | font-rendering-mode: sub-pixel; 6 | font-size: 14dip; 7 | color: black; 8 | } -------------------------------------------------------------------------------- /Adapter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (adapter "itanium.cpp" "include/adapter.h" "msvc.cpp") 2 | target_link_libraries (adapter PRIVATE Demangler) 3 | target_include_directories (adapter INTERFACE include) -------------------------------------------------------------------------------- /data/common/plus-routes.css: -------------------------------------------------------------------------------- 1 | @import url(plus.css); 2 | 3 | /*main - sandbox for views*/ 4 | main { 5 | aspect: "Plus.Application" url(plus-routes.tis); 6 | size:*; 7 | overflow:auto; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /data/common/base.css: -------------------------------------------------------------------------------- 1 | html { 2 | var(real-accent-color): rgb(0, 120, 210); 3 | var(accent-color): rgb(0, 0, 0); 4 | var(back-color): rgb(128, 128, 128); 5 | } 6 | html:owns-focus { 7 | var(accent-color): color(real-accent-color); 8 | } -------------------------------------------------------------------------------- /sqlite3/SymbolTokenizer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct sqlite3; 4 | struct sqlite3_api_routines; 5 | 6 | extern "C" __declspec(dllimport) int sqlite3_symboltokenizer_init( 7 | sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi); -------------------------------------------------------------------------------- /WindowExt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (WindowExt SHARED main.cpp "hiddenapi.h") 2 | target_link_libraries (WindowExt PRIVATE Dwmapi) 3 | target_include_directories (WindowExt PRIVATE ${SCITERSDK}/include) 4 | target_include_directories (WindowExt PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -------------------------------------------------------------------------------- /PDB/include/pdb.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace pdb { 10 | 11 | using namespace common; 12 | 13 | ISymbolDumper &GetDumper(); 14 | 15 | } // namespace pdb -------------------------------------------------------------------------------- /data/common/lib.tis: -------------------------------------------------------------------------------- 1 | try { 2 | include library "BedrockExt"; 3 | include library "WindowExt"; 4 | include library "DatabaseExt"; 5 | include "sqlite3.tis"; 6 | } catch (e) { 7 | view.msgbox(#alert, String.$(Failed to load library, please re-install: {"\n"}{e})); 8 | view.close(); 9 | } -------------------------------------------------------------------------------- /data/wizard/share.css: -------------------------------------------------------------------------------- 1 | @import url(../common/font.css); 2 | @import url(../common/controls.css); 3 | @import url(../common/plus.css); 4 | 5 | :root { 6 | background: none; 7 | padding: 16dip; 8 | flow: horizontal; 9 | border-spacing: 16dip; 10 | } 11 | 12 | .pad { 13 | size: *; 14 | } 15 | 16 | .bottom { 17 | flow: horizontal; 18 | border-spacing: 8dip; 19 | } -------------------------------------------------------------------------------- /Demangler/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (Demangler 2 | "MicrosoftDemangle.cpp" 3 | "MicrosoftDemangleNodes.cpp" 4 | "ItaniumDemangle.cpp" 5 | "include/StringView.h" 6 | "include/Demangle.h" 7 | "include/DemangleConfig.h" 8 | "include/MicrosoftDemangle.h" 9 | "include/MicrosoftDemangleNodes.h" 10 | "include/ItaniumDemangle.h" 11 | "include/Utility.h" "Demangler.cpp" ) 12 | target_include_directories (Demangler INTERFACE "include") -------------------------------------------------------------------------------- /TaskPool/TaskPool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class TaskPool { 10 | bool stop = false; 11 | std::mutex mtx; 12 | std::thread thread; 13 | std::condition_variable cv; 14 | std::queue> tasks; 15 | 16 | void Worker(); 17 | 18 | public: 19 | TaskPool(); 20 | ~TaskPool(); 21 | void AddTask(std::function &&); 22 | }; -------------------------------------------------------------------------------- /BedrockExt/UI.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /BedrockExt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (BedrockExt SHARED main.cpp UI.manifest) 2 | target_link_libraries (BedrockExt PRIVATE Demangler elf pdb adapter sqlite3 TaskPool) 3 | target_include_directories (BedrockExt PRIVATE ${SCITERSDK}/include) 4 | target_include_directories (BedrockExt PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) 5 | 6 | configure_file ( 7 | ${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in 8 | ${CMAKE_CURRENT_BINARY_DIR}/version.rc 9 | @ONLY) 10 | configure_file ( 11 | ${CMAKE_CURRENT_SOURCE_DIR}/version.h.in 12 | ${CMAKE_CURRENT_BINARY_DIR}/version.h 13 | @ONLY) 14 | 15 | target_sources (BedrockExt PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/version.rc) -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | IndentWidth: 2 3 | ColumnLimit: 120 4 | AlignConsecutiveAssignments: true 5 | AlignAfterOpenBracket: AlwaysBreak 6 | AlignTrailingComments: true 7 | AllowAllParametersOfDeclarationOnNextLine: false 8 | AllowShortBlocksOnASingleLine: true 9 | AllowShortCaseLabelsOnASingleLine: true 10 | AllowShortIfStatementsOnASingleLine: true 11 | AllowShortLoopsOnASingleLine: true 12 | AlwaysBreakBeforeMultilineStrings: true 13 | BinPackArguments: true 14 | BinPackParameters: true 15 | IndentPPDirectives: AfterHash 16 | PointerAlignment: Right 17 | SpaceAfterCStyleCast: true 18 | SpacesBeforeTrailingComments: 1 19 | IncludeBlocks: Preserve 20 | SortIncludes: false -------------------------------------------------------------------------------- /data/wizard/index.html: -------------------------------------------------------------------------------- 1 | 14 |

15 | In order to create a new project, 16 | you need to provide the bedrock_server file and bedrock_server.pdb file 17 | from official website 18 | (link). 19 |

20 |

Now click next button.

21 | 22 | 23 | 24 | Next 25 | 26 | -------------------------------------------------------------------------------- /sqlite3/sciter-sqlite.cpp: -------------------------------------------------------------------------------- 1 | #include "sciter-sqlite.h" 2 | #include "sqlite3.h" 3 | #include "SymbolTokenizer.h" 4 | 5 | extern "C" { 6 | 7 | #ifndef WINDOWS 8 | __attribute__((visibility("default"))) 9 | #else 10 | __declspec(dllexport) 11 | #endif 12 | BOOL SCAPI 13 | SciterLibraryInit(ISciterAPI *psapi, SCITER_VALUE *plibobject) { 14 | _SAPI(psapi); 15 | sqlite3_initialize(); 16 | sqlite3_auto_extension((void (*)()) sqlite3_symboltokenizer_init); 17 | static sciter::om::hasset sqlite_root = new sqlite::SQLite(); // invloked once (C++ static convention) 18 | *plibobject = sciter::value::wrap_asset(sqlite_root); 19 | return TRUE; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data/common/folder-tree.css: -------------------------------------------------------------------------------- 1 | widget[type="folder-tree"] { style-set: std-folder-tree; } 2 | 3 | @set std-folder-tree < std-tree { 4 | :root { 5 | prototype: FolderTree url(folder-tree.tis); 6 | border-spacing: 4dip; 7 | overflow: scroll-indicator; 8 | } 9 | 10 | option { 11 | border-spacing: 4dip; 12 | } 13 | 14 | option:not(:node) { 15 | padding: 0; 16 | } 17 | 18 | option > text { 19 | behavior: file-icon; 20 | line-height: 18dip; 21 | padding: 1dip 3dip 1dip 20dip; 22 | foreground-repeat: no-repeat; 23 | foreground-position: 0 50%; 24 | min-width: 4em; 25 | } 26 | 27 | option > text:rtl { 28 | padding: 1dip 20dip 1dip 3dip; 29 | foreground-position: 100% 50%; 30 | } 31 | } -------------------------------------------------------------------------------- /data/icons/import.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common/dumpcommon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace common { 8 | 9 | class DumpError : std::runtime_error { 10 | using runtime_error::runtime_error; 11 | }; 12 | 13 | struct Symbol { 14 | std::string Name; 15 | uint64_t Offset; 16 | }; 17 | 18 | class ISymbolIterator { 19 | public: 20 | virtual ~ISymbolIterator() {} 21 | virtual Symbol Get() = 0; 22 | virtual bool Next() = 0; 23 | }; 24 | 25 | class IDumpSource { 26 | public: 27 | virtual ~IDumpSource() {} 28 | virtual std::unique_ptr GetIterator() = 0; 29 | }; 30 | 31 | class ISymbolDumper { 32 | public: 33 | virtual ~ISymbolDumper() {} 34 | virtual std::unique_ptr Open(std::filesystem::path const &path) = 0; 35 | }; 36 | 37 | } // namespace common -------------------------------------------------------------------------------- /data/icons/export.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/wizard/export.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | save 23 | 24 | 25 |

Now click next to build project database

26 | 27 | 28 | 29 | Prev 30 | Build Database 31 | 32 | -------------------------------------------------------------------------------- /TaskPool/TaskPool.cpp: -------------------------------------------------------------------------------- 1 | #include "TaskPool.h" 2 | 3 | TaskPool::TaskPool() : thread{std::bind_front(&TaskPool::Worker, this)} {} 4 | 5 | TaskPool::~TaskPool() { 6 | { 7 | std::lock_guard lock{mtx}; 8 | stop = true; 9 | } 10 | cv.notify_all(); 11 | if (thread.joinable()) thread.join(); 12 | } 13 | 14 | void TaskPool::AddTask(std::function &&fn) { 15 | std::unique_lock lock{mtx}; 16 | auto may_wait = tasks.empty(); 17 | tasks.emplace(std::move(fn)); 18 | lock.unlock(); 19 | cv.notify_all(); 20 | } 21 | 22 | void TaskPool::Worker() { 23 | while (true) { 24 | std::unique_lock lock{mtx}; 25 | if (!tasks.empty()) { 26 | auto task = std::move(tasks.front()); 27 | tasks.pop(); 28 | lock.unlock(); 29 | task(); 30 | } else if (stop) 31 | return; 32 | else 33 | cv.wait(lock); 34 | } 35 | } -------------------------------------------------------------------------------- /data/wizard/import.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | ELF 19 | 20 | 21 | 22 | PDB 23 | 24 | 25 | 26 | 27 | 28 | Prev 29 | Next 30 | 31 | -------------------------------------------------------------------------------- /data/tab-content/share.css: -------------------------------------------------------------------------------- 1 | @import url(../common/controls.css); 2 | 3 | :root { 4 | background: none; 5 | color: black; 6 | } 7 | 8 | toolbar { 9 | display: block; 10 | flow: horizontal; 11 | width: *; 12 | height: 32dip; 13 | padding: 0 16dip; 14 | border-spacing: 16dip; 15 | background: morph(color(accent-color), opacity: 28%); 16 | } 17 | toolbar > .pad { 18 | size: *; 19 | } 20 | toolbar > #stat { 21 | font-size: 12dip; 22 | margin: * 0; 23 | } 24 | vlist { 25 | display: block; 26 | padding: 16dip 0; 27 | padding-top: 0; 28 | size: *; 29 | overflow-x: hidden; 30 | overflow-y: scroll-indicator; 31 | } 32 | #error-output:empty { 33 | display: none; 34 | } 35 | #error-output:not(:empty) { 36 | display: block; 37 | size: *; 38 | padding: 32dip 16dip; 39 | // font-size: 20dip; 40 | vertical-align: middle; 41 | white-space: pre-wrap; 42 | word-break: break-all; 43 | overflow-wrap: break-word; 44 | overflow: hidden; 45 | } 46 | #error-output:not(:empty) + vlist { 47 | display: none; 48 | } -------------------------------------------------------------------------------- /sqlite3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library (sqlite3 "sqlite3.c") 2 | target_compile_definitions (sqlite3 PUBLIC 3 | -DSQLITE_ENABLE_FTS5 4 | -DSQLITE_DQS=0 5 | -DSQLITE_DEFAULT_MEMSTATUS=0 6 | -DSQLITE_LIKE_DOESNT_MATCH_BLOBS 7 | -DSQLITE_MAX_EXPR_DEPTH=0 8 | -DSQLITE_OMIT_DEPRECATED 9 | -DSQLITE_ENABLE_COLUMN_METADATA 10 | -DSQLITE_OMIT_PROGRESS_CALLBACK 11 | -DSQLITE_OMIT_SHARED_CACHE 12 | -DSQLITE_USE_ALLOCA 13 | -DSQLITE_OMIT_AUTOINIT) 14 | target_include_directories (sqlite3 INTERFACE .) 15 | 16 | add_library (SymbolTokenizer SHARED "SymbolTokenizer.cpp" "SymbolTokenizer.h") 17 | 18 | add_executable (sqlite3cli "shell.c") 19 | target_link_libraries (sqlite3cli PRIVATE sqlite3) 20 | set_target_properties (sqlite3cli PROPERTIES OUTPUT_NAME "sqlite3") 21 | 22 | add_library (DatabaseExt SHARED "sciter-sqlite.cpp" "sciter-sqlite-db.cpp" "sciter-sqlite-rs.cpp") 23 | target_link_libraries (DatabaseExt PRIVATE sqlite3 SymbolTokenizer TaskPool) 24 | target_include_directories (DatabaseExt PRIVATE ${SCITERSDK}/include) 25 | target_include_directories (DatabaseExt PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -------------------------------------------------------------------------------- /PDB/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(MSVC_DIA_SDK_DIR "$ENV{VSINSTALLDIR}DIA SDK" CACHE PATH 2 | "Path to the DIA SDK") 3 | 4 | if (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64) 5 | set (DIAARCH "/amd64") 6 | elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm) 7 | set(DIAARCH "/arm") 8 | elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) 9 | set(DIAARCH "/arm64") 10 | else () 11 | set(DIAARCH "") 12 | endif () 13 | 14 | add_library (DIA STATIC IMPORTED) 15 | set_target_properties (DIA PROPERTIES IMPORTED_LOCATION ${MSVC_DIA_SDK_DIR}/lib${DIAARCH}/diaguids.lib) 16 | target_include_directories (DIA INTERFACE ${MSVC_DIA_SDK_DIR}/include) 17 | target_link_directories (DIA INTERFACE ${MSVC_DIA_SDK_DIR}/lib${DIAARCH}) 18 | 19 | add_library (pdb "include/pdb.h" "pdb.cpp") 20 | target_link_libraries (pdb PRIVATE DIA common) 21 | target_include_directories (pdb INTERFACE include) 22 | 23 | add_custom_command (TARGET pdb POST_BUILD 24 | COMMAND ${CMAKE_COMMAND} -E copy_if_different 25 | ${MSVC_DIA_SDK_DIR}/bin${DIAARCH}/msdia140.dll 26 | ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) 27 | -------------------------------------------------------------------------------- /data/common/animate.tis: -------------------------------------------------------------------------------- 1 | function abs(a) { 2 | return a < (a * 0) ? -a : a; 3 | } 4 | 5 | export default class Animation { 6 | this var state = false; 7 | 8 | function this(element, applyFn, current, speed, epsilon) { 9 | this.element = element; 10 | this.applyFn = applyFn; 11 | this.current = current; 12 | this.target = target; 13 | this.speed = speed; 14 | this.epsilon = epsilon; 15 | } 16 | 17 | function to(target) { 18 | this.target = target; 19 | if (!this.state) { 20 | this.state = true; 21 | this.element.animate(||this.next()); 22 | } 23 | } 24 | 25 | function next() { 26 | if (abs(this.current - this.target) >= this.epsilon) { 27 | this.current = Length.morph(this.current, this.target, this.speed); 28 | this.applyFn.call(this.element, this.current); 29 | } else { 30 | this.current = this.target; 31 | this.applyFn.call(this.element, this.current); 32 | this.state = false; 33 | } 34 | return this.state; 35 | } 36 | } 37 | 38 | export function @animate(applyFn, element, current, speed, epsilon) { 39 | return new Animation(element, applyFn, current, speed, epsilon) 40 | } -------------------------------------------------------------------------------- /data/wizard/process.html: -------------------------------------------------------------------------------- 1 | 20 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/icons/mine-cart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/common/plus.css: -------------------------------------------------------------------------------- 1 | 2 | /* principal handlers */ 3 | [model] {aspect:"Plus.Model" url(plus.tis); } 4 | [model] [each], [model][each] { aspect:"Plus.EachRepeater"; } /* note repeater shall come first before [model] [name] for */ 6 | [model] [name], [model][name] { aspect:"Plus.Terminal"; } 7 | [model] [class*='{{'], [model][class*='{{'] { aspect:"Plus.ClassTerminal"; } 8 | [model] [value*='{{'], [model][value*='{{'] { aspect:"Plus.valAttrTerminal"; } 9 | [model] [href*='{{'], [model][href*='{{'] { aspect:"Plus.hrefAttrTerminal"; } 10 | [model] [src*='{{'], [model][src*='{{'] { aspect:"Plus.srcAttrTerminal"; } 11 | 12 | /* any attribute with the name starting from '@' is considered as bound: */ 13 | [model] *:has-bound-attributes { aspect:"Plus.boundAttributesTerminal"; } 14 | 15 | /* auxiliary event handlers */ 16 | [model] [click] { aspect:"Plus.Click"; } 17 | [model] [dblclick] { aspect:"Plus.DblClick"; } 18 | [model] [change] { aspect:"Plus.Change"; } 19 | [model] [enter] { aspect:"Plus.Enter"; } 20 | [model] [escape] { aspect:"Plus.Escape"; } 21 | [model] [focusin] { aspect:"Plus.FocusIn"; } 22 | [model] [focusout] { aspect:"Plus.FocusOut"; } 23 | 24 | 25 | -------------------------------------------------------------------------------- /Demangler/Demangler.cpp: -------------------------------------------------------------------------------- 1 | //===-- Demangle.cpp - Common demangling functions ------------------------===// 2 | // 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 | // See https://llvm.org/LICENSE.txt for license information. 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 | // 7 | //===----------------------------------------------------------------------===// 8 | /// 9 | /// \file This file contains definitions of common demangling functions. 10 | /// 11 | //===----------------------------------------------------------------------===// 12 | 13 | #include "include/Demangle.h" 14 | #include 15 | 16 | static bool isItaniumEncoding(const std::string &MangledName) { 17 | size_t Pos = MangledName.find_first_not_of('_'); 18 | // A valid Itanium encoding requires 1-4 leading underscores, followed by 'Z'. 19 | return Pos > 0 && Pos <= 4 && MangledName[Pos] == 'Z'; 20 | } 21 | 22 | std::string llvm::demangle(const std::string &MangledName) { 23 | char *Demangled; 24 | if (isItaniumEncoding(MangledName)) 25 | Demangled = itaniumDemangle(MangledName.c_str(), nullptr, nullptr, nullptr); 26 | else 27 | Demangled = microsoftDemangle(MangledName.c_str(), nullptr, nullptr, nullptr, nullptr); 28 | 29 | if (!Demangled) return MangledName; 30 | 31 | std::string Ret = Demangled; 32 | std::free(Demangled); 33 | return Ret; 34 | } -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.14) 2 | 3 | project (BDSD) 4 | 5 | set (CMAKE_CXX_STANDARD 20) 6 | set (CMAKE_CXX_STANDARD_REQUIRED ON) 7 | 8 | set (BDSD_NUMBER 0) 9 | set (BDSD_VERSION 1) 10 | set (BDSD_BUILD_NUMBER 0) 11 | 12 | add_compile_options (/wd26812) 13 | add_definitions (/DWINDOWS /DNOMINMAX /D_CRT_SECURE_NO_WARNINGS /DUNICODE /DWIN32_LEAN_AND_MEAN) 14 | 15 | set (SCITERSDK $ENV{SCITERSDK} CACHE PATH "Sciter SDK Path") 16 | if (NOT IS_DIRECTORY "${SCITERSDK}") 17 | message (FATAL_ERROR "ENV:SCITERSDK NOT FOUND") 18 | endif () 19 | 20 | if (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64) 21 | set (SCITERATCH "x64") 22 | elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm) 23 | message (FATAL_ERROR "ARCH NOT SUPPORT") 24 | elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) 25 | set (SCITERATCH "arm64") 26 | else () 27 | set (SCITERATCH "x32") 28 | endif () 29 | 30 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 31 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 32 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 33 | 34 | add_subdirectory ("common") 35 | add_subdirectory ("TaskPool") 36 | add_subdirectory ("Demangler") 37 | add_subdirectory ("PDB") 38 | add_subdirectory ("ELF") 39 | add_subdirectory ("Adapter") 40 | add_subdirectory ("sqlite3") 41 | add_subdirectory ("BedrockExt") 42 | add_subdirectory ("WindowExt") 43 | add_subdirectory ("CLI") -------------------------------------------------------------------------------- /data/icons/file-explorer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/common/plus-routes.tis: -------------------------------------------------------------------------------- 1 | include "plus.tis"; 2 | 3 | // the routes thing 4 | function Plus.Application() { 5 | 6 | assert !Plus.app : "only one instance allowed!"; 7 | 8 | var main = $(main); 9 | assert main : "
shall exist"; 10 | 11 | var routes = []; // [{path:"/xxx", url:"..." }] 12 | var path = ""; 13 | var param = null; 14 | 15 | function go(topath, andparam = null) { 16 | for (var route in routes) 17 | if (route.path like topath) { 18 | if (path == topath && param == andparam) 19 | main.postEvent("reset"); 20 | else if (path != topath) { 21 | path = route.path; 22 | param = andparam; 23 | main.update(::main.load(self.url(route.url))); // do transactional update to reduce visual effects 24 | main.postEvent("routechange"); 25 | var (total,free,used) = gc(); 26 | //stdout.println("gc", total,free,used); 27 | } else { 28 | main.postEvent("paramchange"); 29 | } 30 | return; 31 | } 32 | throw "Plus.app: unknown path:" + path; 33 | } 34 | 35 | var app = { go:go }; 36 | 37 | // anything clickable with href works like hyperlink 38 | self << event click $([href]) { 39 | var param = this.attributes["param"] || null; 40 | go( this.attributes["href"], param ); 41 | return true; 42 | } 43 | 44 | Plus.app = app; 45 | 46 | app.routes = property(v) { 47 | get return routes; 48 | set { routes = v; } 49 | } 50 | 51 | app.path = property(v) { 52 | get return path; 53 | set { throw "use app.go() to navigate to path"; } 54 | } 55 | 56 | app.param = property(v) { 57 | get return param; 58 | set { param = v; } 59 | } 60 | 61 | // Voulez vous danser ? 62 | main.post(:: go(routes[0].path)); 63 | } 64 | -------------------------------------------------------------------------------- /data/icons/save.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/icons/settings.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BedrockExt/version.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define VER_FILEVERSION @BDSD_NUMBER@,@BDSD_VERSION@,@BDSD_BUILD_NUMBER@,0 4 | #define VER_FILEVERSION_STR "@BDSD_NUMBER@.@BDSD_VERSION@.@BDSD_BUILD_NUMBER@.0\0" 5 | 6 | #define VER_PRODUCTVERSION @BDSD_NUMBER@,@BDSD_VERSION@,@BDSD_BUILD_NUMBER@,0 7 | #define VER_PRODUCTVERSION_STR "@BDSD_NUMBER@.@BDSD_VERSION@.@BDSD_BUILD_NUMBER@\0" 8 | 9 | #define VER_PRIVATEBUILD 0 10 | #define VER_PRERELEASE 0 11 | 12 | #define VER_COMPANYNAME_STR "codehz.one" 13 | #define VER_FILEDESCRIPTION_STR "Bedrock Dedicated Server Symbol Dumper" 14 | #define VER_INTERNALNAME_STR "BDSD" 15 | #define VER_LEGALCOPYRIGHT_STR "Created by CodeHz" 16 | #define VER_ORIGINALFILENAME_STR "BedrockExt.dll" 17 | #define VER_PRODUCTNAME_STR "Bedrock Dedicated Server Symbol Dumper" 18 | 19 | #ifndef DEBUG 20 | #define VER_DEBUG 0 21 | #else 22 | #define VER_DEBUG VS_FF_DEBUG 23 | #endif 24 | 25 | VS_VERSION_INFO VERSIONINFO 26 | FILEVERSION VER_FILEVERSION 27 | PRODUCTVERSION VER_PRODUCTVERSION 28 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 29 | FILEFLAGS (VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG) 30 | FILEOS VOS__WINDOWS32 31 | FILETYPE VFT_APP 32 | FILESUBTYPE VFT2_UNKNOWN 33 | BEGIN 34 | BLOCK "StringFileInfo" 35 | BEGIN 36 | BLOCK "040904E4" 37 | BEGIN 38 | VALUE "CompanyName", VER_COMPANYNAME_STR 39 | VALUE "FileDescription", VER_FILEDESCRIPTION_STR 40 | VALUE "FileVersion", VER_FILEVERSION_STR 41 | VALUE "InternalName", VER_INTERNALNAME_STR 42 | VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR 43 | VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR 44 | VALUE "ProductName", VER_PRODUCTNAME_STR 45 | VALUE "ProductVersion", VER_PRODUCTVERSION_STR 46 | END 47 | END 48 | 49 | BLOCK "VarFileInfo" 50 | BEGIN 51 | VALUE "Translation", 0x409, 1252 52 | END 53 | END -------------------------------------------------------------------------------- /data/icons/create-document.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/menu.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 32 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /data/common/folder-tree.tis: -------------------------------------------------------------------------------- 1 | import { VirtualTree } from "virtual-tree.tis"; 2 | 3 | export class FolderTree : VirtualTree { 4 | function attached() { 5 | this.filters = (this.@#filter || "*").split(";"); 6 | this.folderonly = this.attributes.exists("folder-only"); 7 | } 8 | 9 | function eachRoot(cb) { 10 | var drives = []; 11 | 12 | function w(name, flags, caption) { 13 | if(flags & (System.IS_HIDDEN | System.IS_SYSTEM)) return true; // skip it 14 | if((flags & System.IS_DIR) != 0) 15 | drives.push({name:name,caption:caption}); 16 | return true; 17 | } 18 | System.scanFiles("/*.*", w); 19 | 20 | drives.sort(:a,b: a.name.lexicalCompare(b.name)); 21 | 22 | if( System.PLATFORM == #Windows ) // on Windows FS is a forest 23 | for(var n in drives) 24 | cb(n.caption + " ("+ n.name +")",n.name, true); 25 | else // on Posix FS is a tree 26 | for(var n in drives) 27 | cb(n.caption,"/" + n.name, true); 28 | } 29 | 30 | function eachChild(path, cb) 31 | { 32 | var folders = []; 33 | var files = []; 34 | var filters = this.filters; 35 | 36 | function accept(name) { 37 | for(var filter in filters) 38 | if(name like filter) return true; 39 | return false; 40 | } 41 | 42 | function w(name, flags) { 43 | //stdout.println("scan fn",name); 44 | if(name == "." || name == "..") return true; // skip it 45 | if(flags & (System.IS_HIDDEN | System.IS_SYSTEM)) return true; // skip it 46 | if((flags & System.IS_DIR) != 0) 47 | folders.push(name); 48 | else { 49 | if((this super).folderonly || !accept(name)) return true; // skip it 50 | files.push(name); 51 | } 52 | return true; 53 | } 54 | System.scanFiles(path + "/*.*", w); 55 | 56 | folders.sort(:a,b: a.lexicalCompare(b)); 57 | files.sort(:a,b: a.lexicalCompare(b)); 58 | for(var n in folders) 59 | cb(n,path + "/" + n, true); 60 | for(var n in files) 61 | cb(n,path + "/" + n, false); 62 | } 63 | 64 | function show(path = "",filters = null) { 65 | this.filters = filters || this.filters; 66 | super.show(path); 67 | } 68 | } -------------------------------------------------------------------------------- /data/main.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 59 | Bedrock Dedicated Server Dumper 60 | 61 |
62 | Bedrock Dedicated Server Dumper 63 | 64 | 65 | 66 | 67 | 68 |
69 | 70 | Open Project 71 | New Project 72 | 73 | 74 | -------------------------------------------------------------------------------- /data/wizard.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 74 | New project 75 | 76 |
77 | New project 78 | 79 | 80 | 81 | 82 |
83 | 84 | -------------------------------------------------------------------------------- /data/common/frame.css: -------------------------------------------------------------------------------- 1 | @import url(base.css); 2 | 3 | html { 4 | background: rgba(0, 0, 0, 0); 5 | border: window-frame-width solid color(accent-color); 6 | padding-top: 28dip; 7 | } 8 | @media win7 { 9 | html { 10 | border-width: 2px; 11 | background: rgba(255, 255, 255, 0.8); 12 | } 13 | } 14 | html > header { 15 | position: fixed; 16 | z-index: 1; 17 | top: 0; 18 | left: 0; 19 | right: 0; 20 | height: 28dip; 21 | flow: horizontal; 22 | height: 28dip; 23 | margin: 0; 24 | font-family: inherit; 25 | font-size: 12dip; 26 | font-weight: 600; 27 | } 28 | html > header.overlay { 29 | left: *; 30 | } 31 | html > header.shade { 32 | background: morph(color(accent-color), opacity: 10%); 33 | } 34 | window-caption { 35 | display: block; 36 | line-height: 28dip; 37 | width: *; 38 | color: rgba(0, 0, 0, 0.5); 39 | padding: 0 1em; 40 | } 41 | html:owns-focus window-caption { 42 | color: black; 43 | } 44 | window-buttons { 45 | display: block; 46 | flow: horizontal; 47 | width: max-content; 48 | height: 2em; 49 | } 50 | window-buttons > window-button { 51 | behavior: clickable; 52 | display: block; 53 | height: 28dip; 54 | width: 48dip; 55 | foreground-size: 10dip; 56 | foreground-repeat: no-repeat; 57 | foreground-position: 50% 50%; 58 | fill: none; 59 | stroke: black; 60 | stroke-width: 1.1dip; 61 | transition: background-color linear 100ms, color linear 100ms; 62 | } 63 | 64 | window-buttons > window-button:hover { 65 | background: morph(color(accent-color), opacity: 50%); 66 | } 67 | window-buttons > window-button[role="window-settings"] { 68 | foreground-image: url(path: M5 6 L6 6 L6 5 L4 3 L4 1 L3 0 L2 0 L1.5 0.5 L2.5 1.5 L2.5 2.5 L1.5 2.5 L0.5 1.5 L0 2 L0 3 L1 4 L3 4 Z); 69 | } 70 | window-buttons > window-button[role="window-close"] { 71 | foreground-image: url(path: M0 0 L10 10 M10 0 L0 10); 72 | } 73 | window-buttons > window-button[role="window-close"]:hover { 74 | background: rgb(232,17,35); 75 | stroke: white; 76 | } 77 | window-buttons > window-button[role="window-maximize"] { 78 | foreground-image: url(path: M0 0 H9 V9 H0 Z); 79 | } 80 | html[state="maximized"] > header > window-buttons > window-button[role="window-maximize"] { 81 | foreground-image: url(path: M0 2 h8 v8 h-8 Z M2 2 v-2 h8 v8 h-2); 82 | } 83 | window-buttons > window-button[role="window-minimize"] { 84 | foreground-image: url(path: M0 0 M0 4.5 H9 M9 9); 85 | } -------------------------------------------------------------------------------- /data/fonts/load.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Victor Mono'; 3 | font-style: normal; 4 | font-weight: 100; 5 | src: url(VICTORMONO-THIN.TTF); 6 | } 7 | @font-face { 8 | font-family: 'Victor Mono'; 9 | font-style: italic; 10 | font-weight: 100; 11 | src: url(VICTORMONO-THINITALIC.TTF); 12 | } 13 | @font-face { 14 | font-family: 'Victor Mono'; 15 | font-style: normal; 16 | font-weight: 200; 17 | src: url(VICTORMONO-EXTRALIGHT.TTF); 18 | } 19 | @font-face { 20 | font-family: 'Victor Mono'; 21 | font-style: italic; 22 | font-weight: 200; 23 | src: url(VICTORMONO-EXTRALIGHTITALIC.TTF); 24 | } 25 | @font-face { 26 | font-family: 'Victor Mono'; 27 | font-style: normal; 28 | font-weight: 300; 29 | src: url(VICTORMONO-LIGHT.TTF); 30 | } 31 | @font-face { 32 | font-family: 'Victor Mono'; 33 | font-style: italic; 34 | font-weight: 300; 35 | src: url(VICTORMONO-LIGHTITALIC.TTF); 36 | } 37 | @font-face { 38 | font-family: 'Victor Mono'; 39 | font-style: normal; 40 | font-weight: 400; 41 | src: url(VICTORMONO-REGULAR.TTF); 42 | } 43 | @font-face { 44 | font-family: 'Victor Mono'; 45 | font-style: italic; 46 | font-weight: 400; 47 | src: url(VICTORMONO-ITALIC.TTF); 48 | } 49 | @font-face { 50 | font-family: 'Victor Mono'; 51 | font-style: oblique; 52 | font-weight: 400; 53 | src: url(VICTORMONO-OBLIQUE.TTF); 54 | } 55 | @font-face { 56 | font-family: 'Victor Mono'; 57 | font-style: normal; 58 | font-weight: 500; 59 | src: url(VICTORMONO-MEDIUM.TTF); 60 | } 61 | @font-face { 62 | font-family: 'Victor Mono'; 63 | font-style: italic; 64 | font-weight: 500; 65 | src: url(VICTORMONO-MEDIUMITALIC.TTF); 66 | } 67 | @font-face { 68 | font-family: 'Victor Mono'; 69 | font-style: normal; 70 | font-weight: 600; 71 | src: url(VICTORMONO-SEMIBOLD.TTF); 72 | } 73 | @font-face { 74 | font-family: 'Victor Mono'; 75 | font-style: italic; 76 | font-weight: 600; 77 | src: url(VICTORMONO-SEMIBOLDITALIC.TTF); 78 | } 79 | @font-face { 80 | font-family: 'Victor Mono'; 81 | font-style: normal; 82 | font-weight: 700; 83 | src: url(VICTORMONO-BOLD.TTF); 84 | } 85 | @font-face { 86 | font-family: 'Victor Mono'; 87 | font-style: italic; 88 | font-weight: 700; 89 | src: url(VICTORMONO-BOLDITALIC.TTF); 90 | } 91 | @font-face { 92 | font-family: 'Victor Mono'; 93 | font-style: oblique; 94 | font-weight: 700; 95 | src: url(VICTORMONO-BOLDOBLIQUE.TTF); 96 | } -------------------------------------------------------------------------------- /data/common/controls.css: -------------------------------------------------------------------------------- 1 | button { 2 | aspect: UX.button(color: color(accent-color)) url(controls.tis); 3 | display: block; 4 | height: 32dip; 5 | color: black; 6 | font-family: inherit; 7 | font-size: inherit; 8 | border: none; 9 | border-radius: none; 10 | border-width: 0; 11 | background: morph(color(accent-color), opacity: 10%); 12 | padding: * 16dip; 13 | } 14 | 15 | button[type="link"] { 16 | behavior: hyperlink; 17 | } 18 | 19 | button.big-icon { 20 | foreground-position: 50%; 21 | foreground-repeat: no-repeat; 22 | padding-bottom: 0; 23 | } 24 | 25 | button.icon { 26 | foreground-position: 8dip 50%; 27 | foreground-repeat: no-repeat; 28 | foreground-size: 24dip; 29 | padding-left: 40dip; 30 | } 31 | 32 | button>text { 33 | padding: 0; 34 | } 35 | 36 | button:active { 37 | background: morph(color(accent-color), opacity: 20%); 38 | } 39 | 40 | button:disabled { 41 | background: morph(color(accent-color), opacity: 5%); 42 | } 43 | 44 | input { 45 | display: inline-block; 46 | height: 32dip; 47 | background: none; 48 | padding: * 8dip; 49 | overflow-x: scroll-indicator; 50 | border-radius: 0; 51 | box-shadow: inset 0 -2.4dip 0 morph(color(accent-color), opacity: 50%); 52 | border: 0; 53 | color: inherit; 54 | font-family: inherit; 55 | font-size: inherit; 56 | text-selection-caret-color: black; 57 | text-selection-background-color: black; 58 | text-selection-color: white; 59 | context-menu: unset; 60 | aspect: UX.input url(controls.tis); 61 | } 62 | input:hover { 63 | background: morph(color(accent-color), opacity: 10%); 64 | box-shadow: inset 0 -2.4dip 0 morph(color(accent-color), opacity: 100%); 65 | } 66 | input:focus, input:busy { 67 | background: morph(color(accent-color), opacity: 20%); 68 | box-shadow: inset 0 -2.4dip 0 morph(color(accent-color), opacity: 100%); 69 | } 70 | input::marker { 71 | content: attr(placeholder); 72 | size: *; 73 | text-align: center; 74 | vertical-align: middle; 75 | opacity: 0.5; 76 | transition: opacity linear 0.2s; 77 | } 78 | input:not(:empty)::marker { 79 | opacity: 0; 80 | } 81 | popup[role=tooltip] { 82 | background: rgba(240, 240, 240, 0.9); 83 | border: 1px solid rgba(120, 120, 120, 1); 84 | font-family: inherit; 85 | color: black; 86 | font-size: 16dip; 87 | } 88 | progress { 89 | size: *; 90 | border-radius: 0; 91 | background: morph(color(accent-color), opacity: 10%); 92 | border: none; 93 | padding: 4dip; 94 | foreground: rgba(0, 0, 0, 0.5); 95 | } 96 | a[target="browser"] { 97 | aspect: UX.link url(controls.tis); 98 | } -------------------------------------------------------------------------------- /data/common/sqlite3.tis: -------------------------------------------------------------------------------- 1 | function SQLite.isRecordset(rs) { 2 | return rs && (rs instanceof Asset) && (Asset.typeOf(rs) == #Recordset); 3 | } 4 | 5 | function SQLite.isDatabase(db) { 6 | return db && (db instanceof Asset) && (Asset.typeOf(db) == #DB); 7 | } 8 | 9 | function SQLite.tablesIn(db) { 10 | assert SQLite.isDatabase(db); 11 | var rs = db.exec("SELECT name,sql FROM sqlite_master WHERE type='table' ORDER BY name;" ); 12 | var names = {}; 13 | if (SQLite.isRecordset(rs)) 14 | do names[rs["name"]] = rs["sql"] while( rs.next() ); 15 | return names; 16 | } 17 | // returns map of indexes found in the DB 18 | function SQLite.indexesIn(db) { 19 | assert SQLite.isDatabase(db); 20 | var rs = db.exec("SELECT name,sql FROM sqlite_master WHERE type='index' ORDER BY name;" ); 21 | var names = {}; 22 | if (SQLite.isRecordset(rs)) 23 | do names[rs["name"]] = rs["sql"] while( rs.next() ); 24 | return names; 25 | } 26 | 27 | // fills the table DOM element by data from the Recordset: 28 | 29 | function SQLite.tableFrom(rs) { 30 | var headers = []; 31 | for (var n in rs.length) { 32 | const title = String.printf("%s:%s:%s", rs.name(n,#database), rs.name(n,#table), rs.name(n,#field)); 33 | headers.push({rs.name(n)}); 34 | } 35 | 36 | var rows = []; 37 | 38 | function cells() { 39 | var list = []; 40 | for (var v in rs) 41 | list.push({v}); 42 | return list; 43 | } 44 | 45 | do { rows.push({cells()}); } while(rs.next()); 46 | 47 | return 48 | {headers} 49 | {rows} 50 |
; 51 | } 52 | 53 | // Returns object constructed from current row as { field1: value1, field2: value2, etc. } 54 | // Not too much effective but someone may need it 55 | function SQLite.rowAsObject(rs) { 56 | var names = []; 57 | for (var n in rs.length) 58 | names.push(rs.name(n)); 59 | var obj = {}; 60 | var n = 0; 61 | for (var v in rs) 62 | obj[names[n++]] = v; 63 | return obj; 64 | } 65 | 66 | function SQLite.rowsAsArray(rs) { 67 | var data = []; 68 | do { 69 | var row = []; 70 | for (var v in rs) row.push(v); 71 | data.push(row); 72 | } while( rs.next() ); 73 | return data; 74 | } 75 | 76 | function SQLite.rowsAsObjectArray(rs) { 77 | var names = []; 78 | for (var n in rs.length) 79 | names.push(rs.name(n)); 80 | var list = []; 81 | do { 82 | var row = {}; 83 | var n = 0; 84 | for (var v in rs) row[names[n++]] = v; 85 | list.push(row); 86 | } while (rs.next()); 87 | return list; 88 | } 89 | 90 | function @asyncSql(func, db, sql, params...) { 91 | db.execCallback(sql, params, func) 92 | } -------------------------------------------------------------------------------- /BedrockExt/main.cpp: -------------------------------------------------------------------------------- 1 | #undef WIN32_LEAN_AND_MEAN 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #ifndef BDSDVERSION 12 | # define BDSDVERSION L"0.0.0" 13 | #endif 14 | 15 | EXTERN_C IMAGE_DOS_HEADER __ImageBase; 16 | 17 | struct extension : sciter::om::asset { 18 | sciter::string version = BDSDVERSION; 19 | TaskPool pool; 20 | 21 | extension() {} 22 | 23 | SOM_PASSPORT_BEGIN_EX(bedrock, extension) 24 | SOM_FUNCS(SOM_FUNC(demangleVtableFunction)) 25 | SOM_PROPS(SOM_RO_PROP(version), SOM_RO_VIRTUAL_PROP(symutils, getPath)) 26 | SOM_PASSPORT_END 27 | 28 | SCITER_VALUE getPath() { 29 | static std::filesystem::path cached = ([] { 30 | WCHAR DllPath[MAX_PATH] = {0}; 31 | GetModuleFileNameW((HINSTANCE) &__ImageBase, DllPath, _countof(DllPath)); 32 | std::filesystem::path raw{DllPath}; 33 | raw = raw.parent_path() / "symutils.exe"; 34 | return raw; 35 | })(); 36 | return sciter::value::make_string(cached.c_str()); 37 | } 38 | 39 | SCITER_VALUE demangleVtableFunction(sciter::string inp, sciter::value cb) { 40 | pool.AddTask([=, this] { 41 | try { 42 | aux::w2a dat{inp}; 43 | auto str = llvm::microsoftDemangle( 44 | dat.c_str(), nullptr, nullptr, nullptr, nullptr, 45 | (llvm::MSDemangleFlags)(llvm::MSDF_NoCallingConvention | llvm::MSDF_NoAccessSpecifier)); 46 | if (!str) return sciter::value::make_error((L"failed to demangle: " + inp).c_str()); 47 | std::string buf{str}; 48 | free(str); 49 | static std::regex re_string{ 50 | "class std::basic_string, class std::allocator>"}; 51 | static std::regex re_vector{R"raw(class std::vector<(.*), class std::allocator<\1>>)raw"}; 52 | static std::regex re_unique{R"raw(class std::unique_ptr<(.*), struct std::default_delete<\1>>)raw"}; 53 | buf = std::regex_replace(buf, re_string, "std::string"); 54 | buf = std::regex_replace(buf, re_vector, "std::vector<$1>"); 55 | buf = std::regex_replace(buf, re_unique, "std::unique_ptr<$1>"); 56 | auto ret = sciter::value::make_string(buf.c_str()); 57 | cb.call(ret); 58 | } catch (...) { cb.call({}); } 59 | }); 60 | return {}; 61 | } 62 | }; 63 | 64 | extern "C" __declspec(dllexport) BOOL SCAPI SciterLibraryInit(ISciterAPI *psapi, SCITER_VALUE *plibobject) { 65 | _SAPI(psapi); 66 | static sciter::om::hasset root = new extension(); 67 | 68 | *plibobject = sciter::value::wrap_asset(root); 69 | return TRUE; 70 | } -------------------------------------------------------------------------------- /data/common/virtual-tree.tis: -------------------------------------------------------------------------------- 1 | export class VirtualTree : Element { 2 | // overridables: 3 | // notifications: 4 | function optionExpanded(option) {} 5 | function optionCollapsed(option) {} 6 | function selectionChanged() {} 7 | 8 | // workers, must be implemented: 9 | // toCall = function(caption, path, isFolder); 10 | function eachChild(ofPath,toCall) { assert false: "must be implemented"; } 11 | // toCall = function(caption, path, isFolder); 12 | function eachRoot(toCall) { assert false: "must be implemented"; } 13 | 14 | // implementation: 15 | function appendOption(parentOpt, caption, path, nodeState) { 16 | const el = Element.create() 17 | parentOpt.append(el); 18 | if (nodeState === true) el.state.expanded = true; 19 | else if (nodeState === false) el.state.collapsed = true; 20 | el.sendMouseEvent { 21 | type: Event.MOUSE_MOVE, 22 | x: 0, 23 | y: 0, 24 | }; 25 | return el; 26 | } 27 | 28 | function expandOption(opt) { 29 | function appendChild(caption, path, isFolder) { (this super).appendOption(opt, caption, path, isFolder? false: undefined); } 30 | this.eachChild(opt.attributes["filename"], appendChild); 31 | opt.state.expanded = true; 32 | } 33 | 34 | function collapseOption(opt) { 35 | while(opt.length > 1) 36 | opt.last.remove(); 37 | opt.state.collapsed = true; 38 | opt.state.current = true; 39 | opt.state.checked = true; 40 | this.postEvent("item-activate", opt.attributes["filename"]); 41 | } 42 | 43 | event expand(evt) { 44 | this.expandOption(evt.target); 45 | this.optionExpanded(evt.target); 46 | return true; 47 | } 48 | event collapse(evt) { 49 | this.collapseOption(evt.target); 50 | this.optionCollapsed(evt.target); 51 | return true; 52 | } 53 | 54 | event change() { 55 | this.postEvent("item-activate", this.value); 56 | return true; 57 | } 58 | 59 | event dblclick $(option:not(:node)) (evt,option) { 60 | this.postEvent("item-activate", option.attributes["filename"]); 61 | } 62 | event keydown $(option:not(:node)) (evt,option) { 63 | if(evt.keyCode == Event.VK_ENTER) this.postEvent("item-activate", option.attributes["filename"]); 64 | } 65 | 66 | function appendRoot(caption, path, isFolder) { 67 | var rn = this.appendOption(this, caption, path, isFolder? true: undefined); 68 | if(isFolder) 69 | this.expandOption(rn); 70 | } 71 | 72 | function show(path = "") { 73 | this.clear(); 74 | function rootAppender(caption, path, isFolder) { (this super).appendRoot(caption, path, isFolder); } 75 | if(path) 76 | this.eachChild(path,rootAppender); 77 | else 78 | this.eachRoot(rootAppender); 79 | } 80 | } -------------------------------------------------------------------------------- /CLI/ostream_joiner.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // This file allows me to use std::experimental::ostream_joiner without waiting for Microsoft to create it. 4 | // Reference: http://en.cppreference.com/w/cpp/experimental/ostream_joiner 5 | 6 | #if !defined(HAS_OSTREAM_JOINER_H) 7 | # if defined(__has_include) 8 | # if __has_include() 9 | # define HAS_OSTREAM_JOINER_H 10 | # endif /* __has_include() */ 11 | # endif /* __has_include */ 12 | #endif /* HAS_OSTREAM_JOINER_H */ 13 | 14 | #if !defined(HAS_OSTREAM_JOINER_H) 15 | # include 16 | 17 | namespace std::experimental { 18 | template > class ostream_joiner { 19 | public: 20 | using char_type = CharT; 21 | using traits_type = Traits; 22 | using ostream_type = basic_ostream; 23 | 24 | using value_type = void; 25 | using difference_type = void; 26 | using pointer = void; 27 | using reference = void; 28 | using iterator_category = output_iterator_tag; 29 | 30 | // ReSharper disable once CppRedundantAccessSpecifier 31 | public: 32 | ostream_joiner(ostream_type &stream, const DelimT &delimiter) 33 | : m_bFirst(true), m_pStream(addressof(stream)), m_Delimiter(delimiter) {} 34 | ostream_joiner(ostream_type &stream, DelimT &&delimiter) 35 | : m_bFirst(true), m_pStream(addressof(stream)), m_Delimiter(forward(delimiter)) {} 36 | ostream_joiner(const ostream_joiner &other) = default; 37 | ostream_joiner(ostream_joiner &&other) = default; 38 | ~ostream_joiner() = default; 39 | 40 | // ReSharper disable once CppRedundantAccessSpecifier 41 | public: 42 | template ostream_joiner &operator=(const T &value) { 43 | if (!m_bFirst) *m_pStream << m_Delimiter; 44 | 45 | m_bFirst = false; 46 | *m_pStream << value; 47 | 48 | return *this; 49 | } 50 | ostream_joiner &operator=(const ostream_joiner &other) = default; 51 | ostream_joiner &operator=(ostream_joiner &&other) = default; 52 | 53 | // ReSharper disable once CppRedundantAccessSpecifier 54 | public: 55 | ostream_joiner &operator*() noexcept { return *this; } 56 | ostream_joiner &operator++() noexcept { return *this; } 57 | ostream_joiner &operator++(int) noexcept { return *this; } 58 | 59 | private: 60 | bool m_bFirst; 61 | ostream_type *m_pStream; 62 | DelimT m_Delimiter; 63 | }; 64 | 65 | // ReSharper disable once CppRedundantInlineSpecifier 66 | template 67 | ostream_joiner, charT, traits> static inline make_ostream_joiner( 68 | basic_ostream &os, DelimT &&delimiter) { 69 | return ostream_joiner, charT, traits>(os, forward(delimiter)); 70 | } 71 | } // namespace std::experimental 72 | #else 73 | # include 74 | #endif -------------------------------------------------------------------------------- /data/common/controls.tis: -------------------------------------------------------------------------------- 1 | namespace UX { 2 | namespace details { 3 | function showMenu(parameters) { 4 | view.window { 5 | type: View.FRAME_WINDOW, 6 | url: view.root.url("menu.html"), 7 | parameters: parameters 8 | }; 9 | } 10 | 11 | function createCommand(target, name, title) { 12 | return