Skip to content

Commit

Permalink
Version 3.21
Browse files Browse the repository at this point in the history
- smaller bug fixes to time stamp handling
- fixes bug with SQL analyzer
  • Loading branch information
pawlaszczyk committed Nov 21, 2024
1 parent ace73ee commit a704155
Show file tree
Hide file tree
Showing 21 changed files with 352 additions and 71 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified .github/.DS_Store
Binary file not shown.
Binary file modified .metadata/.DS_Store
Binary file not shown.
Binary file modified .metadata/.mylyn/.DS_Store
Binary file not shown.
Binary file modified .metadata/.plugins/.DS_Store
Binary file not shown.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# What's Changed
- smaller bug fixes in detection algorithm
- added a new ROWID column
- pll and hl columns are merged now into one column
- UI layout improvements
- smaller bug fixes in SQL browser
- bug fixes displaying time stamps correctly
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
apply plugin: 'eclipse'

group 'hswm.fqlite'
version '3.2'
version '3.21'

def protocversion = "27.4"

Expand Down Expand Up @@ -104,9 +104,10 @@ dependencies {
implementation group: 'com.github.jsqlparser', name: 'jsqlparser', version: '5.0'
implementation files('lib/FxTextEditor.jar')
implementation files('lib/SerializationDumper-v1.13.jar')
//implementation files('lib/javafx-swt.jar')
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.11.3'
implementation group: 'org.apache.calcite', name: 'calcite-core', version: '1.38.0'
implementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.47.0.0'


testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}
Expand Down
Binary file modified gradle/.DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions packaging/choco/fqlite/fqlite.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>fqlite</id>
<version>3.1</version>
<packageSourceUrl>https://github.com/pawlaszczyk/fqlite/releases/download/3.1/fqlite-3.1-windows.exe</packageSourceUrl>
<version>3.21</version>
<packageSourceUrl>https://github.com/pawlaszczyk/fqlite/releases/download/3.21/fqlite-3.21-windows.exe</packageSourceUrl>
<title>fqlite (Install)</title>
<authors>Dirk Pawlaszczyk</authors>
<projectUrl>https://github.com/pawlaszczyk/fqlite</projectUrl>
Expand Down
Binary file modified protoc/.DS_Store
Binary file not shown.
Binary file modified src/.DS_Store
Binary file not shown.
Binary file modified src/fqlite/.DS_Store
Binary file not shown.
61 changes: 49 additions & 12 deletions src/fqlite/base/GUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import fqlite.analyzer.javaserial.Deserializer;
import fqlite.analyzer.pblist.BPListParser;
import fqlite.descriptor.TableDescriptor;
import fqlite.export.DBExportWindow;
import fqlite.log.AppLog;
import fqlite.sql.SQLWindow;
import fqlite.types.BLOBElement;
Expand Down Expand Up @@ -368,10 +369,15 @@ public void start(Stage stage) throws Exception {
mntopen.setAccelerator(KeyCombination.keyCombination("Ctrl+O"));
mntopen.setOnAction(e -> open_db(null));

MenuItem mntmExport = new MenuItem("Export Node...");
MenuItem mntmExport = new MenuItem("Export Node to CSV...");
mntmExport.setAccelerator(KeyCombination.keyCombination("Ctrl+X"));
mntmExport.setOnAction(e -> doExport());


MenuItem mntmExportDB = new MenuItem("Export db to SQLite...");
mntmExportDB.setOnAction( e -> {
showDBExportWindow();
});

MenuItem mntclose = new MenuItem("Close All");
mntclose.setAccelerator(KeyCombination.keyCombination("Ctrl+D"));
mntclose.setOnAction(e -> closeAll());
Expand Down Expand Up @@ -409,6 +415,9 @@ public void start(Stage stage) throws Exception {
showSqlWindow();
});





MenuItem mntmHelp = new MenuItem("Help");
mntmHelp.setOnAction(e -> {
Expand Down Expand Up @@ -637,6 +646,30 @@ private void showPropertyWindow() {
pd.start(new Stage());
}

private void showDBExportWindow(){

if(dbnames.size() == 0){

Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("Information");
alert.setContentText("You must open at least one database before you can use the export function.");
alert.showAndWait();

return;
}

DBExportWindow exp = new DBExportWindow(this);
Stage expstage = new Stage();
expstage.initModality(Modality.APPLICATION_MODAL);
try {
exp.start(expstage);
} catch (Exception e) {
e.printStackTrace();
}

}


private void showSqlWindow(){

if(dbnames.size() == 0){
Expand Down Expand Up @@ -1316,6 +1349,8 @@ public ObservableValue<String> call(CellDataFeatures<ObservableList, String> par
TableColumn col = new TableColumn(colname);
col.setCellFactory(TooltippedTableCell.forTableColumn(tablename,job,this.stage));
col.setComparator(new CustomComparator());


col.setCellValueFactory(new Callback<CellDataFeatures<ObservableList,String>,ObservableValue<String>>(){

public ObservableValue<String> call(CellDataFeatures<ObservableList, String> param) {
Expand All @@ -1332,11 +1367,6 @@ public ObservableValue<String> call(CellDataFeatures<ObservableList, String> par
}
});





//if (columntypes.size()>i && !columntypes.get(i).equals("BLOB") && !columntypes.get(i).equals("TEXT")) {

if (columntypes.size()>i && !columntypes.get(i).equals("BLOB") && !columntypes.get(i).equals("TEXT")) {
col.setStyle( "-fx-alignment: TOP-RIGHT;");
Expand All @@ -1356,6 +1386,15 @@ public ObservableValue<String> call(CellDataFeatures<ObservableList, String> par
col.setGraphic(view);
}
}

if(colname.equals("salt2") || colname.equals("salt1") ||
colname.equals("walframe") || colname.equals("dbpage") || colname.equals("commit"))
{ col.setStyle( "-fx-text-fill: gray;-fx-alignment: TOP-RIGHT;");


}


table.getColumns().add(col);
}

Expand All @@ -1366,9 +1405,6 @@ public ObservableValue<String> call(CellDataFeatures<ObservableList, String> par
Image img2 = new Image(GUI.class.getResource("/closeDB_gray.png").toExternalForm());

ImageView view2 = new ImageView(img2);

//Label filterlabel = new Label();
//filterlabel.setGraphic(view2);

Button clearFilter = new Button();
clearFilter.setGraphic(view2);
Expand Down Expand Up @@ -2212,8 +2248,9 @@ else if(s.contains("<plist>"))


String path = GUI.baseDir + Global.separator + job.filename + "_" + off + "-" + number + fext;
String text = job.bincache.getHexString(path);
setContent(text);
//String text = job.bincache.getHexString(path);
String text = job.bincache.getASCII(path);
setContent(text);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/fqlite/base/Global.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class Global {
public static final String FREELIST_ENTRY = "F"; // U267D - freelist
public static final String STATUS_CLOMUN = "S"; // U291D U2691
public static final String UNALLOCATED_SPACE = "U"; // U2318 - unallocated space
public static final String FQLITE_VERSION = "3.2";
public static final String FQLITE_RELEASEDATE = "06/11/2024";
public static final String FQLITE_VERSION = "3.21";
public static final String FQLITE_RELEASEDATE = "21/11/2024";
public static final String YEAR = "2024";
public static final int CARVING_ERROR = -1;
public static Level LOGLEVEL = Level.SEVERE;
Expand Down
56 changes: 28 additions & 28 deletions src/fqlite/base/Job.java
Original file line number Diff line number Diff line change
Expand Up @@ -1264,36 +1264,36 @@ else if ((headerStr.startsWith("0617"))) {
if (cont) {
switch(type) {

case 1: /*
0x01 0x00 0x00 0x00 0x00
This record relates to a B-tree root page,
hence the page number being indicated as zero.
*/

case 2: /*
0x02 0x00 0x00 0x00 0x00
This record relates to a free page, which also does not have a parent page.
*/


break;

case 3: /*
0x03 0xVV 0xVV 0xVV 0xVV (where VV indicates a variable)
This record relates to the first page in an overflow chain.
The parent page number is the number of the B-Tree page containing the B-Tree
cell to which the overflow chain belongs.
*/
case 1: /*
0x01 0x00 0x00 0x00 0x00
This record relates to a B-tree root page,
hence the page number being indicated as zero.
*/

case 2: /*
0x02 0x00 0x00 0x00 0x00
This record relates to a free page, which also does not have a parent page.
*/


break;

case 4: break;

case 5: break;


}
break;

case 3: /*
0x03 0xVV 0xVV 0xVV 0xVV (where VV indicates a variable)
This record relates to the first page in an overflow chain.
The parent page number is the number of the B-Tree page containing the B-Tree
cell to which the overflow chain belongs.
*/


break;

case 4: break;

case 5: break;


}
}


Expand Down
144 changes: 144 additions & 0 deletions src/fqlite/export/DBExportWindow.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
package fqlite.export;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.List;

import fqlite.base.GUI;
import fqlite.ui.FQTableView;
import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.ToolBar;
import javafx.scene.control.Tooltip;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.stage.Screen;
import javafx.stage.Stage;

public class DBExportWindow extends Application{

List<String> dbnames;
final ComboBox<String> dbBox = new ComboBox<>();
GUI app;
VBox root = new VBox();
public Hashtable<String,ObservableList<ObservableList<String>>> datasets;
public TextArea log;

public DBExportWindow(GUI app){

this.app = app;
this.dbnames = app.dbnames;
this.datasets = app.datasets;
log = new TextArea();
}

@Override
public void start(Stage primaryStage) throws Exception {


ToolBar toolBar = new ToolBar();

Button btnGo = new Button();
String s = GUI.class.getResource("/start.png").toExternalForm();
ImageView iv = new ImageView(s);
btnGo.setGraphic(iv);
btnGo.setTooltip(new Tooltip("click her to start databse export"));
btnGo.setOnAction(new EventHandler<ActionEvent>() {

@Override
public void handle(ActionEvent event) {

Enumeration<String> keys = datasets.keys();

String dbname = dbBox.getSelectionModel().getSelectedItem();
String signature = "Databases/" + dbname + "/";

log.appendText("Start export... \n");

DBExporter exp = new DBExporter(dbname + "_saved.sqlite");

while(keys.hasMoreElements()){

String next = keys.nextElement();

if(next.startsWith(signature)){
log.appendText(next + "\n");

// we've found a table which belongs to this database

String tbname = next.substring(signature.length());
log.appendText(tbname + "\n");
app.tables.get(next);

Node jnd = app.tables.get(next);

if (jnd instanceof VBox) {

VBox jvb = (VBox) jnd;
FQTableView jtbl = (FQTableView) jvb.getChildren().get(1);

List<String> columns = jtbl.columns;
List<String> types = jtbl.columntypes;
exp.createTable(tbname, columns, types);
}

}


}


//String result = p.parse(dbBox.getSelectionModel().getSelectedItem(),app,primaryStage,resultview,statusline);
//Platform.runLater( () -> {});
}
});

Button btnExit = new Button();
s = GUI.class.getResource("/analyzer-exit.png").toExternalForm();
iv = new ImageView(s);
btnExit.setGraphic(iv);
btnExit.setTooltip(new Tooltip("Quit SQL Analyzer"));
btnExit.setOnAction(new EventHandler<ActionEvent>() {

@Override
public void handle(ActionEvent event) {
primaryStage.close();
}
});

toolBar.getItems().addAll(btnGo, btnExit);



dbBox.getItems().addAll(dbnames);

Label dblabel = new Label("Choose database: ");
dbBox.getSelectionModel().selectFirst();

ToolBar dbbar = new ToolBar();

dbbar.getItems().addAll(dblabel,dbBox);


VBox.setVgrow(root,Priority.ALWAYS);
root.getChildren().addAll(dbbar,toolBar,log);

Scene scene = new Scene(root,Screen.getPrimary().getVisualBounds().getWidth()*0.4,Screen.getPrimary().getVisualBounds().getHeight()*0.5);

primaryStage.setScene(scene);
primaryStage.sizeToScene();
primaryStage.show();
primaryStage.setAlwaysOnTop(true);

}

}
Loading

0 comments on commit a704155

Please sign in to comment.