static
int
dbcallback(void
*
data,
int
argc, char
*
*
argv, char
*
*
azColName);
typedef SQLITE_API
int
(
*
Mysqlite3_open)(
const char
*
filename,
/
*
Database filename (UTF
-
8
)
*
/
sqlite3
*
*
ppDb
/
*
OUT: SQLite db handle
*
/
);
typedef SQLITE_API
int
(
*
Mysqlite3_key)(
sqlite3
*
db,
/
*
Database to be rekeyed
*
/
const void
*
pKey,
int
nKey
/
*
The key
*
/
);
typedef SQLITE_API
int
(
*
Mysqlite3_rekey)(
sqlite3
*
db,
/
*
Database to be rekeyed
*
/
const void
*
pKey,
int
nKey
/
*
The new key
*
/
);
typedef SQLITE_API
int
(
*
Mysqlite3_exec)(
sqlite3
*
,
/
*
An
open
database
*
/
const char
*
sql,
/
*
SQL to be evaluated
*
/
int
(
*
callback)(void
*
,
int
, char
*
*
, char
*
*
),
/
*
Callback function
*
/
void
*
,
/
*
1st
argument to callback
*
/
char
*
*
errmsg
/
*
Error msg written here
*
/
);
typedef SQLITE_API
int
(
*
Mysqlite3_close)(
sqlite3
*
);
sqlite3
*
pdb
=
NULL;
int
main()
{
HMODULE h_module
=
LoadLibraryExW(L
"C:\\Program Files (x86)\\Tencent\\QQ\\Bin\\KernelUtil.dll"
, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
Mysqlite3_open psqlite_open
=
(Mysqlite3_open)((DWORD)h_module
+
0x36FB1
);
Mysqlite3_key psqlite_key
=
(Mysqlite3_key)((DWORD)h_module
+
0x87896
);
Mysqlite3_rekey psqlite_rekey
=
(Mysqlite3_rekey)((DWORD)h_module
+
0x87A55
);
Mysqlite3_exec psqlite_exec
=
(Mysqlite3_exec)((DWORD)h_module
+
0x36372
);
Mysqlite3_close psqlite_close
=
(Mysqlite3_close)((DWORD)h_module
+
0x3717E
);
int
ret
=
psqlite_open(
"D:\\qqdecrypt\\Registry2.0.db"
, &pdb);
char
*
zErrMsg
=
0
;
/
/
动态调试可知
8192
psqlite_exec(pdb,
"PRAGMA page_size = 8192;"
,NULL,NULL, &zErrMsg);
const char
*
key
=
"57094686228D44B0"
;
ret
=
psqlite_key(pdb, key,
16
);
const char
*
data
=
"Callback function called"
;
/
/
psqlite_exec(pdb,
"SELECT count(*) FROM sqlite_master;"
, dbcallback, (void
*
)data, &zErrMsg);
psqlite_exec(pdb,
"select name from sqlite_master where type = 'table' order by name"
, dbcallback, (void
*
)data, &zErrMsg);
/
/
psqlite_rekey(pdb,
0
,
0
);
psqlite_close(pdb);
std::cout <<
"Hello World!\n"
;
}
static
int
dbcallback(void
*
data,
int
argc, char
*
*
argv, char
*
*
azColName) {
int
i;
fprintf(stderr,
"%s: "
, (const char
*
)data);
for
(i
=
0
; i < argc; i
+
+
) {
printf(
"%s = %s\n"
, azColName[i], argv[i] ? argv[i] :
"NULL"
);
}
printf(
"\n"
);
return
0
;
}