feat: Add custom pass support for Ryujin users via callback

- Ryujin users can now register their own callbacks following the standard interface to create custom passes and extend Ryujin’s behavior.
- Updated configuration files to support safe usage.
- Adjusted README.md.
This commit is contained in:
keowu
2025-07-27 09:12:11 -03:00
parent ffe6cb9655
commit 64cdfe6e71
7 changed files with 82 additions and 4 deletions

View File

@@ -3,12 +3,20 @@
#define MAX_PROCEDURES 128
#define MAX_PROCEDURE_NAME_LEN 128
#define MAX_CALLBACKS 10
struct RyujinObfuscatorProcs {
int procedureCount;
char procedures[MAX_PROCEDURES][MAX_PROCEDURE_NAME_LEN];
};
using RyujinCallback = void (*)(RyujinProcedure*);
struct RyujinCallbacks {
int callbackCount;
RyujinCallback callbacks[MAX_CALLBACKS]; // Array de ponteiros de fun<75><6E>o
};
class RyuJinConfigInternal {
public:
@@ -30,6 +38,6 @@ public:
bool m_isAntiDump; // Enable Anti Dump technic for Ryujin protected binary
bool m_isMemoryProtection; // Memory CRC32 protection
RyujinObfuscatorProcs m_strProceduresToObfuscate; // Names of the procedures to obfuscate
// todo: passes
RyujinCallbacks m_callbacks; // Ryujin Custom Pass Callbacks
};

View File

@@ -2455,6 +2455,12 @@ BOOL RyujinObfuscationCore::Run(bool& RyujinRunOncePass) {
}
if (m_config.m_callbacks.callbackCount > 0)
for (int i = 0; i < m_config.m_callbacks.callbackCount; i++)
if (m_config.m_callbacks.callbacks[i])
m_config.m_callbacks.callbacks[i](&m_proc);
return TRUE;
}