diff --git a/VirtoolsProbe/LibRef.props b/VirtoolsProbe/LibRef.props new file mode 100644 index 0000000..2c99fd2 --- /dev/null +++ b/VirtoolsProbe/LibRef.props @@ -0,0 +1,14 @@ + + + + + D:\BallanceModLoader + + + + + + $(BML_PATH) + + + \ No newline at end of file diff --git a/VirtoolsProbe/VirtoolsProbe.vcxproj b/VirtoolsProbe/VirtoolsProbe.vcxproj new file mode 100644 index 0000000..6298947 --- /dev/null +++ b/VirtoolsProbe/VirtoolsProbe.vcxproj @@ -0,0 +1,232 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + 16.0 + Win32Proj + {c8d9cfff-442c-4ccb-80d7-02b6b2e7412f} + VirtoolsProbe + 10.0 + + + + Application + true + v142 + MultiByte + Dynamic + + + Application + false + v142 + true + MultiByte + Dynamic + + + + + + + + + + + + + + + + + true + $(SolutionDir)out\$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)temp\$(Platform)\$(Configuration)\$(ProjectName)\ + + + false + $(SolutionDir)out\$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)temp\$(Platform)\$(Configuration)\$(ProjectName)\ + + + + Level3 + true + BML_EXPORT=;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp17 + $(BML_PATH)\virtools;%(AdditionalIncludeDirectories) + + + Console + true + %(AdditionalLibraryDirectories) + + + + + Level3 + true + true + true + BML_EXPORT=;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp17 + $(BML_PATH)\virtools;%(AdditionalIncludeDirectories) + + + Console + true + true + true + %(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VirtoolsProbe/VirtoolsProbe.vcxproj.filters b/VirtoolsProbe/VirtoolsProbe.vcxproj.filters new file mode 100644 index 0000000..85ded32 --- /dev/null +++ b/VirtoolsProbe/VirtoolsProbe.vcxproj.filters @@ -0,0 +1,420 @@ + + + + + {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 + + + {13a4e7ed-2c5b-49a5-a201-e5fb5cfd701c} + + + {970d5dc3-c8f4-4cb0-aea4-2caa12194d95} + + + + + Sources + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + Sources\Virtools + + + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + Headers\Virtools + + + \ No newline at end of file diff --git a/VirtoolsProbe/main.cpp b/VirtoolsProbe/main.cpp new file mode 100644 index 0000000..afb609a --- /dev/null +++ b/VirtoolsProbe/main.cpp @@ -0,0 +1,58 @@ +#include +#include +#include +#include + +#define BUFFER_SIZE 1024 + +void Assert(bool cond, const char* desc) { + if (!cond) { + std::cout << desc << std::endl; + ExitProcess(0); + } +} + +int main() { + Assert(LoadLibrary("CK2.dll"), "Error loading CK2.dll"); + + std::cout << "Press any key to run..." << std::endl; + system("pause"); + + Assert(!CKStartUp(), "CKStartUp Error"); + std::string sharedStorage; + sharedStorage.resize(BUFFER_SIZE); + std::filesystem::path rootPath, rePath, magPath, plgPath, bbPath; + GetModuleFileName(NULL, sharedStorage.data(), BUFFER_SIZE); + rootPath = sharedStorage; + rootPath = rootPath.parent_path(); + rePath = rootPath / "RenderEngines"; + magPath = rootPath / "Managers"; + plgPath = rootPath / "Plugins"; + bbPath = rootPath / "BuildingBlocks"; + + CKPluginManager* pluginManager = CKGetPluginManager(); + int k = 0; + k += pluginManager->ParsePlugins((char*)rePath.string().c_str()); + k += pluginManager->ParsePlugins((char*)magPath.string().c_str()); + k += pluginManager->ParsePlugins((char*)plgPath.string().c_str()); + k += pluginManager->ParsePlugins((char*)bbPath.string().c_str()); + std::cout << "Total loaded modules count: " << k << std::endl; + + CKContext* ctx = NULL; + Assert(!CKCreateContext(&ctx, NULL, 0), "Fail to execute CKCreateContext()"); + + // call saver + CKObjectArray* array = CreateCKObjectArray(); + CKObject* objs = ctx->CreateObject(CKCID_OBJECT, "fuck dassault", CK_OBJECTCREATION_NONAMECHECK, NULL); + array->AddIfNotHere(objs); + + CKDependencies* dep = CKGetDefaultClassDependencies(CK_DEPENDENCIES_SAVE); + dep->m_Flags = CK_DEPENDENCIES_FULL; + Assert(!ctx->Save("result.cmo", array, 0xFFFFFFFF, dep, NULL), "Fail to save CMO file"); + + DeleteCKObjectArray(array); + CKCloseContext(ctx); + CKShutdown(); + + return 0; +} \ No newline at end of file diff --git a/libcmo21.sln b/libcmo21.sln index d2770dc..a93e2e4 100644 --- a/libcmo21.sln +++ b/libcmo21.sln @@ -10,6 +10,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Unvirt", "Unvirt\Unvirt.vcx {70F64F8D-099C-4C21-B29C-0A8F1E22FB2E} = {70F64F8D-099C-4C21-B29C-0A8F1E22FB2E} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VirtoolsProbe", "VirtoolsProbe\VirtoolsProbe.vcxproj", "{C8D9CFFF-442C-4CCB-80D7-02B6B2E7412F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -34,6 +36,12 @@ Global {77E7ADB6-0D0C-4BA4-8DE7-A284C7F83941}.Release|x64.Build.0 = Release|x64 {77E7ADB6-0D0C-4BA4-8DE7-A284C7F83941}.Release|x86.ActiveCfg = Release|Win32 {77E7ADB6-0D0C-4BA4-8DE7-A284C7F83941}.Release|x86.Build.0 = Release|Win32 + {C8D9CFFF-442C-4CCB-80D7-02B6B2E7412F}.Debug|x64.ActiveCfg = Debug|Win32 + {C8D9CFFF-442C-4CCB-80D7-02B6B2E7412F}.Debug|x86.ActiveCfg = Debug|Win32 + {C8D9CFFF-442C-4CCB-80D7-02B6B2E7412F}.Debug|x86.Build.0 = Debug|Win32 + {C8D9CFFF-442C-4CCB-80D7-02B6B2E7412F}.Release|x64.ActiveCfg = Release|Win32 + {C8D9CFFF-442C-4CCB-80D7-02B6B2E7412F}.Release|x86.ActiveCfg = Release|Win32 + {C8D9CFFF-442C-4CCB-80D7-02B6B2E7412F}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE