mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
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.
28 lines
602 B
C++
28 lines
602 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 HOSTLINUX_H_
|
|
#define HOSTLINUX_H_
|
|
|
|
#include "Module.h"
|
|
|
|
typedef uint32_t procid_t;
|
|
|
|
class HostLinux {
|
|
protected:
|
|
procid_t m_pid;
|
|
|
|
public:
|
|
bool peek(const procptr_t address, void *dst, const size_t size) const;
|
|
Modules modules() const;
|
|
|
|
static bool isWine(const procid_t id);
|
|
|
|
HostLinux(const procid_t pid);
|
|
virtual ~HostLinux();
|
|
};
|
|
|
|
#endif
|