mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-18 20:03:26 +00:00
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
//
|
|
// Created by Vladislav on 30.12.2025.
|
|
//
|
|
#pragma once
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <optional>
|
|
#include <span>
|
|
#include <string_view>
|
|
#include "section_scan_result.hpp"
|
|
namespace omath
|
|
{
|
|
class ElfPatternScanner final
|
|
{
|
|
public:
|
|
[[nodiscard]]
|
|
static std::optional<std::uintptr_t>
|
|
scan_for_pattern_in_loaded_module(const void* module_base_address, const std::string_view& pattern,
|
|
const std::string_view& target_section_name = ".text");
|
|
|
|
[[nodiscard]]
|
|
static std::optional<SectionScanResult>
|
|
scan_for_pattern_in_file(const std::filesystem::path& path_to_file, const std::string_view& pattern,
|
|
const std::string_view& target_section_name = ".text");
|
|
|
|
[[nodiscard]]
|
|
static std::optional<SectionScanResult>
|
|
scan_for_pattern_in_memory_file(std::span<const std::byte> file_data, const std::string_view& pattern,
|
|
const std::string_view& target_section_name = ".text");
|
|
};
|
|
} // namespace omath
|