Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/HostingCLR_inject/HostingCLR/ReflectiveDLLInjection.h
Views: 11780
#pragma once12//===============================================================================================//3// Copyright (c) 2013, Stephen Fewer of Harmony Security (www.harmonysecurity.com)4// All rights reserved.5//6// Redistribution and use in source and binary forms, with or without modification, are permitted7// provided that the following conditions are met:8//9// * Redistributions of source code must retain the above copyright notice, this list of10// conditions and the following disclaimer.11//12// * Redistributions in binary form must reproduce the above copyright notice, this list of13// conditions and the following disclaimer in the documentation and/or other materials provided14// with the distribution.15//16// * Neither the name of Harmony Security nor the names of its contributors may be used to17// endorse or promote products derived from this software without specific prior written permission.18//19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR20// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND21// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR22// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR23// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR24// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY25// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE27// POSSIBILITY OF SUCH DAMAGE.28//===============================================================================================//29#ifndef _REFLECTIVEDLLINJECTION_REFLECTIVEDLLINJECTION_H30#define _REFLECTIVEDLLINJECTION_REFLECTIVEDLLINJECTION_H31//===============================================================================================//32#define WIN32_LEAN_AND_MEAN33#include <windows.h>3435// we declare some common stuff in here...3637#define DLL_METASPLOIT_ATTACH 438#define DLL_METASPLOIT_DETACH 539#define DLL_QUERY_HMODULE 64041#define DEREF( name )*(UINT_PTR *)(name)42#define DEREF_64( name )*(DWORD64 *)(name)43#define DEREF_32( name )*(DWORD *)(name)44#define DEREF_16( name )*(WORD *)(name)45#define DEREF_8( name )*(BYTE *)(name)4647typedef ULONG_PTR(WINAPI * REFLECTIVELOADER)(VOID);48typedef BOOL(WINAPI * DLLMAIN)(HINSTANCE, DWORD, LPVOID);4950#define DLLEXPORT __declspec( dllexport )5152//===============================================================================================//53#endif54//===============================================================================================//555657