Commit Graph

7 Commits

Author SHA1 Message Date
Robert Adam
d100ff1467 MAINT: Update copyright to 2022 2022-01-04 20:17:33 +01:00
Robert Adam
d816fb5688 BUILD(windows): Fix debug build
When performing a debug build, the "deadlock plugin" will be included
in the build, which uses the thread functionality of the std. However,
during compiling there would be an error about a symbol in thread.hpp
not being found (_beginthreadex). As it turns out, this was due to us
having a header file called Process.h, which would shadow the windows-
specific header file defining the mentioned symbol.

Therefore, in this commit we rename the Process base class to
AbstractProcess and rename the files accordingly, fixing that error.

See also: https://stackoverflow.com/q/27230258
2021-12-23 21:47:54 +01:00
Davide Beatrici
9d3e53152a FEAT(positional-audio): Add support for DT_GNU_HASH, to locate exported symbols
Our Source Engine plugin retrieves the interfaces on Linux through "s_pInterfaceRegs", an exported symbol.

Left 4 Dead 2 just received a big update and the binaries don't have the DT_HASH table anymore.
As a result, the plugin was not finding the symbol anymore.

This is basically a follow-up to 6f19d7ebfd, which implemented support for DT_GNU_HASH in the overlay code.
2021-06-16 05:19:35 +02:00
Robert Adam
59ae429972 MAINT: Update copyright notice to 2021
This was done by running scripts/updateLicenseHeaders.py and then
manually editing the LICENSE file.
2021-03-02 10:15:01 +01:00
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
Davide Beatrici
c96153e2c6 REFAC(plugins): Move "m_ok" variable from HostLinux and HostWindows to Process
HostWindows' constructor only initializes its variables now, like HostLinux'.
2020-11-02 09:15:54 +01:00
Davide Beatrici
253b814ba5 FEAT(plugins): Add classes for process-related functions
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.
2020-10-28 19:26:56 +01:00