From dfec277813bfbc956dcac45345a9158093d68343 Mon Sep 17 00:00:00 2001 From: Matt Graeber Date: Fri, 31 May 2013 19:35:26 -0400 Subject: Added Invoke-ReflectivePEInjection Another awesome addition from Joe Bialek. Invoke-ReflectivePEInjection is a vast improvement over Invoke-ReflectiveDllInjection. It adds the following features: * Now supports loading exe files in memory * Supports reflective dll injection into a remote process * Additional sample Visual Studio solutions --- .../DemoReflectiveDLL/DemoDLL/DemoDLL.cpp | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 CodeExecution/DemoReflectiveDLL/DemoDLL/DemoDLL.cpp (limited to 'CodeExecution/DemoReflectiveDLL/DemoDLL/DemoDLL.cpp') diff --git a/CodeExecution/DemoReflectiveDLL/DemoDLL/DemoDLL.cpp b/CodeExecution/DemoReflectiveDLL/DemoDLL/DemoDLL.cpp deleted file mode 100644 index 61380d3..0000000 --- a/CodeExecution/DemoReflectiveDLL/DemoDLL/DemoDLL.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// DemoDLL.cpp : Defines the exported functions for the DLL application. -// - -#include "stdafx.h" -#include "DemoDLL.h" - -using namespace std; - - -extern "C" __declspec( dllexport ) char* StringFunc() -{ - ostream *outputStream = NULL; - - //If you want to output to cout, simply set outputStream to &cout. This allows you to write a program that can switch between outputting to string or to cout. - //outputStream = &cout; - - ostringstream *stringStream = new ostringstream(); - outputStream = stringStream; - - (*outputStream) << "String DLL function is working" << endl << endl; - - string output = (*stringStream).str(); - const char* outputStr = output.c_str(); - - char* out = new char[output.size()+1]; - strcpy(out, outputStr); - out[output.size()] = '\0'; - - - return out; -} - -extern "C" __declspec( dllexport ) void VoidFunc() -{ - printf("Void DLL function is working, using printf to display. You will only see this if you run locally.\n\n"); - return; -} - -extern "C" __declspec( dllexport ) wchar_t* WStringFunc() -{ - wostream *outputStream = NULL; - - //If you want to output to wcout, simply set outputStream to &cout. This allows you to write a program that can switch between outputting to wstring or to wcout. - outputStream = &wcout; - - wostringstream *stringStream = new wostringstream(); - outputStream = stringStream; - - (*outputStream) << L"WString DLL function is working" << endl << endl; - - wstring output = (*stringStream).str(); - const wchar_t* outputStr = output.c_str(); - - wchar_t* out = new wchar_t[output.size()+1]; - wcscpy(out, outputStr); - out[output.size()] = '\0'; - - - return out; -} \ No newline at end of file -- cgit v1.2.3