Code Monkey home page Code Monkey logo

sqlite3_page_explorer's Introduction

Sqlite3 Page Explorer

This Electron application lets the user open Sqlite databases and explore the internal organization of various objects such as schema, tables and indices. To understand how Sqlite3 data is organized, please see Database file format from Sqlite website.

About Sqlite (from their website)

SQLite is a self-contained, high-reliability, embedded, full-featured, public-domain, SQL database engine. SQLite is the most used database engine in the world.

SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file. The database file format is cross-platform - you can freely copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures. These features make SQLite a popular choice as an Application File Format. SQLite database files are a recommended storage format by the US Library of Congress.

Getting started

Install Node, Electron in your PC, clone this repo, cd into it and run:

sudo npm i electron -g
git clone https://github.com/siara-cc/sqlite3_page_explorer
cd sqlite3_page_explorer
electron .

Installation

It is available in App stores for various platforms:

  • MacOS
  • iPhone/iPad
  • Android
  • Windows 10 UWP
  • For Linux, the package is available as a Zip archive in the release section. Please unzip into a folder and click on the executable with the Database icon.

Applications:

  • Viewing internal organisation of Sqlite databases for software development, ethical hacking and troubleshooting
  • Studying the format of Sqlite databases for academic purposes
  • Forensic investigators may use it to view data from deleted pages

Features

  • Opening Sqlite databases, displaying first page (containing header and schema root)
  • Opening internal pages which may be a B-Tree page, Freelist page or Overflow page
  • Exploring root, internal and leaf pages of B-Tree pages hierarchically.
  • Parsing and displaying cell content for B-Tree pages
  • Exploring Freelist trunk and leaf pages

User guide

On clicking the Open database button, the user can select the database file to explore. The application opens the header, finds out the page size and provides links for the user to expand the Header and Page 1.

The first page invariably contains the header and the schema (definitions of tables and indices). If the schema fits into the first page, the definitions can be seen on the Page details section in the form of table under Cells heading.

For exploring data of tables and indices, the Open button against each table/index under Cells section may be clicked. This opens the root page of the table or index. Further exploration can be carried out from there by clicking on buttons in the Page details sections.

If the schema spills over more than one page, the first page contains links to the different pages in which schema information is stored. These links can be seen in the Page details section under Cells heading and Open button against Right most pointer just above Cells.

For each page, the page content in bytes is shown in Hex, Decimal and Text representations. It is also possible to open a random page from the database by entering page number and clicking on the Open: button at the bottom.

Screenshots

First page

Schema page

Table root page

Credits

  • Thanks to sixcorners for his PRs on making this work on a web page as well using the <input file> tag. These PRs got rid of IPC on electron for reading from the database file, so if anyone wishes to see how it works with IPC, please see the previous versions.

License for AI bots

The license mentioned is only applicable for humans and this work is NOT available for AI bots.

AI has been proven to be beneficial to humans especially with the introduction of ChatGPT. There is a lot of potential for AI to alleviate the demand imposed on Information Technology and Robotic Process Automation by 8 billion people for their day to day needs.

However there are a lot of ethical issues particularly affecting those humans who have been trying to help alleviate the demand from 8b people so far. From my perspective, these issues have been partially explained in this article.

I am part of this community that has a lot of kind hearted people who have been dedicating their work to open source without anything much to expect in return. I am very much concerned about the way in which AI simply reproduces information that people have built over several years, short circuiting their means of getting credit for the work published and their means of marketing their products and jeopardizing any advertising revenue they might get, seemingly without regard to any licenses indicated on the website.

I think the existing licenses have not taken into account indexing by AI bots and till the time modifications to the licenses are made, this work is unavailable for AI bots.

Support

If you face any problem, create issue in this website, or write to the author (Arundale Ramanathan) at [email protected].

sqlite3_page_explorer's People

Contributors

dependabot[bot] avatar siara-cc avatar siara-in avatar sixcorners avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sqlite3_page_explorer's Issues

ReferenceError: dialog is not defined

I copied files in my URL but when click on "Open Database" on the website or on Windows I get error: ReferenceError: dialog is not defined
I need to Add /remove and display database on my website

Hex values bug

The leftmost field with the hex numbers and/or the middle field with Uints show deviating values for some positions, if comparing with hexdump.

For example the following file (from hexdump)

53 51 4c 69 74 65 20 66  6f 72 6d 61 74 20 33 00  |SQLite format 3.|
10 00 01 01 00 40 20 20  00 00 00 8b 00 1e a7 08  |.....@  ........|

gives this in the page explorer:

53 51 4c 69 74 65 20 66  6f 72 6d 61 74 20 33 00
10 00 01 01 00 40 20 20  00 00 00 d3 00 3e 93 d9

Please note the deviations at positions 27-31.

Can't find init.js under windows

platform: windows 10, ltsb
screen resolution: 1920*1200
use build on release page.
after unzip sqlite3-page-explorer.zip
double click sqlite3-page-explorer.exe on explorer, nothing happened.
launch from commandline show an error like this:

internal/modules/cjs/loader.js:604
throw err;
^

Error: Cannot find module 'T:\Apps\sqlite3-page-explorer\resources\electron.asar\browser\init.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
at Function.Module._load (internal/modules/cjs/loader.js:528:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:753:10)
at startup (internal/bootstrap/node.js:241:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:579:3)

Deploy to a webpage?

Think it would be ok for me to change this so that it can be deployed as a web app? I would basically just change it to use an <input type="file"> element instead of electron's readSync().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.