2025-06-22 13:48:30 -03:00
|
|
|
#include "RyujinCore.hh"
|
|
|
|
|
|
2025-07-10 20:55:39 -03:00
|
|
|
/*
|
|
|
|
|
Disable all optimizations before compile for release - MSVC sucks - Build ryujincore in debug or use contexpr mainly on fix relocs
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
RYUJINCORE_API BOOL __stdcall RunRyujinCore(const char* strInputFilePath, const char* strPdbFilePath, const char* strOutputFilePath, RyujinObfuscatorConfig& config) {
|
|
|
|
|
|
|
|
|
|
if (!strInputFilePath || !strPdbFilePath || !strOutputFilePath) return FALSE;
|
|
|
|
|
|
2025-07-26 22:16:21 -03:00
|
|
|
std::vector<std::string> strProcsProcessed;
|
2025-07-10 20:55:39 -03:00
|
|
|
|
2025-07-26 22:16:21 -03:00
|
|
|
strProcsProcessed.reserve(config.m_strProceduresToObfuscate.procedureCount);
|
2025-07-10 20:55:39 -03:00
|
|
|
|
2025-07-26 22:16:21 -03:00
|
|
|
for (int i = 0; i < config.m_strProceduresToObfuscate.procedureCount; ++i)
|
|
|
|
|
strProcsProcessed.emplace_back(config.m_strProceduresToObfuscate.procedures[i]);
|
2025-07-10 20:55:39 -03:00
|
|
|
|
2025-07-26 22:16:21 -03:00
|
|
|
std::shared_ptr<RyuJinConfigInternal> ryujConfigInternal = std::make_shared<RyuJinConfigInternal>();
|
|
|
|
|
ryujConfigInternal->m_strdProceduresToObfuscate.assign(strProcsProcessed.begin(), strProcsProcessed.end());
|
2025-06-22 13:48:30 -03:00
|
|
|
|
|
|
|
|
std::unique_ptr<Ryujin> ryujin = std::make_unique<Ryujin>(strInputFilePath, strPdbFilePath, strOutputFilePath);
|
|
|
|
|
|
|
|
|
|
ryujin.get()->listRyujinProcedures();
|
|
|
|
|
|
2025-07-26 22:16:21 -03:00
|
|
|
ryujin.get()->run(config, ryujConfigInternal);
|
2025-06-22 13:48:30 -03:00
|
|
|
|
|
|
|
|
ryujin.reset();
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|