mumble/plugins/HostWindows.h
Davide Beatrici 988b8417ac REFAC(positional-audio): Proper functions/classes for module-related operations
Previously, only module() was present: it retrieved the base address of the specified module.

It worked fine, but it iterated through the process' modules every time it was called.

This commit replaces it with modules(), which returns an std::unordered_map containing all modules.

The map uses the module name as key and Module as value.

Aside from the performance improvement, the new code also provides info for each module region:

- Start address.
- Size.
- Whether it's readable, writable and/or executable.
2020-11-06 21:37:06 +01:00

26 lines
571 B
C++

// Copyright 2020 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#ifndef HOSTWINDOWS_H_
#define HOSTWINDOWS_H_
#include "Module.h"
typedef uint32_t procid_t;
class HostWindows {
protected:
procid_t m_pid;
public:
bool peek(const procptr_t address, void *dst, const size_t size) const;
Modules modules() const;
HostWindows(const procid_t pid);
virtual ~HostWindows();
};
#endif