Advertisement
Guest User

SqliteHandler

a guest
Dec 4th, 2016
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 21.22 KB | None | 0 0
  1. ' ***********************************************************************
  2. ' Assembly         : SQLiteHandler
  3. ' Author           : ??????
  4. ' Created          : ??-??-????
  5. '' ***********************************************************************
  6.  
  7. Imports System.IO
  8. Imports System.Runtime.InteropServices
  9. Imports Microsoft.VisualBasic.CompilerServices
  10. Public Class SqLiteHandler
  11.     Private db_bytes As Byte()
  12.     Private mEncoding As ULong
  13.     Private field_names As String()
  14.     Private master_table_entries As sqlite_master_entry()
  15.     Private page_size As UShort
  16.     Private SQLDataTypeSize As Byte() = New Byte() {0, 1, 2, 3, 4, 6, 8, 8, 0, 0}
  17.     Private table_entries As table_entry()
  18.  
  19.     Public Sub New(baseName As String)
  20.         If File.Exists(baseName) Then
  21.             FileSystem.FileOpen(1, baseName, OpenMode.Binary, OpenAccess.Read, OpenShare.[Shared], -1)
  22.             Dim str As String = Strings.Space(CInt(FileSystem.LOF(1)))
  23.             FileSystem.FileGet(1, str, -1L, False)
  24.             FileSystem.FileClose(New Integer() {1})
  25.             Me.db_bytes = System.Text.Encoding.Default.GetBytes(str)
  26.             If String.Compare(System.Text.Encoding.Default.GetString(Me.db_bytes, 0, 15), "SQLite format 3", StringComparison.Ordinal) <> 0 Then
  27.                 Throw New Exception("Not a valid SQLite 3 Database File")
  28.             End If
  29.             If Me.db_bytes(&H34) <> 0 Then
  30.                 Throw New Exception("Auto-vacuum capable database is not supported")
  31.             End If
  32.             Me.page_size = CUShort(Me.ConvertToInteger(&H10, 2))
  33.             Me.mEncoding = Me.ConvertToInteger(&H38, 4)
  34.             If Decimal.Compare(New Decimal(Me.mEncoding), Decimal.Zero) = 0 Then
  35.                 Me.mEncoding = 1L
  36.             End If
  37.             Me.ReadMasterTable(100L)
  38.         End If
  39.     End Sub
  40.  
  41.     Private Function ConvertToInteger(startIndex As Integer, Size As Integer) As ULong
  42.         If (Size > 8) Or (Size = 0) Then
  43.             Return 0L
  44.         End If
  45.         Dim num2 As ULong = 0L
  46.         Dim num4 As Integer = Size - 1
  47.         For i As Integer = 0 To num4
  48.             num2 = (num2 << 8) Or Me.db_bytes(startIndex + i)
  49.         Next
  50.         Return num2
  51.     End Function
  52.  
  53.     Private Function CVL(startIndex As Integer, endIndex As Integer) As Long
  54.         endIndex += 1
  55.         Dim buffer As Byte() = New Byte(7) {}
  56.         Dim num4 As Integer = endIndex - startIndex
  57.         Dim flag As Boolean = False
  58.         If (num4 = 0) Or (num4 > 9) Then
  59.             Return 0L
  60.         End If
  61.         If num4 = 1 Then
  62.             buffer(0) = CByte(Me.db_bytes(startIndex) And &H7F)
  63.             Return BitConverter.ToInt64(buffer, 0)
  64.         End If
  65.         If num4 = 9 Then
  66.             flag = True
  67.         End If
  68.         Dim num2 As Integer = 1
  69.         Dim num3 As Integer = 7
  70.         Dim index As Integer = 0
  71.         If flag Then
  72.             buffer(0) = Me.db_bytes(endIndex - 1)
  73.             endIndex -= 1
  74.             index = 1
  75.         End If
  76.         Dim num7 As Integer = startIndex
  77.         Dim i As Integer = endIndex - 1
  78.         While i >= num7
  79.             If (i - 1) >= startIndex Then
  80.                 buffer(index) = CByte((CByte(Me.db_bytes(i) >> ((num2 - 1) And 7)) And (CInt(&HFF) >> num2)) Or CByte(Me.db_bytes(i - 1) << (num3 And 7)))
  81.                 num2 += 1
  82.                 index += 1
  83.                 num3 -= 1
  84.             ElseIf Not flag Then
  85.                 buffer(index) = CByte(CByte(Me.db_bytes(i) >> ((num2 - 1) And 7)) And (CInt(&HFF) >> num2))
  86.             End If
  87.             i += -1
  88.         End While
  89.         Return BitConverter.ToInt64(buffer, 0)
  90.     End Function
  91.  
  92.     Public Function GetRowCount() As Integer
  93.         Return Me.table_entries.Length
  94.     End Function
  95.  
  96.     Public Function GetTableNames() As String()
  97.         Dim strArray2 As String() = Nothing
  98.         Dim index As Integer = 0
  99.         Dim num3 As Integer = Me.master_table_entries.Length - 1
  100.         For i As Integer = 0 To num3
  101.             If Me.master_table_entries(i).item_type = "table" Then
  102.                 strArray2 = DirectCast(Utils.CopyArray(DirectCast(strArray2, Array), New String(index) {}), String())
  103.                 strArray2(index) = Me.master_table_entries(i).item_name
  104.                 index += 1
  105.             End If
  106.         Next
  107.         Return strArray2
  108.     End Function
  109.  
  110.     Public Function GetValue(row_num As Integer, field As Integer) As String
  111.         If row_num >= Me.table_entries.Length Then
  112.             Return Nothing
  113.         End If
  114.         If field >= Me.table_entries(row_num).content.Length Then
  115.             Return Nothing
  116.         End If
  117.         Return Me.table_entries(row_num).content(field)
  118.     End Function
  119.  
  120.     Public Function GetValue(row_num As Integer, field As String) As String
  121.         Dim num As Integer = -1
  122.         Dim length As Integer = Me.field_names.Length - 1
  123.         For i As Integer = 0 To length
  124.             If Me.field_names(i).ToLower().CompareTo(field.ToLower()) = 0 Then
  125.                 num = i
  126.                 Exit For
  127.             End If
  128.         Next
  129.         If num = -1 Then
  130.             Return Nothing
  131.         End If
  132.         Return Me.GetValue(row_num, num)
  133.     End Function
  134.  
  135.     Private Function GVL(startIndex As Integer) As Integer
  136.         If startIndex > Me.db_bytes.Length Then
  137.             Return 0
  138.         End If
  139.         Dim num3 As Integer = startIndex + 8
  140.         For i As Integer = startIndex To num3
  141.             If i > (Me.db_bytes.Length - 1) Then
  142.                 Return 0
  143.             End If
  144.             If (Me.db_bytes(i) And &H80) <> &H80 Then
  145.                 Return i
  146.             End If
  147.         Next
  148.         Return (startIndex + 8)
  149.     End Function
  150.  
  151.     Private Function IsOdd(value As Long) As Boolean
  152.         Return ((value And 1L) = 1L)
  153.     End Function
  154.  
  155.     Private Sub ReadMasterTable(Offset As ULong)
  156.         If Me.db_bytes(CInt(Offset)) = 13 Then
  157.             Dim num2 As UShort = Convert.ToUInt16(Decimal.Subtract(New Decimal(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(New Decimal(Offset), 3D)), 2)), Decimal.One))
  158.             Dim length As Integer = 0
  159.             If Me.master_table_entries IsNot Nothing Then
  160.                 length = Me.master_table_entries.Length
  161.                 Me.master_table_entries = DirectCast(Utils.CopyArray(DirectCast(Me.master_table_entries, Array), New sqlite_master_entry((Me.master_table_entries.Length + num2)) {}), sqlite_master_entry())
  162.             Else
  163.                 Me.master_table_entries = New sqlite_master_entry(num2) {}
  164.             End If
  165.             Dim num13 As Integer = num2
  166.             For i As Integer = 0 To num13
  167.                 Dim num As ULong = Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(Offset), 8D), New Decimal(i * 2))), 2)
  168.                 If Decimal.Compare(New Decimal(Offset), 100D) <> 0 Then
  169.                     num += Offset
  170.                 End If
  171.                 Dim endIndex As Integer = Me.GVL(CInt(num))
  172.                 Dim num7 As Long = Me.CVL(CInt(num), endIndex)
  173.                 Dim num6 As Integer = Me.GVL(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), Decimal.Subtract(New Decimal(endIndex), New Decimal(num))), Decimal.One)))
  174.                 Me.master_table_entries(length + i).row_id = Me.CVL(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), Decimal.Subtract(New Decimal(endIndex), New Decimal(num))), Decimal.One)), num6)
  175.                 num = Convert.ToUInt64(Decimal.Add(Decimal.Add(New Decimal(num), Decimal.Subtract(New Decimal(num6), New Decimal(num))), Decimal.One))
  176.                 endIndex = Me.GVL(CInt(num))
  177.                 num6 = endIndex
  178.                 Dim num5 As Long = Me.CVL(CInt(num), endIndex)
  179.                 Dim numArray As Long() = New Long(4) {}
  180.                 Dim index As Integer = 0
  181.                 Do
  182.                     endIndex = num6 + 1
  183.                     num6 = Me.GVL(endIndex)
  184.                     numArray(index) = Me.CVL(endIndex, num6)
  185.                     If numArray(index) > 9L Then
  186.                         If Me.IsOdd(numArray(index)) Then
  187.                             numArray(index) = CLng(Math.Round(CDbl(CDbl(numArray(index) - 13L) / 2.0)))
  188.                         Else
  189.                             numArray(index) = CLng(Math.Round(CDbl(CDbl(numArray(index) - 12L) / 2.0)))
  190.                         End If
  191.                     Else
  192.                         numArray(index) = Me.SQLDataTypeSize(CInt(numArray(index)))
  193.                     End If
  194.                     index += 1
  195.                 Loop While index <= 4
  196.                 If Decimal.Compare(New Decimal(Me.mEncoding), Decimal.One) = 0 Then
  197.                     Me.master_table_entries(length + i).item_type = System.Text.Encoding.Default.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(New Decimal(num), New Decimal(num5))), CInt(numArray(0)))
  198.                 ElseIf Decimal.Compare(New Decimal(Me.mEncoding), 2D) = 0 Then
  199.                     Me.master_table_entries(length + i).item_type = System.Text.Encoding.Unicode.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(New Decimal(num), New Decimal(num5))), CInt(numArray(0)))
  200.                 ElseIf Decimal.Compare(New Decimal(Me.mEncoding), 3D) = 0 Then
  201.                     Me.master_table_entries(length + i).item_type = System.Text.Encoding.BigEndianUnicode.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(New Decimal(num), New Decimal(num5))), CInt(numArray(0)))
  202.                 End If
  203.                 If Decimal.Compare(New Decimal(Me.mEncoding), Decimal.One) = 0 Then
  204.                     Me.master_table_entries(length + i).item_name = System.Text.Encoding.Default.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num5)), New Decimal(numArray(0)))), CInt(numArray(1)))
  205.                 ElseIf Decimal.Compare(New Decimal(Me.mEncoding), 2D) = 0 Then
  206.                     Me.master_table_entries(length + i).item_name = System.Text.Encoding.Unicode.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num5)), New Decimal(numArray(0)))), CInt(numArray(1)))
  207.                 ElseIf Decimal.Compare(New Decimal(Me.mEncoding), 3D) = 0 Then
  208.                     Me.master_table_entries(length + i).item_name = System.Text.Encoding.BigEndianUnicode.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num5)), New Decimal(numArray(0)))), CInt(numArray(1)))
  209.                 End If
  210.                 Me.master_table_entries(length + i).root_num = CLng(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(Decimal.Add(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num5)), New Decimal(numArray(0))), New Decimal(numArray(1))), New Decimal(numArray(2)))), CInt(numArray(3))))
  211.                 If Decimal.Compare(New Decimal(Me.mEncoding), Decimal.One) = 0 Then
  212.                     Me.master_table_entries(length + i).sql_statement = System.Text.Encoding.Default.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(Decimal.Add(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num5)), New Decimal(numArray(0))), New Decimal(numArray(1))), New Decimal(numArray(2))), New Decimal(numArray(3)))), CInt(numArray(4)))
  213.                 ElseIf Decimal.Compare(New Decimal(Me.mEncoding), 2D) = 0 Then
  214.                     Me.master_table_entries(length + i).sql_statement = System.Text.Encoding.Unicode.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(Decimal.Add(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num5)), New Decimal(numArray(0))), New Decimal(numArray(1))), New Decimal(numArray(2))), New Decimal(numArray(3)))), CInt(numArray(4)))
  215.                 ElseIf Decimal.Compare(New Decimal(Me.mEncoding), 3D) = 0 Then
  216.                     Me.master_table_entries(length + i).sql_statement = System.Text.Encoding.BigEndianUnicode.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(Decimal.Add(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num5)), New Decimal(numArray(0))), New Decimal(numArray(1))), New Decimal(numArray(2))), New Decimal(numArray(3)))), CInt(numArray(4)))
  217.                 End If
  218.             Next
  219.         ElseIf Me.db_bytes(CInt(Offset)) = 5 Then
  220.             Dim num11 As UShort = Convert.ToUInt16(Decimal.Subtract(New Decimal(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(New Decimal(Offset), 3D)), 2)), Decimal.One))
  221.             Dim num14 As Integer = num11
  222.             For j As Integer = 0 To num14
  223.                 Dim startIndex As UShort = CUShort(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(Offset), 12D), New Decimal(j * 2))), 2))
  224.                 If Decimal.Compare(New Decimal(Offset), 100D) = 0 Then
  225.                     Me.ReadMasterTable(Convert.ToUInt64(Decimal.Multiply(Decimal.Subtract(New Decimal(Me.ConvertToInteger(startIndex, 4)), Decimal.One), New Decimal(Me.page_size))))
  226.                 Else
  227.                     Me.ReadMasterTable(Convert.ToUInt64(Decimal.Multiply(Decimal.Subtract(New Decimal(Me.ConvertToInteger(CInt(Offset + startIndex), 4)), Decimal.One), New Decimal(Me.page_size))))
  228.                 End If
  229.             Next
  230.             Me.ReadMasterTable(Convert.ToUInt64(Decimal.Multiply(Decimal.Subtract(New Decimal(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(New Decimal(Offset), 8D)), 4)), Decimal.One), New Decimal(Me.page_size))))
  231.         End If
  232.     End Sub
  233.  
  234.     Public Function ReadTable(TableName As String) As Boolean
  235.         Dim index As Integer = -1
  236.         Dim length As Integer = Me.master_table_entries.Length - 1
  237.         For i As Integer = 0 To length
  238.             If String.Compare(Me.master_table_entries(i).item_name.ToLower(), TableName.ToLower(), StringComparison.Ordinal) = 0 Then
  239.                 index = i
  240.                 Exit For
  241.             End If
  242.         Next
  243.         If index = -1 Then
  244.             Return False
  245.         End If
  246.         Dim strArray As String() = Me.master_table_entries(index).sql_statement.Substring(Me.master_table_entries(index).sql_statement.IndexOf("(", StringComparison.Ordinal) + 1).Split(New Char() {","c})
  247.         Dim num6 As Integer = strArray.Length - 1
  248.         For j As Integer = 0 To num6
  249.             strArray(j) = (strArray(j)).TrimStart()
  250.             Dim num4 As Integer = strArray(j).IndexOf(" ", StringComparison.Ordinal)
  251.             If num4 > 0 Then
  252.                 strArray(j) = strArray(j).Substring(0, num4)
  253.             End If
  254.             If strArray(j).IndexOf("UNIQUE", StringComparison.Ordinal) = 0 Then
  255.                 Exit For
  256.             End If
  257.             Me.field_names = DirectCast(Utils.CopyArray(DirectCast(Me.field_names, Array), New String(j) {}), String())
  258.             Me.field_names(j) = strArray(j)
  259.         Next
  260.         Return Me.ReadTableFromOffset(CULng((Me.master_table_entries(index).root_num - 1L) * Me.page_size))
  261.     End Function
  262.  
  263.     Private Function ReadTableFromOffset(offset As ULong) As Boolean
  264.         If Me.db_bytes(CInt(offset)) = 13 Then
  265.             Dim num2 As Integer = Convert.ToInt32(Decimal.Subtract(New Decimal(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(New Decimal(offset), 3D)), 2)), Decimal.One))
  266.             Dim length As Integer = 0
  267.             If Me.table_entries IsNot Nothing Then
  268.                 length = Me.table_entries.Length
  269.                 Me.table_entries = DirectCast(Utils.CopyArray(DirectCast(Me.table_entries, Array), New table_entry((Me.table_entries.Length + num2)) {}), table_entry())
  270.             Else
  271.                 Me.table_entries = New table_entry(num2) {}
  272.             End If
  273.             Dim num16 As Integer = num2
  274.             For i As Integer = 0 To num16
  275.                 Dim _fieldArray As record_header_field() = Nothing
  276.                 Dim num As ULong = Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(offset), 8D), New Decimal(i * 2))), 2)
  277.                 If Decimal.Compare(New Decimal(offset), 100D) <> 0 Then
  278.                     num += offset
  279.                 End If
  280.                 Dim endIndex As Integer = Me.GVL(CInt(num))
  281.                 Dim num9 As Long = Me.CVL(CInt(num), endIndex)
  282.                 Dim num8 As Integer = Me.GVL(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), Decimal.Subtract(New Decimal(endIndex), New Decimal(num))), Decimal.One)))
  283.                 Me.table_entries(length + i).row_id = Me.CVL(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), Decimal.Subtract(New Decimal(endIndex), New Decimal(num))), Decimal.One)), num8)
  284.                 num = Convert.ToUInt64(Decimal.Add(Decimal.Add(New Decimal(num), Decimal.Subtract(New Decimal(num8), New Decimal(num))), Decimal.One))
  285.                 endIndex = Me.GVL(CInt(num))
  286.                 num8 = endIndex
  287.                 Dim num7 As Long = Me.CVL(CInt(num), endIndex)
  288.                 Dim num10 As Long = Convert.ToInt64(Decimal.Add(Decimal.Subtract(New Decimal(num), New Decimal(endIndex)), Decimal.One))
  289.                 Dim j As Integer = 0
  290.                 While num10 < num7
  291.                     _fieldArray = DirectCast(Utils.CopyArray(DirectCast(_fieldArray, Array), New record_header_field(j) {}), record_header_field())
  292.                     endIndex = num8 + 1
  293.                     num8 = Me.GVL(endIndex)
  294.                     _fieldArray(j).type = Me.CVL(endIndex, num8)
  295.                     If _fieldArray(j).type > 9L Then
  296.                         _fieldArray(j).size = If(Me.IsOdd(_fieldArray(j).type), CLng(Math.Round(CDbl(CDbl(_fieldArray(j).type - 13L) / 2.0))), CLng(Math.Round(CDbl(CDbl(_fieldArray(j).type - 12L) / 2.0))))
  297.                     Else
  298.                         _fieldArray(j).size = Me.SQLDataTypeSize(CInt(_fieldArray(j).type))
  299.                     End If
  300.                     num10 = (num10 + (num8 - endIndex)) + 1L
  301.                     j += 1
  302.                 End While
  303.                 Me.table_entries(length + i).content = New String((_fieldArray.Length - 1)) {}
  304.                 Dim num4 As Integer = 0
  305.                 Dim num17 As Integer = _fieldArray.Length - 1
  306.                 For k As Integer = 0 To num17
  307.                     If _fieldArray(k).type > 9L Then
  308.                         If Not Me.IsOdd(_fieldArray(k).type) Then
  309.                             If Decimal.Compare(New Decimal(Me.mEncoding), Decimal.One) = 0 Then
  310.                                 Me.table_entries(length + i).content(k) = System.Text.Encoding.Default.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num7)), New Decimal(num4))), CInt(_fieldArray(k).size))
  311.                             ElseIf Decimal.Compare(New Decimal(Me.mEncoding), 2D) = 0 Then
  312.                                 Me.table_entries(length + i).content(k) = System.Text.Encoding.Unicode.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num7)), New Decimal(num4))), CInt(_fieldArray(k).size))
  313.                             ElseIf Decimal.Compare(New Decimal(Me.mEncoding), 3D) = 0 Then
  314.                                 Me.table_entries(length + i).content(k) = System.Text.Encoding.BigEndianUnicode.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num7)), New Decimal(num4))), CInt(_fieldArray(k).size))
  315.                             End If
  316.                         Else
  317.                             Me.table_entries(length + i).content(k) = System.Text.Encoding.Default.GetString(Me.db_bytes, Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num7)), New Decimal(num4))), CInt(_fieldArray(k).size))
  318.                         End If
  319.                     Else
  320.                         Me.table_entries(length + i).content(k) = Conversions.ToString(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(num), New Decimal(num7)), New Decimal(num4))), CInt(_fieldArray(k).size)))
  321.                     End If
  322.                     num4 += CInt(_fieldArray(k).size)
  323.                 Next
  324.             Next
  325.         ElseIf Me.db_bytes(CInt(offset)) = 5 Then
  326.             Dim num14 As UShort = Convert.ToUInt16(Decimal.Subtract(New Decimal(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(New Decimal(offset), 3D)), 2)), Decimal.One))
  327.             Dim num18 As Integer = num14
  328.             For m As Integer = 0 To num18
  329.                 Dim num13 As UShort = CUShort(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(Decimal.Add(New Decimal(offset), 12D), New Decimal(m * 2))), 2))
  330.                 Me.ReadTableFromOffset(Convert.ToUInt64(Decimal.Multiply(Decimal.Subtract(New Decimal(Me.ConvertToInteger(CInt(offset + num13), 4)), Decimal.One), New Decimal(Me.page_size))))
  331.             Next
  332.             Me.ReadTableFromOffset(Convert.ToUInt64(Decimal.Multiply(Decimal.Subtract(New Decimal(Me.ConvertToInteger(Convert.ToInt32(Decimal.Add(New Decimal(offset), 8D)), 4)), Decimal.One), New Decimal(Me.page_size))))
  333.         End If
  334.         Return True
  335.     End Function
  336.  
  337.     <StructLayout(LayoutKind.Sequential)>
  338.     Private Structure record_header_field
  339.         Public size As Long
  340.         Public type As Long
  341.     End Structure
  342.  
  343.     <StructLayout(LayoutKind.Sequential)>
  344.     Private Structure sqlite_master_entry
  345.         Public row_id As Long
  346.         Public item_type As String
  347.         Public item_name As String
  348.         Public astable_name As String
  349.         Public root_num As Long
  350.         Public sql_statement As String
  351.     End Structure
  352.  
  353.     <StructLayout(LayoutKind.Sequential)>
  354.     Private Structure table_entry
  355.         Public row_id As Long
  356.         Public content As String()
  357.     End Structure
  358. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement