VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
BytePattern.hpp File Reference

Parsing and searching byte patterns, with no notion of a loaded module. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  VoltMod::PatternByte
 

Namespaces

namespace  VoltMod
 

Typedefs

using VoltMod::ByteHistogram = std::array< size_t, 256 >
 

Functions

std::vector< PatternByte > VoltMod::ParsePattern (const std::string &pattern)
 
void VoltMod::CountBytes (const uint8_t *base, size_t size, ByteHistogram &counts)
 
size_t VoltMod::AnchorOf (const std::vector< PatternByte > &pattern, const ByteHistogram &frequencies)
 
const uint8_t * VoltMod::FindFirst (const uint8_t *base, size_t size, const std::vector< PatternByte > &pattern, size_t anchor)
 

Detailed Description

Parsing and searching byte patterns, with no notion of a loaded module.

The half of signature scanning that is plain buffer work, split from SigScanner so it is unit-tested without a mapped module behind it. SigScanner supplies the memory to search and the frequencies to weigh; everything here is a pure function of its arguments.

Definition in file BytePattern.hpp.