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:
@@ -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
|
||||
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user