1+ //===============================================================================================//
2+ // Copyright (c) 2012, Stephen Fewer of Harmony Security (www.harmonysecurity.com)
3+ // All rights reserved.
4+ //
5+ // Redistribution and use in source and binary forms, with or without modification, are permitted
6+ // provided that the following conditions are met:
7+ //
8+ // * Redistributions of source code must retain the above copyright notice, this list of
9+ // conditions and the following disclaimer.
10+ //
11+ // * Redistributions in binary form must reproduce the above copyright notice, this list of
12+ // conditions and the following disclaimer in the documentation and/or other materials provided
13+ // with the distribution.
14+ //
15+ // * Neither the name of Harmony Security nor the names of its contributors may be used to
16+ // endorse or promote products derived from this software without specific prior written permission.
17+ //
18+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19+ // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20+ // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21+ // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23+ // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25+ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26+ // POSSIBILITY OF SUCH DAMAGE.
27+ //===============================================================================================//
28+ #ifndef _REFLECTIVEDLLINJECTION_REFLECTIVEDLLINJECTION_H
29+ #define _REFLECTIVEDLLINJECTION_REFLECTIVEDLLINJECTION_H
30+ //===============================================================================================//
31+ #define WIN32_LEAN_AND_MEAN
32+ #include <windows.h>
33+
34+ // we declare some common stuff in here...
35+
36+ #define DLL_QUERY_HMODULE 6
37+
38+ #define DEREF ( name )*(UINT_PTR *)(name)
39+ #define DEREF_64 ( name )*(DWORD64 *)(name)
40+ #define DEREF_32 ( name )*(DWORD *)(name)
41+ #define DEREF_16 ( name )*(WORD *)(name)
42+ #define DEREF_8 ( name )*(BYTE *)(name)
43+
44+ typedef ULONG_PTR (WINAPI * REFLECTIVELOADER )(VOID );
45+ typedef BOOL (WINAPI * DLLMAIN )(HINSTANCE , DWORD , LPVOID );
46+
47+ #define DLLEXPORT __declspec( dllexport )
48+
49+ //===============================================================================================//
50+ #endif
51+ //===============================================================================================//
0 commit comments