Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap minhook for Microsoft Detours #12964

Merged
merged 20 commits into from Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
@@ -1,9 +1,6 @@
[submodule "include/liblouis"]
path = include/liblouis
url = https://github.com/liblouis/liblouis.git
[submodule "include/minhook"]
path = include/minhook
url = https://github.com/RaMMicHaeL/minhook
[submodule "miscDeps"]
path = miscDeps
url = https://github.com/nvaccess/nvda-misc-deps
Expand All @@ -30,3 +27,6 @@
[submodule "include/cldr"]
path = include/cldr
url = https://github.com/unicode-org/cldr-staging.git
[submodule "include/Detours"]
path = include/detours
url = https://github.com/microsoft/Detours/
1 change: 0 additions & 1 deletion appveyor/mozillaSyms.py
Expand Up @@ -26,7 +26,6 @@
DLL_NAMES = [
"IAccessible2Proxy.dll",
"ISimpleDOM.dll",
"minHook.dll",
"nvdaHelperRemote.dll",
]
DLL_FILES = [f
Expand Down
1 change: 0 additions & 1 deletion appx/sconscript
Expand Up @@ -68,7 +68,6 @@ excludedDistFiles=[
'nvda_noUIAccess.exe',
'lib/IAccessible2Proxy.dll',
'lib/ISimpleDOM.dll',
'lib/minHook.dll',
'lib/NVDAHelperRemote.dll',
'lib64/',
'libArm64/',
Expand Down
86 changes: 1 addition & 85 deletions copying.txt
Expand Up @@ -1195,95 +1195,11 @@ e) modify or distribute the source code of any Distributable Code so that any pa
ii) others have the right to modify it.
```

= MinHook License =
This applies to MinHook, available from http://github.com/RaMMicHaeL/minhook

```
/*
* MinHook - The Minimalistic API Hooking Library for x64/x86
* Copyright (c) 2009 Tsuda Kageyu.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

================================================================================
Portions of this software are Copyright (c) 2008-2009, Vyacheslav Patkov.
================================================================================
/*
* Hacker Disassembler Engine 32 C
* Copyright (c) 2008-2009, Vyacheslav Patkov.
* All rights reserved.
*
*/

/*
* Hacker Disassembler Engine 64 C
* Copyright (c) 2008-2009, Vyacheslav Patkov.
* All rights reserved.
*
*/

================================================================================
Portions of this software are Copyright (c) 2005-2007 Paul Hsieh.
================================================================================
/* A portable stdint.h
****************************************************************************
* BSD License:
****************************************************************************
*
* Copyright (c) 2005-2007 Paul Hsieh
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

= The MIT License =
This license applies to:
- comtypes, available from http://comtypes.sourceforge.net/
- py2exe: copyright (c) 2000-2005 Thomas Heller, Mark Hammond, Jimmy Retzlaff, available from http://www.py2exe.org/
- Microsoft Detours: Copyright (c) Microsoft Corporation, available from https://github.com/microsoft/Detours
-

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
1 change: 1 addition & 0 deletions include/detours
Submodule detours added at 45a76a
1 change: 0 additions & 1 deletion include/minhook
Submodule minhook deleted from ed5b51
8 changes: 2 additions & 6 deletions nvdaHelper/archBuild_sconscript
Expand Up @@ -212,12 +212,8 @@ if signExec:
env.AddPostAction(clientLib[0],[signExec])
env.Install(clientInstallDir,clientLib)

if TARGET_ARCH != 'arm64':
minHookLib=env.SConscript('minHook/sconscript')
Export('minHookLib')
if signExec:
env.AddPostAction(minHookLib[0],[signExec])
env.Install(libInstallDir,minHookLib)
detoursLib = env.SConscript('detours/sconscript')
Export('detoursLib')

remoteLib=env.SConscript('remote/sconscript')
Export('remoteLib')
Expand Down
28 changes: 28 additions & 0 deletions nvdaHelper/detours/sconscript
@@ -0,0 +1,28 @@
Import([
"thirdPartyEnv"
])

import typing

thirdPartyEnv: Environment = thirdPartyEnv
env: Environment = typing.cast(Environment, thirdPartyEnv.Clone())

detoursPath=Dir('#include/detours')
detoursSrcPath = detoursPath.Dir('src')

env.Prepend(CPPPATH=[detoursSrcPath])

sourceFiles=[
'detours.cpp',
'disasm.cpp',
'modules.cpp',
]

objs = [env.Object(f"{f}.obj", detoursSrcPath.File(f)) for f in sourceFiles]

detoursLib=env.Library(
target='detours',
source=objs
)

Return('detoursLib')
28 changes: 0 additions & 28 deletions nvdaHelper/minHook/dllmain.cpp

This file was deleted.

33 changes: 0 additions & 33 deletions nvdaHelper/minHook/sconscript

This file was deleted.