Sqlite Study Notes 1: Compile the database and sqlite Study Notes
First, I am using a Linux environment.
1. Download source code
Download from the official website: click here
Second compilation
1. Decompress
After the download is complete, it is generally in the "Download" directory of the current user, first cd to the download directory, and then create a file to put the decompressed file:
mkdir sqlite
Then cd to the new directory and run the following command to decompress
unzip ../sqlite-amalgamation-201408081749.zip
After decompression, there will be four files: shell. c, sqlite3.c, sqlite3.h, sqlite3ext. h
2 compile
Run the following command:
gcc *.c -o sqlite3 -lpthread -ldl
An sqlite executable file is generated after execution.
SQLite database data is decompiled
It is very difficult to reverse compile. I suggest you think about your frequently used password settings to enter a new client and search for the encrypted password string in the database. If it is the same as your current string password you can use that.
Build an sqlite database in C Language
). Open VC and create a "Win32 Dynamic-Link Library" project named sqlite32 ). in the following dialog box, select "An empty DLL project", click FINISH-> OK3 ). set all *. c *. h *. def copy to the project folder 4 ). in the Source File of the project, add all the SQLite Source files you downloaded *. c file. Do not add shell here. c and tclsqlite. c. 5 ). add the sqlite3.def File in the SQLite Source File to the Source File of the Project. 6 ). add all the files in the SQLite source File you downloaded to the Header File *. h file, 7 ). start compiling. Build (F7) may encounter an error here: e: \ zieckey \ sqlite \ sqlite3 \ sqlite3ext. h (22): fatal error C1083: Cannot open include file: 'sqlite3. h': No such file or directory check found that the source code contains sqlite3.h is included in the # include <sqlite3.h> method, which means the compiler searches in the default system path, in this case, the header file sqlite3.h cannot be found. You can change it to # include "sqlite3.h" to allow the compiler to search in the project path, but if there are other This method is also included in the # include <sqlite3.h> method, so it is a little troublesome to change the source code. Well, we can choose Tools> Options in the menu bar... -> Directeries: enter your sqlite3.h path in the Directeries option below. Here is your project directory. after adding the file, compile the file. Finally, we generated the following two important files in the Debug directory of the project directory: Dynamic Link Library File sqlite3.dll and import library file sqlite3.lib. using the dynamic link library, let's write a program to test our dynamic link library. create an empty "Win32 Console Application" Win32 Console program under VC, name the project TestSqliteOnWindows, and create a new test. the source code of the C ++ language of cpp is as follows: // name: test. cpp // This prog is u Sed to test C/C ++ API for sqlite3. It is very simple, ha! // Author: zieckey // data: 2006/11/28 # include <stdio. h> # include <stdlib. h> # include "sqlite3.h" # define _ DEBUG_int main (void) {sqlite3 * db = NULL; char * zErrMsg = 0; int rc; rc = sqlite3_open ("zieckey. db ", & db); // open the specified database file. if not, a database file with the same name will be created if (rc) {fprintf (stderr, & q ...... remaining full text>