|
| SQLiteHandler (string baseName) |
|
int | GetRowCount () |
| Gets the number of rows in the table.
|
|
string[] | GetTableNames () |
| Retrieves the names of tables from the master table entries and returns an array of strings.
|
|
string | GetValue (int row_num, int field) |
| Retrieves the value at the specified row and field.
|
|
string | GetValue (int row_num, string field) |
|
bool | ReadTable (string TableName) |
| Reads the specified table and returns a boolean indicating success or failure.
|
|
|
ulong | ConvertToInteger (int startIndex, int Size) |
| Converts a sequence of bytes to an unsigned integer.
|
|
long | CVL (int startIndex, int endIndex) |
| Converts a range of bytes to a long integer and returns the result.
|
|
int | GVL (int startIndex) |
| Returns the index of the first non-128 byte in the array starting from the specified index.
|
|
bool | IsOdd (long value) |
| Determines if the given value is odd.
|
|
void | ReadMasterTable (ulong Offset) |
| Reads the master table from the specified offset.
|
|
bool | ReadTableFromOffset (ulong Offset) |
| Reads a table from the specified offset and populates the table entries.
|
|
◆ SQLiteHandler()
InfoGrab.SQLiteHandler.SQLiteHandler |
( |
string | baseName | ) |
|
|
inline |
◆ ConvertToInteger()
ulong InfoGrab.SQLiteHandler.ConvertToInteger |
( |
int | startIndex, |
|
|
int | Size ) |
|
inlineprivate |
Converts a sequence of bytes to an unsigned integer.
- Parameters
-
startIndex | The starting index of the byte sequence. |
Size | The number of bytes to be converted. |
- Returns
- The unsigned integer value converted from the byte sequence.
This method converts a sequence of bytes starting from the specified startIndex to an unsigned integer value. If the Size is greater than 8 or equal to 0, the method returns 0. The conversion is performed by bitwise shifting and OR operations to combine the bytes into an unsigned integer value.
◆ CVL()
long InfoGrab.SQLiteHandler.CVL |
( |
int | startIndex, |
|
|
int | endIndex ) |
|
inlineprivate |
Converts a range of bytes to a long integer and returns the result.
- Parameters
-
startIndex | The starting index of the byte range. |
endIndex | The ending index of the byte range. |
- Returns
- The long integer value converted from the specified byte range.
This method converts a range of bytes from the startIndex to endIndex (inclusive) to a long integer value. It handles different cases based on the number of bytes in the range and modifies the byte array accordingly. If the number of bytes is 0 or greater than 9, the method returns 0. If there is only one byte in the range, it extracts the value and returns it as a long integer. If there are 9 bytes in the range, it handles a special case and sets a flag. The method then processes the bytes and performs bitwise operations to construct the long integer value. The resulting long integer value is returned.
◆ GetRowCount()
int InfoGrab.SQLiteHandler.GetRowCount |
( |
| ) |
|
|
inline |
Gets the number of rows in the table.
- Returns
- The number of rows in the table.
◆ GetTableNames()
string[] InfoGrab.SQLiteHandler.GetTableNames |
( |
| ) |
|
|
inline |
Retrieves the names of tables from the master table entries and returns an array of strings.
- Returns
- An array of strings containing the names of tables from the master table entries.
This method iterates through the master table entries and retrieves the names of tables. It then stores the names in an array of strings and returns the array.
◆ GetValue() [1/2]
string InfoGrab.SQLiteHandler.GetValue |
( |
int | row_num, |
|
|
int | field ) |
|
inline |
Retrieves the value at the specified row and field.
- Parameters
-
row_num | The row number. |
field | The field name. |
- Returns
- The value at the specified row_num and field .
This method retrieves the value at the specified row_num and field from the internal data structure. If the specified field is not found, it returns null.
◆ GetValue() [2/2]
string InfoGrab.SQLiteHandler.GetValue |
( |
int | row_num, |
|
|
string | field ) |
|
inline |
◆ GVL()
int InfoGrab.SQLiteHandler.GVL |
( |
int | startIndex | ) |
|
|
inlineprivate |
Returns the index of the first non-128 byte in the array starting from the specified index.
- Parameters
-
startIndex | The starting index in the array. |
- Returns
- The index of the first non-128 byte in the array starting from startIndex .
This method returns the index of the first non-128 byte in the array starting from the specified index. If the startIndex is greater than the length of the array, it returns 0. If no non-128 byte is found within the next 8 bytes from the startIndex , it returns startIndex + 8.
◆ IsOdd()
bool InfoGrab.SQLiteHandler.IsOdd |
( |
long | value | ) |
|
|
inlineprivate |
Determines if the given value is odd.
- Parameters
-
value | The value to be checked for oddity. |
- Returns
- True if the value is odd; otherwise, false.
◆ ReadMasterTable()
void InfoGrab.SQLiteHandler.ReadMasterTable |
( |
ulong | Offset | ) |
|
|
inlineprivate |
Reads the master table from the specified offset.
- Parameters
-
Offset | The offset from which to read the master table. |
This method reads the master table from the specified offset in the database file. It processes the data according to the SQLite file format specifications and populates the master_table_entries array with the retrieved information. The method handles different encodings for reading the item type, item name, and SQL statement from the database bytes. If the byte at the specified offset is 13, it reads the master table entries and populates the master_table_entries array. If the byte at the specified offset is 5, it recursively calls the ReadMasterTable method to read the master table entries from the specified offsets within the database file.
◆ ReadTable()
bool InfoGrab.SQLiteHandler.ReadTable |
( |
string | TableName | ) |
|
|
inline |
Reads the specified table and returns a boolean indicating success or failure.
- Parameters
-
TableName | The name of the table to be read. |
- Returns
- True if the table was successfully read; otherwise, false.
This method searches for the specified table name in the master table entries and retrieves the SQL statement associated with it. It then extracts the field names from the SQL statement and populates the field_names array. If the table is found and the fields are successfully extracted, it calls the ReadTableFromOffset method to read the table data from the specified offset.
◆ ReadTableFromOffset()
bool InfoGrab.SQLiteHandler.ReadTableFromOffset |
( |
ulong | Offset | ) |
|
|
inlineprivate |
Reads a table from the specified offset and populates the table entries.
- Parameters
-
Offset | The offset from which to read the table. |
- Returns
- True if the table is successfully read and populated; otherwise, false.
This method reads a table from the specified offset in the database file and populates the table entries. It handles different types of data encoding and modifies the table entries in place.
◆ db_bytes
byte [] InfoGrab.SQLiteHandler.db_bytes |
|
private |
◆ encoding
ulong InfoGrab.SQLiteHandler.encoding |
|
private |
◆ field_names
string [] InfoGrab.SQLiteHandler.field_names |
|
private |
◆ master_table_entries
◆ page_size
ushort InfoGrab.SQLiteHandler.page_size |
|
private |
◆ SQLDataTypeSize
byte [] InfoGrab.SQLiteHandler.SQLDataTypeSize |
|
private |
Initial value:= new byte[]
{
0,
1,
2,
3,
4,
6,
8,
8,
0,
0
}
◆ table_entries
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/PassGrab/SqliteHandler.cs