mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Since most of the functions are already using C++, why not use classes as well? This commit introduces the following classes: - HostLinux: can only be compiled on Linux. Implements peek() and module(). - HostWindows: can only be compiled on Windows. Implements peek() and module(). - Process: abstract (cannot be instantiated directly). Inherits from HostLinux on Linux and from HostWindows on Windows. Provides functions that can be used with both Linux and Windows processes. Pure virtual functions are implemented in the following classes: - ProcessLinux: meant to be used with Linux processes, inherits from Process. Only implements exportedSymbol(), due to the other functions being universal. The constructor detects the architecture through the ELF header. - ProcessWindows: meant to be used with Windows processes, inherits from Process. Only implements exportedSymbol(), due to the other functions being universal. The constructor detects the architecture through the NT header.
21 lines
610 B
C++
21 lines
610 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 PROCESSWINDOWS_H_
|
|
#define PROCESSWINDOWS_H_
|
|
|
|
#include "Process.h"
|
|
|
|
/// Meant to be used with Windows processes.
|
|
class ProcessWindows : public Process {
|
|
public:
|
|
procptr_t exportedSymbol(const std::string &symbol, const procptr_t module) const override;
|
|
|
|
ProcessWindows(const procid_t id, const std::string &name);
|
|
virtual ~ProcessWindows();
|
|
};
|
|
|
|
#endif
|