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