C++: Output DLL injection boilerplate project

This commit is contained in:
Katy Coe
2020-07-19 15:44:26 +02:00
parent 071b1efa67
commit 386a666fff
4 changed files with 642 additions and 26 deletions

View File

@@ -60,6 +60,192 @@ namespace Il2CppInspector.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
///
///#define WIN32_LEAN_AND_MEAN
///#include &quot;windows.h&quot;
///#include &quot;dllmain.h&quot;
///
///// DLL entry point
///BOOL APIENTRY DllMain( HMODULE hModule,
/// DWORD ul_reason_for_call,
/// LPVOID lpReserved
/// )
///{
/// switch (ul_reason_for_call)
/// {
/// case DLL_PROCESS_ATTACH:
/// init_il2cpp();
/// CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) Run, NULL, [rest of string was truncated]&quot;;.
/// </summary>
internal static string Cpp_DLLMainCpp {
get {
return ResourceManager.GetString("Cpp-DLLMainCpp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
///
///// Entry point declaration for custom injected code
///void Run();
///
///// IL2CPP initializer
///void init_il2cpp();.
/// </summary>
internal static string Cpp_DLLMainH {
get {
return ResourceManager.GetString("Cpp-DLLMainH", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
///// Logging functions
///
///#define WIN32_LEAN_AND_MEAN
///#define WIN32_EXTRA_LEAN
///#include &lt;windows.h&gt;
///#include &quot;helpers.h&quot;
///
///// Write some text to the log file
///void LogWrite(std::string text)
///{
/// HANDLE hfile = CreateFileW(LOG_FILE, FILE_APPEND_DATA, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
///
/// if (hfile == INVALID_HANDLE_VALUE)
/// MessageBox(0, L&quot;Could not open log file&quot;, 0, [rest of string was truncated]&quot;;.
/// </summary>
internal static string Cpp_HelpersCpp {
get {
return ResourceManager.GetString("Cpp-HelpersCpp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
///// Logging functions
///
///#pragma once
///#include &lt;string&gt;
///#include &lt;sstream&gt;
///#include &lt;iomanip&gt;
///
///extern const LPCWSTR LOG_FILE;
///
///// Helper function to append text to a file
///void LogWrite(std::string text);
///
///// Helper function to convert a pointer to hex
///template&lt;typename T&gt; std::string to_hex_string(T i) {
/// std::stringstream stream;
/// stream &lt;&lt; &quot;0x&quot; &lt;&lt; std::setfill(&apos;0&apos;) &lt;&lt; std::setw(sizeof(T) * 2) &lt;&lt; [rest of string was truncated]&quot;;.
/// </summary>
internal static string Cpp_HelpersH {
get {
return ResourceManager.GetString("Cpp-HelpersH", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
///// IL2CPP application initializer
///
///#pragma once
///
///#include &lt;cstdint&gt;
///
///// Application-specific types
///#include &quot;il2cpp-types.h&quot;
///
///// IL2CPP API function pointers
///#include &quot;il2cpp-function-ptr.h&quot;
///
///// IL2CPP APIs
///#define DO_API(r, n, p) r (*n) p
///#include &quot;il2cpp-api-functions.h&quot;
///#undef DO_API
///
///// Application-specific functions
///#define DO_APP_FUNC(a, r, n, p) r (*n) p
///#include &quot;il2cpp-functions.h&quot;
///#und [rest of string was truncated]&quot;;.
/// </summary>
internal static string Cpp_IL2CPPInitH {
get {
return ResourceManager.GetString("Cpp-IL2CPPInitH", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
///// Custom injected code entry point
///
///#include &quot;il2cpp-init.h&quot;
///#include &quot;helpers.h&quot;
///
///using namespace app;
///
///// Set the name of your log file here
///extern const LPCWSTR LOG_FILE = L&quot;il2cpp-log.txt&quot;;
///
///// Injected code entry point
///void Run()
///{
/// LogWrite(&quot;Startup&quot;);
///
/// // Place your custom code here
///}.
/// </summary>
internal static string Cpp_MainCpp {
get {
return ResourceManager.GetString("Cpp-MainCpp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
///&lt;Project DefaultTargets=&quot;Build&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
/// &lt;ItemGroup Label=&quot;ProjectConfigurations&quot;&gt;
/// &lt;ProjectConfiguration Include=&quot;Debug|Win32&quot;&gt;
/// &lt;Configuration&gt;Debug&lt;/Configuration&gt;
/// &lt;Platform&gt;Win32&lt;/Platform&gt;
/// &lt;/ProjectConfiguration&gt;
/// &lt;ProjectConfiguration Include=&quot;Release|Win32&quot;&gt;
/// &lt;Configuration&gt;Release&lt;/Configuration&gt;
/// &lt;Platform&gt;Win32&lt;/Platform&gt;
/// &lt;/ProjectConfiguration&gt;
/// &lt;ProjectCon [rest of string was truncated]&quot;;.
/// </summary>
internal static string CppProjTemplate {
get {
return ResourceManager.GetString("CppProjTemplate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Microsoft Visual Studio Solution File, Format Version 12.00
///# Visual Studio Version 16
///VisualStudioVersion = 16.0.30204.135
///MinimumVisualStudioVersion = 10.0.40219.1
///Project(&quot;{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}&quot;) = &quot;%PROJECTNAME%&quot;, &quot;%PROJECTFILE%&quot;, &quot;{%PROJECTGUID%}&quot;
///EndProject
///Global
/// GlobalSection(SolutionConfigurationPlatforms) = preSolution
/// Debug|x64 = Debug|x64
/// Debug|x86 = Debug|x86
/// Release|x64 = Release|x64
/// Release|x86 = Release|x86
/// EndGlobalSection
/// GlobalSection(ProjectConfig [rest of string was truncated]&quot;;.
/// </summary>
internal static string CppSlnTemplate {
get {
return ResourceManager.GetString("CppSlnTemplate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
///&lt;Project ToolsVersion=&quot;4.0&quot; DefaultTargets=&quot;Build&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
@@ -80,6 +266,30 @@ namespace Il2CppInspector.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Microsoft Visual Studio Solution File, Format Version 12.00
///# Visual Studio Version 16
///%PROJECTDEFINITIONS%
///Global
/// GlobalSection(SolutionConfigurationPlatforms) = preSolution
/// Debug|Any CPU = Debug|Any CPU
/// Release|Any CPU = Release|Any CPU
/// EndGlobalSection
/// GlobalSection(ProjectConfigurationPlatforms) = postSolution
///%PROJECTCONFIGURATIONS%
/// EndGlobalSection
/// GlobalSection(SolutionProperties) = preSolution
/// HideSolutionNode = FALSE
/// EndGlobalSection
///EndGlobal
///.
/// </summary>
internal static string CsSlnTemplate {
get {
return ResourceManager.GetString("CsSlnTemplate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {%PROJECTGUID%}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
/// {%PROJECTGUID%}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -103,29 +313,5 @@ namespace Il2CppInspector.Properties {
return ResourceManager.GetString("SlnProjectDefinition", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Microsoft Visual Studio Solution File, Format Version 12.00
///# Visual Studio Version 16
///%PROJECTDEFINITIONS%
///Global
/// GlobalSection(SolutionConfigurationPlatforms) = preSolution
/// Debug|Any CPU = Debug|Any CPU
/// Release|Any CPU = Release|Any CPU
/// EndGlobalSection
/// GlobalSection(ProjectConfigurationPlatforms) = postSolution
///%PROJECTCONFIGURATIONS%
/// EndGlobalSection
/// GlobalSection(SolutionProperties) = preSolution
/// HideSolutionNode = FALSE
/// EndGlobalSection
///EndGlobal
///.
/// </summary>
internal static string SlnTemplate {
get {
return ResourceManager.GetString("SlnTemplate", resourceCulture);
}
}
}
}