Commit Graph

43 Commits

Author SHA1 Message Date
Mikkel Krautz
f6ba3a52bf Auto-update LICENSE.header in source files. 2018-01-01 23:05:37 +01:00
Jan Klass
36fc0f1b67 overlay: Use size_t as correct type for memory addresses
Use correct types for handling pointer size/memory addresses.

Make use of boost optional as GetFnOffsetInModules return type. The
unsigned return type does not allow for negative error values anymore,
which we did not make use of anyway, and optional is more explicit.

Replaces workaround/error detection from the commits
114495e59f
a3e7958f16

Fixes #1924
2017-07-13 13:18:09 +02:00
Jan Klass
7689647a50 Remove type variable prefix 2017-07-13 13:12:45 +02:00
Mikkel Krautz
91ebb8b0b5 Update tree copyrights to 2017. 2017-01-08 21:05:57 +01:00
Mikkel Krautz
b711ea987c overlay/lib.h: fix _WIN32_WINNT redefinition. 2016-08-21 18:43:20 +02:00
Mikkel Krautz
049fcae125 overlay: update to use LICENSE.header. 2016-05-10 22:42:03 +02:00
Kissaki
70451a60ce Fix #1637 application crashes on Mumble exit
* When unloading the overlay DLL freeD3D9Hook was called *after* unloading the DLL. This is incorrect.
** For applications that actually use D3D and we inject into, the DLL is
never unloaded because we hold a refernce to it ourselves. So in this case,
the problematic code is never executed.
** When not actually injecting, the DLL will be unloaded, and then the
function freeD3D9Hook is called which is from that DLL.
** As we’re executing code in undefined space which previously held the
function, this may or may not crash.
* Remove the freeD3D9Hook function
** The function freeD3D9Hook just resets some fields to NULL and a flag
to false. As the DLL is unloaded anyway, these are never used again.
Hence, we can just remove it altogether (rather than just calling it
before unloading).
2015-05-16 11:48:01 +02:00
Mikkel Krautz
93ad74b467 Add MinHook-based overlay for Windows x64.
This commit adds MinHook as a 3rd party
dependency and adds an alternative HardHook
implementation that makes use of MinHook.

This new MinHook-based HardHook implementation
allows us to provide an overlay for Mumble on
Windows x64.

The x64 overlay hasn't seen much testing in
real-world x64 games, except some minor testing
for World of Warcraft running in x64 mode, where
it works just fine.

There seems to be a compatibility with the Uplay
overlay, which causes Far Cry 4 to crash at the
"Press any key to continue" screen that is shown
just after launching the game. However,
Assassin's Creed: Unity works fine, so it might
just be a Far Cry 4 issue.

The x64 overlay also seems to interoperate with
the Steam overlay just fine.

I think this is a good starting point for the
feature. Let us get it into snapshots and let
us try to squash any addition bugs we find.
2015-01-03 19:44:02 +01:00
Kissaki
9544bec1f9 Overlay: Add Direct3D 11 support
* Based on an initial patch by Benjamin Jemlich
* Effects11 code based on changes by nyet
2014-01-10 22:51:11 +01:00
Kissaki
cd4e8350a5 Overlay: Changes as per PR-comments
* Use sizeof() rather then size constant where possible
2013-11-24 23:18:29 +01:00
Kissaki
dfbc1b9279 Overlay: Changes as per PR-comments
* Make cpp-local functions static so they are local file/translation unit
scope.
* Remove unused variables uiAudioCount and bVideoHooked
* Comment extern declarations, where there definitions are located.
* Improve constant naming JUMPOP_OFFSET => JMP_OP_SIZE.
* Remove extern declaration from method definitions.
* Adjust type declaration formatting to typical formatting.
* Use voidFunc typedef to pass around function address pointers.
** C++-style casts instead of C-style raw casts.
* Other minor formatting (/whitespace) adjustments
* Fix log text.
* Improve log text.
* Consistent, improved varnaming in d3d9.cpp on address calculation;
naming fn and base.
2013-11-24 19:20:24 +01:00
Kissaki
250835e83b Overlay: Rework Code.
* Separate DXGI logic from D3D10 into a separate file dxgi.cpp
* Structure code and logic, introduce additional functions
* Introduce constants
* Code commenting
* d3d9.cpp:
** Access devMap via std::find rather than operator[]
** Introduce class Stash to temporarily set variable value and revert on
destruction
** Move logic to function findOriginalDevice
** Use widestring for modulename (consistency)
** Implement Hook for Direct3DCreate9Ex
** Move function IsFnInModule to common lib.cpp/.h
* opengl.cpp:
** Add whitespace to format code
** Fix logging scope prefix
** Remove static global variable
2013-11-22 19:27:52 +01:00
Kissaki
3865e8cab0 Overlay: Code comments 2013-06-16 23:56:45 +02:00
Kissaki
cab4a3d852 Extend Windows Overlay code and clean it up.
Extend to handle library freeing.
Codeformatting and -cleanup, robustness, and make debugoutput more consistent.

* Indroduce hook for freeing loaded DLLs.
This separates logic between loading and freeing, leading to adjustments to
the recently introduced checks for freed DLLs.
* In HardHook::reset() do a clean and complete reset rather than minimal.
* Memvarinitialisation in HardHook
* Remove logically unused variable bPresenting in d3d9.cpp (always false)
* In d3d10.cpp prefix debugoutput with D3D10 consistently; no more DXGI
which is ambiguous with a d3d11 file that also uses DXGI.
* Consistently use ods instead of fods in the overlay files.
Not in HardHook yet, as that class is used in the Mumble client as well atm
* Fix forwarded return value types (LONG to ULONG)
* TODOs for hook-call-logic in multiple places
* Commenting, formatting and scope / order adjustments
* Introduce variables with constant values (replacing magic/undescriptive constants/numbers)
2013-06-11 23:02:14 +02:00
Kissaki
1e4bb6dbd0 Prepend Projectname to header guard defines
* some few (4?) files actually already had it
2013-06-04 21:59:52 +02:00
Kissaki
40ca9b4507 Rename header guard defines to not use c++-reserved names
* as pointed out in issue #842
adjust names to match other header files
2013-06-04 21:59:50 +02:00
Mikkel Krautz
46d659d415 overlay/d3d9: pass through IDirect3DDevice9 AddRef/Release methods to originals on Windows 8.
We were getting unbalanced AddRef/Releases on Direct3D9 apps running on Windows 8 that ran
fine on Windows 7.  Windows 8 seems to be doing somthing funky with the internal ref count
of IDirect3DDevice9.

For now, piggyback on the orignal ref count methods to be able to determine when to release
ourselves. And cross our fingers that we won't be getting useless ref counts from some other
overlay.

This is a band-aid solution until we find something better.
2012-11-16 01:05:50 +01:00
Thorvald Natvig
f3437a6ba7 Update copyright year ranges of dev team. 2011-03-18 05:52:51 +01:00
Stefan Hacker
8c952c3bd2 Remove duplicate overlay debug output code.
Factor fods and its base function out to ods.h/cpp and use it in HardHook as well as lib functionality. This also fixes previous divergence between the two ods functions.
2011-03-06 20:39:35 +01:00
Thorvald Natvig
2b6bad6a23 Flash in browser workaround 2010-03-10 18:03:04 +01:00
Thorvald Natvig
d44c84cb1a This is not the window you are looking for 2010-02-28 18:16:27 +01:00
Thorvald Natvig
0abb9e5469 Don't use widget functions on embedded widgets, they misbehave in release mode 2010-02-27 23:31:25 +01:00
Thorvald Natvig
c16b9b8e8f Indent, changelog, submodule and language update 2010-01-26 15:54:13 +01:00
Thorvald Natvig
036c6c3310 Remove dependence on sm.sm from Win32 overlay 2010-01-24 22:19:11 +01:00
Thorvald Natvig
0baf7589ad D3D9, D3D10 and OpenGL/Win32 pipe-based overlay 2010-01-24 17:17:35 +01:00
Thorvald Natvig
16339bfc91 Update license to 2010 2010-01-05 08:49:22 +01:00
Thorvald Natvig
8e0cbc8c78 Release heuristic 2009-08-25 19:44:17 +02:00
Thorvald Natvig
93b6c57f4b Proof-of-concept DX10 overlay 2009-08-25 18:12:05 +02:00
Thorvald Natvig
d2a64ee619 Start of DXGI Hook 2009-08-24 17:16:30 +02:00
Thorvald Natvig
865cdabaed Precache support for d3d9ex 2009-08-22 19:03:12 +02:00
Thorvald Natvig
2ce544f104 Indent and submodule update 2009-03-13 17:21:41 +01:00
Thorvald Natvig
c865f2f342 Update OpenGL overlay to recheck hook 2009-03-12 23:16:40 +01:00
Thorvald Natvig
ac0b3cf4d4 Indenting 2009-03-04 16:32:43 +01:00
Thorvald Natvig
e3f271b553 Indenting update
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1458 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-19 23:09:19 +00:00
Thorvald Natvig
e90dd48ea8 Prefetch offset for createdevice.
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1442 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-17 02:46:38 +00:00
Thorvald Natvig
061aa70e22 Trampoline-based, chaining, push/ret calling overlay.
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1440 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-17 00:22:05 +00:00
Thorvald Natvig
97abe97c73 Fix exit crash of overlay.
Also include interface replacement code. Not used yet though, it would fail if the game did device->GetSwapChain->GetDevice, unless we patch all of those as well.

git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1426 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-13 02:24:17 +00:00
Thorvald Natvig
ad2b8e2149 Update copyright for 2009
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1380 05730e5d-ab1b-0410-a4ac-84af385074fa
2009-01-05 15:12:48 +00:00
Thorvald Natvig
a47fea8f34 Remove unused DSound/OpenAL hooks from overlay source
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@1283 05730e5d-ab1b-0410-a4ac-84af385074fa
2008-09-04 11:03:32 +00:00
Thorvald Natvig
d6ef7b8c51 Compile Win32 with Visual Studio + Intel C Compiler
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@958 05730e5d-ab1b-0410-a4ac-84af385074fa
2008-03-01 16:57:14 +00:00
Thorvald Natvig
dc7e438976 Update copyright for 2008
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@908 05730e5d-ab1b-0410-a4ac-84af385074fa
2008-01-05 16:25:48 +00:00
Thorvald Natvig
fad508fc4d Win32 OpenGL overlay. ETQW :)
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@754 05730e5d-ab1b-0410-a4ac-84af385074fa
2007-08-30 12:39:16 +00:00
Thorvald Natvig
f219925553 Modularized win32 overlay.
Added preliminary DSound and OpenAL position grab to the overlay. (Only works with demos so far, no actual games work).


git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@753 05730e5d-ab1b-0410-a4ac-84af385074fa
2007-08-29 20:44:21 +00:00