Skip to content
API Documentation
BastionGuard™
AntiRansomEngine.hpp
Go to the documentation of this file.
1/*
2 * BastionGuard™
3 * Copyright (C) 2025–2026 Calogero Scarnà
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 *
17 * BastionGuard™ is a trademark of Calogero Scarnà.
18 * The BastionGuard™ name and branding are not licensed under the GPL.
19 */
20
21#pragma once
22#include <string>
23#include <thread>
24#include <atomic>
25#include <sigc++/sigc++.h>
26#include <yara.h>
27
28
30public:
33
34 void start();
35 void stop();
36
37
38 sigc::signal<void(const std::string&)>& signal_event();
39
40private:
41 void run();
42 void scan_file(const std::string& path);
43 void load_yara_rules();
44
45 std::atomic<bool> running_;
46 std::thread worker_;
47
48 YR_RULES* yara_rules_;
49
50 sigc::signal<void(const std::string&)> sig_event_;
51};
sigc::signal< void(const std::string &)> & signal_event()
void scan_file(const std::string &path)
std::atomic< bool > running_
sigc::signal< void(const std::string &)> sig_event_