Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Beatrici <git@davidebeatrici.dev>2020-11-11 07:25:52 +0300
committerDavide Beatrici <git@davidebeatrici.dev>2020-11-11 07:25:52 +0300
commit8542c9a8574e52873c0aac53348a515d84c6b617 (patch)
tree9707d56da83772093c887afc471bf56218e6089c /plugins/Process.h
parent04faa580084bb447f01df87ef096f40e8f30f892 (diff)
FEAT(positional-audio): Add searchInBuffer() and findPattern()
searchInBuffer() searches for the specified pattern in the specified buffer. "?" is used as wildcard. findPattern(), given a start address and the size of the area, reads memory in chunks of 32 KiB. It stops when a match is found, the end is reached or an error is encountered (peek() fails). There's also an overload which iterates through the specified module's readable regions.
Diffstat (limited to 'plugins/Process.h')
-rw-r--r--plugins/Process.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/Process.h b/plugins/Process.h
index df78a2a2e..7beb35f92 100644
--- a/plugins/Process.h
+++ b/plugins/Process.h
@@ -95,6 +95,15 @@ public:
procptr_t virtualFunction(const procptr_t classObject, const size_t index) const;
+ /// Iterates through all readable memory regions, until findPattern() succeeds.
+ /// Returns 0 if the pattern is not found.
+ procptr_t findPattern(const std::vector< uint8_t > &pattern, const Module &module);
+
+ /// Reads memory in chunks until either the pattern is found, the end is reached or peek() fails.
+ /// Refer to searchInBuffer() for the pattern format.
+ /// Returns 0 if the pattern is not found.
+ procptr_t findPattern(const std::vector< uint8_t > &pattern, procptr_t address, const size_t size);
+
static procid_t find(const std::string &name, const std::multimap< std::wstring, unsigned long long int > &pids);
Process(const procid_t id, const std::string &name);