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
AgeCommit message (Collapse)Author
2021-03-02MAINT: Update copyright notice to 2021Robert Adam
This was done by running scripts/updateLicenseHeaders.py and then manually editing the LICENSE file.
2020-09-27FEAT(client): add getExportedSymbol() function for positional audio pluginsDavide Beatrici
This function is of critical importance for the Source Engine plugin, let me elaborate on why. Most games consist in an executable and maybe one or more libraries, but they don't have particular exported symbols we can use to easily access (existing) resources inside the process, which means we have to rely on hardcoded offsets and hex pattern scanning. Source Engine games are special: the executable is nothing more than a manager that takes care of loading the core libraries, which are engine(.dll|.so) and client(.dll|.so) (or server(.dll|.so) in the case of a dedicated server). Those libraries have a common exported symbol, which is CreateInterface(). The function takes the interface's name as argument (char *), creates the interface object if it doesn't exist yet and returns a pointer (void *) to it. The interfaces objects are stored in a list called s_pInterfaceList, which is usually an exported symbol on Linux. getExportedSymbol() allows us to get the address to CreateInterface() (different for each loaded library) inside the process and read the function's assembly code in order to reach s_pInterfaceList. If s_pInterfaceList is exported we can get its address with getExportedSymbol(), without the need of CreateInterface().
2020-09-27FEAT(client): add several new functions to be used in positional audio pluginsDavide Beatrici
- peekProcString(): reads the specified amount of data at the specified address and returns it as std::string. An empty std::string is returned in case of error. If length is 0, the function reads one byte at a time and stops when either '\0' is found or 3 seconds have passed. The successfully read data is returned, also in case of error. - peekProcVector(): can be used to read a dynamic array (size known at runtime) from the process' memory. Dynamic arrays are part of C99, which should be supported by most compilers nowadays, but std::vector provides many advantages (e.g. easy resize) over a raw array. - getVirtualFunction(): gets the address of a virtual function given its index and the class object's base address. A macro called GET_POINTER_SIZE is added because "is64Bit ? 8 : 4" is used in two places now. Also, it's useful and intuitive for plugin(s) programmers. - sinCos(): calculates sine and cosine of the specified value. On Linux the calculation is guaranteed to be simultaneous. - degreesToRadians(): converts degrees to radians. - isBigEndian(): returns whether the architecture is big-endian, by checking how a 4-byte value is stored in memory. - networkToHost() converts from network byte order to host byte order. I decided to create our own function because ntohs() is part of winsock(2).h on Windows, which means we would have to link to "ws2_32". This commit also adds and makes use of the new "OS_WINDOWS" and "OS_LINUX" definitions. The reason behind their existence is the "_WIN32" and "__linux__" definitions not being intuitive, mainly because they don't follow the same naming convention.
2020-09-11FORMAT: Run clang-format 10 on all C/CXX source-filesRobert
2020-01-07Auto-update LICENSE.header in source filesDavide Beatrici
2019-08-28mumble_plugin_main.h: include <cstring> for memset()Davide Beatrici
The MinGW builds failed with: In file included from gtasa.cpp:6:0: ../mumble_plugin_main.h: In instantiation of 'T peekProc(const procptr_t&) [with T = unsigned char; procptr_t = long long unsigned int]': gtasa.cpp:25:59: required from here ../mumble_plugin_main.h:47:9: error: 'memset' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] memset(&ret, 0, sizeof(ret)); ^ In file included from /usr/lib/mxe/usr/x86_64-w64-mingw32.static/include/guiddef.h:154:0, from /usr/lib/mxe/usr/x86_64-w64-mingw32.static/include/winnt.h:635, from /usr/lib/mxe/usr/x86_64-w64-mingw32.static/include/minwindef.h:163, from /usr/lib/mxe/usr/x86_64-w64-mingw32.static/include/windef.h:8, from /usr/lib/mxe/usr/x86_64-w64-mingw32.static/include/windows.h:69, from ./../mumble_plugin_win32.h:21, from ../mumble_plugin_main.h:95, from gtasa.cpp:6: /usr/lib/mxe/usr/x86_64-w64-mingw32.static/include/string.h:53:18: note: 'void* memset(void*, int, size_t)' declared here, later in the translation unit void * __cdecl memset(void *_Dst,int _Val,size_t _Size); ^
2019-08-17mumble_plugin_linux.h: detect process architecture by reading the process' ↵Davide Beatrici
memory instead of its binary Aside from being faster, it also requires less code. This commit also changes the way architecture is detected for Win32 processes. Previously, we relied on the Wine's preloader binary's architecture because we read its ELF header; now we read the NT header(s) by calling isWin32Process64Bit() (implemented in 86154c82344f130ed14633a21fdbe19b7937a80f).
2019-08-17plugins: detect Win32 process architecture by reading NT header(s)Davide Beatrici
This is better than our current method because: 1. We don't need an extra handle (IsWow64Process() requires PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION). 2. It's more reliable: our current method consists in checking the result of IsWow64Process() (true if the process is 32 bit on 64 bit Windows) and the size of void * (4 bytes if 32 bit, 8 bytes if 64 bit). It works correctly with a 32 bit plugin on 32 bit Windows and with a 64 bit plugin on 64 bit Windows; it doesn't work correctly when the plugin is 32 bit on 64 bit Windows: 64 bit processes are detected as 32 bit. 3. We can use the same method on Linux (the NT image is loaded in memory by Wine).
2019-08-09plugins: use new headerDavide Beatrici
2019-08-09plugins: move common functions and variables from OS-specific headers to ↵Davide Beatrici
mumble_plugin_main.h This is in preparation for the new Source Engine plugin which will add a few common functions. This commit also improves the functions arguments so that they are passed by reference and marked as const (when possible). A new data type called procid_t is created, intended to be a replacement for pid_t (Linux) and DWORD (Windows).