├── LICENSE ├── MsgBoxDLL ├── LaunchDLL.cpp ├── LaunchDLL.o ├── bin │ └── Release │ │ ├── MsgBoxDLL.dll │ │ ├── libMsgBoxDLL.a │ │ └── libMsgBoxDLL.def ├── main.cpp ├── main.h ├── main.o └── obj │ └── Release │ └── main.o ├── MsgBoxEXE ├── bin │ └── Release │ │ └── MsgBoxEXE.exe ├── main.cpp ├── main.o ├── obj │ └── Release │ │ ├── main.o │ │ └── resource.res ├── resource.h └── resource.rc ├── README.md ├── dll.png └── exe.PNG /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Bart 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MsgBoxDLL/LaunchDLL.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | typedef int (*MsgFunction)(int); 7 | 8 | HINSTANCE hinstDLL; 9 | 10 | int main(){ 11 | MsgFunction MsgBox(0); 12 | hinstDLL = LoadLibrary("MsgBoxDLL.dll"); 13 | if(hinstDLL != 0){ 14 | MsgBox = (MsgFunction)GetProcAddress(hinstDLL, "MsgBox"); 15 | } 16 | if(MsgBox == 0)cout << "MsgBox is NULL\n"; 17 | int x = MsgBox(5); 18 | if(x == 5){ 19 | cout << "Message displayed!\n"; 20 | } 21 | FreeLibrary(hinstDLL); 22 | return 0; 23 | } -------------------------------------------------------------------------------- /MsgBoxDLL/LaunchDLL.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxDLL/LaunchDLL.o -------------------------------------------------------------------------------- /MsgBoxDLL/bin/Release/MsgBoxDLL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxDLL/bin/Release/MsgBoxDLL.dll -------------------------------------------------------------------------------- /MsgBoxDLL/bin/Release/libMsgBoxDLL.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxDLL/bin/Release/libMsgBoxDLL.a -------------------------------------------------------------------------------- /MsgBoxDLL/bin/Release/libMsgBoxDLL.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | MsgBox @1 3 | -------------------------------------------------------------------------------- /MsgBoxDLL/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "Shlobj.h" 8 | 9 | // a sample exported function 10 | int DLL_EXPORT MsgBox(int x = 0){ 11 | MessageBox(0, "Hello from DLL", "DLL", MB_OK); 12 | return x; 13 | } 14 | 15 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) 16 | { 17 | switch (fdwReason) 18 | { 19 | case DLL_PROCESS_ATTACH: 20 | // attach to process 21 | break; 22 | 23 | case DLL_PROCESS_DETACH: 24 | // detach from process 25 | break; 26 | 27 | case DLL_THREAD_ATTACH: 28 | // attach to thread 29 | break; 30 | 31 | case DLL_THREAD_DETACH: 32 | // detach from thread 33 | break; 34 | } 35 | return TRUE; //success 36 | } 37 | -------------------------------------------------------------------------------- /MsgBoxDLL/main.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_H__ 2 | #define __MAIN_H__ 3 | 4 | #include 5 | 6 | #define DLL_EXPORT __declspec(dllexport) 7 | 8 | #ifdef __cplusplus 9 | extern "C" 10 | { 11 | #endif 12 | //Call export here 13 | int DLL_EXPORT MsgBox(int x); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif // __MAIN_H__ 20 | -------------------------------------------------------------------------------- /MsgBoxDLL/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxDLL/main.o -------------------------------------------------------------------------------- /MsgBoxDLL/obj/Release/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxDLL/obj/Release/main.o -------------------------------------------------------------------------------- /MsgBoxEXE/bin/Release/MsgBoxEXE.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxEXE/bin/Release/MsgBoxEXE.exe -------------------------------------------------------------------------------- /MsgBoxEXE/main.cpp: -------------------------------------------------------------------------------- 1 | #ifndef UNICODE 2 | #define UNICODE 3 | #endif 4 | 5 | #include 6 | 7 | int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR szCmdLine, int nCmdShow) 8 | { 9 | MessageBox(NULL,L"Hello from EXE",L"EXE",MB_OK); 10 | return 0; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /MsgBoxEXE/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxEXE/main.o -------------------------------------------------------------------------------- /MsgBoxEXE/obj/Release/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxEXE/obj/Release/main.o -------------------------------------------------------------------------------- /MsgBoxEXE/obj/Release/resource.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/MsgBoxEXE/obj/Release/resource.res -------------------------------------------------------------------------------- /MsgBoxEXE/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef IDC_STATIC 2 | #define IDC_STATIC (-1) 3 | #endif 4 | 5 | #define DLG_MAIN 100 6 | -------------------------------------------------------------------------------- /MsgBoxEXE/resource.rc: -------------------------------------------------------------------------------- 1 | // Generated by ResEdit 1.5.10 2 | // Copyright (C) 2006-2012 3 | // http://www.resedit.net 4 | 5 | #include 6 | #include 7 | #include 8 | #include "resource.h" 9 | 10 | 11 | 12 | 13 | // 14 | // Dialog resources 15 | // 16 | LANGUAGE 0, SUBLANG_NEUTRAL 17 | DLG_MAIN DIALOG 0, 0, 186, 95 18 | STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU 19 | CAPTION "Dialog" 20 | FONT 8, "Ms Shell Dlg" 21 | { 22 | } 23 | 24 | 25 | 26 | // 27 | // Manifest resources 28 | // 29 | LANGUAGE 0, SUBLANG_NEUTRAL 30 | 1 RT_MANIFEST ".\\manifest.xml" 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :open_file_folder: MessageBoxTests 2 | 3 | ### What? 4 | MessageBox files (EXE, DLL) for testing purposes. These files will simply display a message box upon execution. 5 | 6 | ### Why? 7 | I sometimes find myself needing to test or call an executable or DLL, either from rundll32, using other injections methods, or simply from another application. Surprisingly, there's hardly any like these on Github. I decided to create this repository so it could perhaps assist others. 8 | 9 | ### How? 10 | 11 | #### Compiling 12 | 13 | You should be able to compile the code, which is C++ and probably horrible, using either [Visual Studio](https://visualstudio.microsoft.com/) or [GCC](https://gcc.gnu.org/). 14 | 15 | Compiled versions (32-bit only) are also available: 16 | * [EXE](MsgBoxEXE/bin/Release/MsgBoxEXE.exe) (MD5 hash: 7f3aad78d9023036188ac05afec4ee5e) 17 | * [DLL](MsgBoxDLL/bin/Release/MsgBoxDLL.dll) (MD5 hash: 99b824d3f8cf9f0cb708e8c3b09cf8db) 18 | 19 | #### Using 20 | 21 | Execute or call the EXE or DLL. For the DLL, you can use _rundll_, for example: 22 | > rundll32 MsgBoxDLL.dll, MsgBox 23 | 24 | #### Screenshots: 25 | 26 | EXE 27 | 28 | ![MsgBox EXE](/exe.PNG "EXE") 29 | 30 | 31 | DLL 32 | 33 | ![MsgBox DLL](/dll.png "DLL") 34 | 35 | ### What else? 36 | 37 | If you don't like these, or you need 64-bit binaries, you can check out Matt Nelson's [MessageBox](https://github.com/enigma0x3/MessageBox) version. 38 | 39 | If you're looking for injection methods, have a look at Rui's [injectAllTheThings](https://github.com/fdiskyou/injectAllTheThings) project. 40 | -------------------------------------------------------------------------------- /dll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/dll.png -------------------------------------------------------------------------------- /exe.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bartblaze/MessageBoxTests/192e7d9ab5533f6d2cba0fc1a57c0128573f1330/exe.PNG --------------------------------------------------------------------------------