MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / Storage

Method Storage

AdaptixClient/Source/Client/Storage.cpp:8–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6static const QString DB_CONNECTION_NAME = "adaptix_connection";
7
8Storage::Storage()
9{
10 QString homeDirPath = QDir::homePath();
11 bool appDirExists = false;
12 appDirPath = QDir(homeDirPath).filePath(".adaptix");
13
14 QDir appDir(appDirPath);
15 if ( appDir.exists() ) {
16 appDirExists = true;
17 } else {
18 if (appDir.mkpath(appDirPath))
19 appDirExists = true;
20 else
21 LogError("Adaptix directory %s not created!\n", appDirPath.toStdString().c_str());
22 }
23
24 if( appDirExists ) {
25 dbFilePath = QDir(appDirPath).filePath("storage-v1.db");
26 db = QSqlDatabase::addDatabase( "QSQLITE", DB_CONNECTION_NAME );
27 db.setDatabaseName(dbFilePath);
28 if (db.open())
29 this->checkDatabase();
30 else
31 LogError("Adaptix Database did not opened: %s\n", db.lastError().text().toStdString().c_str());
32 }
33}
34
35Storage::~Storage()
36{

Callers

nothing calls this directly

Calls 5

checkDatabaseMethod · 0.95
LogErrorFunction · 0.85
toStdStringMethod · 0.80
openMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected