From ac4b728452d2ebbbd69de2da1b89bed7d60cf245 Mon Sep 17 00:00:00 2001 From: nezu Date: Wed, 16 Oct 2024 06:12:56 -0700 Subject: [PATCH] initial --- ADProCrack.sln | 41 ++++ ADProCrack/ADProCrack.csproj | 264 ++++++++++++++++++++++ ADProCrack/FodyWeavers.xml | 3 + ADProCrack/Properties/AssemblyInfo.cs | 33 +++ ADProCrack/Startup.cs | 41 ++++ ADProCrack/app.config | 15 ++ ADProCrack/packages.config | 62 +++++ ADProCrackLoader/ADProCrackLoader.vcxproj | 147 ++++++++++++ ADProCrackLoader/ADProCrackLoader.vcxproj.filters | 22 ++ ADProCrackLoader/dllmain.cpp | 126 +++++++++++ Koaloader.config.json | 10 + license.lic | 15 ++ 12 files changed, 779 insertions(+) create mode 100644 ADProCrack.sln create mode 100644 ADProCrack/ADProCrack.csproj create mode 100644 ADProCrack/FodyWeavers.xml create mode 100644 ADProCrack/Properties/AssemblyInfo.cs create mode 100644 ADProCrack/Startup.cs create mode 100644 ADProCrack/app.config create mode 100644 ADProCrack/packages.config create mode 100644 ADProCrackLoader/ADProCrackLoader.vcxproj create mode 100644 ADProCrackLoader/ADProCrackLoader.vcxproj.filters create mode 100644 ADProCrackLoader/dllmain.cpp create mode 100644 Koaloader.config.json create mode 100644 license.lic diff --git a/ADProCrack.sln b/ADProCrack.sln new file mode 100644 index 0000000..8ca6be0 --- /dev/null +++ b/ADProCrack.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35327.3 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ADProCrack", "ADProCrack\ADProCrack.csproj", "{FB94FB70-1DFC-471C-BF92-7853E32F44E3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ADProCrackLoader", "ADProCrackLoader\ADProCrackLoader.vcxproj", "{78F52A0D-0EA1-457B-8A18-F9A7C35355EF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FB94FB70-1DFC-471C-BF92-7853E32F44E3}.Debug|x64.ActiveCfg = Debug|x64 + {FB94FB70-1DFC-471C-BF92-7853E32F44E3}.Debug|x64.Build.0 = Debug|x64 + {FB94FB70-1DFC-471C-BF92-7853E32F44E3}.Debug|x86.ActiveCfg = Debug|Any CPU + {FB94FB70-1DFC-471C-BF92-7853E32F44E3}.Debug|x86.Build.0 = Debug|Any CPU + {FB94FB70-1DFC-471C-BF92-7853E32F44E3}.Release|x64.ActiveCfg = Release|x64 + {FB94FB70-1DFC-471C-BF92-7853E32F44E3}.Release|x64.Build.0 = Release|x64 + {FB94FB70-1DFC-471C-BF92-7853E32F44E3}.Release|x86.ActiveCfg = Release|Any CPU + {FB94FB70-1DFC-471C-BF92-7853E32F44E3}.Release|x86.Build.0 = Release|Any CPU + {78F52A0D-0EA1-457B-8A18-F9A7C35355EF}.Debug|x64.ActiveCfg = Debug|x64 + {78F52A0D-0EA1-457B-8A18-F9A7C35355EF}.Debug|x64.Build.0 = Debug|x64 + {78F52A0D-0EA1-457B-8A18-F9A7C35355EF}.Debug|x86.ActiveCfg = Debug|Win32 + {78F52A0D-0EA1-457B-8A18-F9A7C35355EF}.Debug|x86.Build.0 = Debug|Win32 + {78F52A0D-0EA1-457B-8A18-F9A7C35355EF}.Release|x64.ActiveCfg = Release|x64 + {78F52A0D-0EA1-457B-8A18-F9A7C35355EF}.Release|x64.Build.0 = Release|x64 + {78F52A0D-0EA1-457B-8A18-F9A7C35355EF}.Release|x86.ActiveCfg = Release|Win32 + {78F52A0D-0EA1-457B-8A18-F9A7C35355EF}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {442DA2D4-CC73-4F2F-A97D-F2001B2924EE} + EndGlobalSection +EndGlobal diff --git a/ADProCrack/ADProCrack.csproj b/ADProCrack/ADProCrack.csproj new file mode 100644 index 0000000..98c8914 --- /dev/null +++ b/ADProCrack/ADProCrack.csproj @@ -0,0 +1,264 @@ + + + + + + Debug + AnyCPU + {FB94FB70-1DFC-471C-BF92-7853E32F44E3} + Library + Properties + ADProCrack + ADProCrack + v4.7.2 + 512 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + 7.3 + prompt + + + ..\x64\Release\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + + + + ..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll + + + ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + True + True + + + ..\packages\Mono.Cecil.0.11.6\lib\net40\Mono.Cecil.dll + + + ..\packages\Mono.Cecil.0.11.6\lib\net40\Mono.Cecil.Mdb.dll + + + ..\packages\Mono.Cecil.0.11.6\lib\net40\Mono.Cecil.Pdb.dll + + + ..\packages\Mono.Cecil.0.11.6\lib\net40\Mono.Cecil.Rocks.dll + + + ..\packages\MonoMod.Backports.1.1.2\lib\net452\MonoMod.Backports.dll + + + ..\packages\MonoMod.Core.1.2.0\lib\net452\MonoMod.Core.dll + + + ..\packages\MonoMod.Core.1.2.0\lib\net452\MonoMod.Iced.dll + + + ..\packages\MonoMod.ILHelpers.1.1.0\lib\net452\MonoMod.ILHelpers.dll + + + ..\packages\MonoMod.RuntimeDetour.25.2.0\lib\net452\MonoMod.RuntimeDetour.dll + + + ..\packages\MonoMod.Utils.25.0.7\lib\net452\MonoMod.Utils.dll + + + + ..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll + True + True + + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + ..\packages\System.Console.4.3.1\lib\net46\System.Console.dll + True + True + + + + ..\packages\System.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll + + + ..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll + True + True + + + ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + True + True + + + ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll + True + True + + + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + True + True + + + + ..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll + True + True + + + ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + True + True + + + ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + True + True + + + ..\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll + True + True + + + ..\packages\System.Linq.Expressions.4.3.0\lib\net463\System.Linq.Expressions.dll + True + True + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + ..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll + True + True + + + ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + True + True + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll + True + True + + + ..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll + True + True + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll + True + True + + + ..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll + True + True + + + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + + + ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + + + ..\packages\System.Text.RegularExpressions.4.3.1\lib\net463\System.Text.RegularExpressions.dll + True + True + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + + + + + + + + + ..\packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll + True + True + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + \ No newline at end of file diff --git a/ADProCrack/FodyWeavers.xml b/ADProCrack/FodyWeavers.xml new file mode 100644 index 0000000..f1dea8f --- /dev/null +++ b/ADProCrack/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ADProCrack/Properties/AssemblyInfo.cs b/ADProCrack/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..92d8ed5 --- /dev/null +++ b/ADProCrack/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ADProCrack")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ADProCrack")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fb94fb70-1dfc-471c-bf92-7853e32f44e3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ADProCrack/Startup.cs b/ADProCrack/Startup.cs new file mode 100644 index 0000000..f5d4c3f --- /dev/null +++ b/ADProCrack/Startup.cs @@ -0,0 +1,41 @@ +using MonoMod.RuntimeDetour; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ADProCrack +{ + internal class Startup + { + + static Hook verifyLicenseHook; + + [STAThread] + private static int EntryPoint(string args) + { + try + { + Assembly main = Assembly.GetEntryAssembly() ?? throw new Exception("Could not load the main assembly."); + Type licenseValidator = main.GetType("ADToolkit.LicenseValidator") ?? throw new Exception("Could not find the license validator type."); + MethodInfo verifyLicense = licenseValidator.GetMethod("VerifyLicense") ?? throw new Exception("Could not find the validate method."); + verifyLicenseHook = new Hook(verifyLicense, typeof(Startup).GetMethod("VerifyLicenseHook")); + return 0; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Crack Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return 1; + } + } + + public static bool VerifyLicenseHook(string publicKey, string encryptedData, string encodedSignature) + { + return true; + } + + } +} diff --git a/ADProCrack/app.config b/ADProCrack/app.config new file mode 100644 index 0000000..2cb17f9 --- /dev/null +++ b/ADProCrack/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ADProCrack/packages.config b/ADProCrack/packages.config new file mode 100644 index 0000000..481e357 --- /dev/null +++ b/ADProCrack/packages.config @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ADProCrackLoader/ADProCrackLoader.vcxproj b/ADProCrackLoader/ADProCrackLoader.vcxproj new file mode 100644 index 0000000..ca168d6 --- /dev/null +++ b/ADProCrackLoader/ADProCrackLoader.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {78f52a0d-0ea1-457b-8a18-f9a7c35355ef} + ADProCrackLoader + 10.0 + + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;ADPROCRACKLOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + WIN32;NDEBUG;ADPROCRACKLOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + Level3 + true + _DEBUG;ADPROCRACKLOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;ADPROCRACKLOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + NotUsing + pch.h + + + Windows + true + true + true + false + + + + + + + + + \ No newline at end of file diff --git a/ADProCrackLoader/ADProCrackLoader.vcxproj.filters b/ADProCrackLoader/ADProCrackLoader.vcxproj.filters new file mode 100644 index 0000000..4dd0cd7 --- /dev/null +++ b/ADProCrackLoader/ADProCrackLoader.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/ADProCrackLoader/dllmain.cpp b/ADProCrackLoader/dllmain.cpp new file mode 100644 index 0000000..679e7a5 --- /dev/null +++ b/ADProCrackLoader/dllmain.cpp @@ -0,0 +1,126 @@ +#include +#include +#include +#include +#include + +#pragma comment(lib, "mscoree.lib") + +EXTERN_C IMAGE_DOS_HEADER __ImageBase; + +static const LPCWSTR Assembly = L"\\ADProCrack.dll"; +static const LPCWSTR Class = L"ADProCrack.Startup"; +static const LPCWSTR Method = L"EntryPoint"; +static const LPCWSTR Param = L""; + + +static DWORD WINAPI CreateDotNetRunTime(LPVOID lpParam) +{ + ICLRRuntimeHost* lpRuntimeHost = NULL; + ICLRRuntimeInfo* lpRuntimeInfo = NULL; + ICLRMetaHost* lpMetaHost = NULL; + + LPWSTR AppPath = new WCHAR[_MAX_PATH]; + ::GetModuleFileNameW((HINSTANCE)&__ImageBase, AppPath, _MAX_PATH); + + std::wstring tempPath = AppPath; + size_t index = tempPath.rfind('\\'); + tempPath.erase(index, tempPath.length() - index); + tempPath += Assembly; + + HRESULT hr = CLRCreateInstance( + CLSID_CLRMetaHost, + IID_ICLRMetaHost, + (LPVOID*)&lpMetaHost + ); + + if (FAILED(hr)) + { + MessageBoxA(NULL, "Failed to create CLR instance.", "Error", MB_ICONERROR); + return 1; + } + + hr = lpMetaHost->GetRuntime( + L"v4.0.30319", + IID_PPV_ARGS(&lpRuntimeInfo) + ); + + if (FAILED(hr)) + { + MessageBoxA(NULL, "Failed to acquire CLR runtime.", "Error", MB_ICONERROR); + + lpMetaHost->Release(); + } + + BOOL fLoadable; + hr = lpRuntimeInfo->IsLoadable(&fLoadable); + + if (FAILED(hr) || !fLoadable) + { + MessageBoxA(NULL, "Runtime is not loadable.", "Error", MB_ICONERROR); + + lpRuntimeInfo->Release(); + lpMetaHost->Release(); + } + + hr = lpRuntimeInfo->GetInterface( + CLSID_CLRRuntimeHost, + IID_PPV_ARGS(&lpRuntimeHost) + ); + + if (FAILED(hr)) + { + MessageBoxA(NULL, "Failed to acquire runtime host.", "Error", MB_ICONERROR); + + lpRuntimeInfo->Release(); + lpMetaHost->Release(); + } + + hr = lpRuntimeHost->Start(); + + if (FAILED(hr)) + { + MessageBoxA(NULL, "Failed to start runtime.", "Error", MB_ICONERROR); + + lpRuntimeHost->Release(); + lpRuntimeInfo->Release(); + lpMetaHost->Release(); + } + + DWORD dwRetCode = 0; + + hr = lpRuntimeHost->ExecuteInDefaultAppDomain( + (LPWSTR)tempPath.c_str(), + Class, + Method, + Param, + &dwRetCode + ); + + if (FAILED(hr)) + { + MessageBoxA(NULL, "Failed to execute assembly.", "Error", MB_ICONERROR); + + lpRuntimeHost->Stop(); + lpRuntimeHost->Release(); + lpRuntimeInfo->Release(); + lpMetaHost->Release(); + } + + return 0; +} + +DWORD APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved) +{ + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + CreateThread(NULL, NULL, CreateDotNetRunTime, NULL, NULL, NULL); + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + default: + break; + } + return true; +} \ No newline at end of file diff --git a/Koaloader.config.json b/Koaloader.config.json new file mode 100644 index 0000000..16c98d1 --- /dev/null +++ b/Koaloader.config.json @@ -0,0 +1,10 @@ +{ + "logging": false, + "auto_load": false, + "modules": [ + { + "path": "ADProCrackLoader.dll", + "required": true + } + ] +} \ No newline at end of file diff --git a/license.lic b/license.lic new file mode 100644 index 0000000..e2ba1bb --- /dev/null +++ b/license.lic @@ -0,0 +1,15 @@ +-----BEGIN LICENSE FILE----- +eyJlbmMiOiJleUprWVhSaElqcDdJbUYwZEhKcFluVjBaWE1pT25zaVpYaHdhWEo1 +SWpwdWRXeHNMQ0p6ZEdGMGRYTWlPaUpqY21GamEyVmtJbjE5TENKdFpYUmhJanA3 +SW1WNGNHbHllU0k2SWpJeE1qUXRNREV0TURGVU1EQTZNREE2TURBdU1EQXdXaUo5 +TENKcGJtTnNkV1JsWkNJNlczc2lhV1FpT2lJeU4ySmtPVGd3TXkxbVlXWXpMVFF3 +TXpndFlXUXhOeTA0TnpJd01HWm1NbVUzWmpVaUxDSjBlWEJsSWpvaVkzSmhZMnNp +TENKaGRIUnlhV0oxZEdWeklqcDdJbTVoYldVaU9pSmpjbUZqYTJWa0luMTlMSHNp +YVdRaU9pSXlaakZoT0dNMllpMDVPR0psTFRRMllXWXRPRFl5TXkwell6aGlNRFUx +T1RVM09EQWlMQ0owZVhCbElqb2lkWE5sY25NaUxDSmhkSFJ5YVdKMWRHVnpJanA3 +SW1WdFlXbHNJam9pWTNKaFkydGxaRUJqY21GamEyVmtMbXh2YkNKOWZTeDdJbWxr +SWpvaU1tTmxNR1k0WVRZdE1HUXhOQzAwTWpjekxUazNOR1l0WkdGaFpUVXdNekEx +WmpCa0lpd2lkSGx3WlNJNkluQnZiR2xqYVdWeklpd2lZWFIwY21saWRYUmxjeUk2 +ZXlKa2RYSmhkR2x2YmlJNmJuVnNiSDE5WFgwPSIsInNpZyI6ImNyYWNrZWQiLCJh +bGciOiJjcmFja2VkIn0= +-----END LICENSE FILE-----