-
-
Save hasherezade/45a9cdaa76ea752d6ce46e0f8ab9918e to your computer and use it in GitHub Desktop.
FlareOn 8 - Task 7 (loader)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required ( VERSION 2.8...3.21 ) | |
project (spell_loader) | |
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") | |
set (srcs | |
main.cpp | |
) | |
set (hdrs | |
resource.h | |
) | |
set (rsrc | |
resource.rc | |
) | |
add_executable( ${PROJECT_NAME} ${rsrc} ${hdrs} ${srcs} ) | |
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX} COMPONENT ${PROJECT_NAME} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <iostream> | |
int main() | |
{ | |
HMODULE lib = LoadLibraryA("ldr.dll"); | |
if (!lib) { | |
return -1; | |
} | |
FARPROC func = GetProcAddress(lib, "Start"); | |
if (!func) { | |
return -2; | |
} | |
std::cout << "Calling the start function..." << std::endl; | |
int(*exp_func)() = (int(*)())func; | |
func(); | |
system("pause"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resource.h | |
#define MY_RESOURCE 128 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Microsoft Visual C++ generated resource script. | |
// | |
#include "resource.h" | |
#define APSTUDIO_READONLY_SYMBOLS | |
///////////////////////////////////////////////////////////////////////////// | |
// | |
// Generated from the TEXTINCLUDE 2 resource. | |
// | |
#include "windows.h" | |
///////////////////////////////////////////////////////////////////////////// | |
#undef APSTUDIO_READONLY_SYMBOLS | |
#ifdef APSTUDIO_INVOKED | |
///////////////////////////////////////////////////////////////////////////// | |
// | |
// TEXTINCLUDE | |
// | |
1 TEXTINCLUDE | |
BEGIN | |
"resource.h\0" | |
END | |
2 TEXTINCLUDE | |
BEGIN | |
"#include ""windows.h""\r\n" | |
"\0" | |
END | |
3 TEXTINCLUDE | |
BEGIN | |
"\r\n" | |
"\0" | |
END | |
#endif // APSTUDIO_INVOKED | |
///////////////////////////////////////////////////////////////////////////// | |
MY_RESOURCE PNG "_1_429cc0.png" | |
///////////////////////////////////////////////////////////////////////////// | |
#ifndef APSTUDIO_INVOKED | |
///////////////////////////////////////////////////////////////////////////// | |
///////////////////////////////////////////////////////////////////////////// | |
#endif // not APSTUDIO_INVOKED | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment