CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/exploits/CVE-2015-2426/common/ReflectiveDLLInjection.h
Views: 11783
1
//===============================================================================================//
2
// Copyright (c) 2013, 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_METASPLOIT_ATTACH 4
37
#define DLL_METASPLOIT_DETACH 5
38
#define DLL_QUERY_HMODULE 6
39
40
#define DEREF( name )*(UINT_PTR *)(name)
41
#define DEREF_64( name )*(DWORD64 *)(name)
42
#define DEREF_32( name )*(DWORD *)(name)
43
#define DEREF_16( name )*(WORD *)(name)
44
#define DEREF_8( name )*(BYTE *)(name)
45
46
typedef ULONG_PTR (WINAPI * REFLECTIVELOADER)( VOID );
47
typedef BOOL (WINAPI * DLLMAIN)( HINSTANCE, DWORD, LPVOID );
48
49
#define DLLEXPORT __declspec( dllexport )
50
51
//===============================================================================================//
52
#endif
53
//===============================================================================================//
54