Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4789e9b
Fix incomplete types, undeclared identifiers, and AIIntegration names…
mentatbot[bot] Apr 18, 2025
3d61012
Fix regex_replace lambda issue, ExecutionContext, and SystemState con…
mentatbot[bot] Apr 18, 2025
1fd30ed
Fix access issues, unused parameters, and missing includes
mentatbot[bot] Apr 18, 2025
cffc450
Replace VulnerabilityViewController.mm and fix friend declarations
mentatbot[bot] Apr 18, 2025
6b39972
Add fixed VulnerabilityViewController with proper Objective-C integra…
mentatbot[bot] Apr 18, 2025
f12d93e
Fix remaining build issues with proper implementations
mentatbot[bot] Apr 18, 2025
982184f
Fix ObjC++ integration issues in VulnerabilityViewController
mentatbot[bot] Apr 18, 2025
0e8b356
Fix ObjC integration issues with VulnerabilityViewController and Main…
mentatbot[bot] Apr 18, 2025
740e774
Fix remaining build issues with MainViewController and AIIntegrationM…
mentatbot[bot] Apr 18, 2025
b7ceb6a
Fix SystemState initialization, anti-tamper, and obfuscator issues
mentatbot[bot] Apr 18, 2025
4bb3c9f
Restore full MainViewController functionality while maintaining build…
mentatbot[bot] Apr 18, 2025
c3ad24e
Fix iOS build issues with system header dependencies
mentatbot[bot] Apr 18, 2025
26d5dbd
Fix redefinition and access function issues
mentatbot[bot] Apr 18, 2025
f9b8ece
Create completely rebuilt init.hpp to fix all redefinition issues
mentatbot[bot] Apr 18, 2025
f1e605a
Complete rebuild of init.cpp and init.hpp for iOS compatibility
mentatbot[bot] Apr 18, 2025
78af34f
Implement full tab system with Lua script execution support
mentatbot[bot] Apr 18, 2025
05eab49
Fix MainViewController type conflicts and callback signatures
mentatbot[bot] Apr 18, 2025
b7e6919
Fix AI initialization callback signature
mentatbot[bot] Apr 18, 2025
e7023b0
Remove redundant MainViewController_tabs.mm file
mentatbot[bot] Apr 18, 2025
231c106
Fix iOS Objective-C block capture context in AssistantButtonController
mentatbot[bot] Apr 18, 2025
c674b5a
Replace AssistantButtonController with simplified stub implementation
mentatbot[bot] Apr 18, 2025
87b8efa
Implement proper AssistantButtonController with AI chat interface
mentatbot[bot] Apr 19, 2025
8315ca1
Fix AssistantButtonController implementation to match header declaration
mentatbot[bot] Apr 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 49 additions & 14 deletions source/cpp/anti_detection/obfuscator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ namespace AntiDetection {
return gen;
}

// Get a random number in range
static int GetRandomInt(int min, int max) {
std::uniform_int_distribution<int> dist(min, max);
return dist(GetRNG());
}

// Generate a random string of specified length
static std::string GenerateRandomString(size_t length) {
static const char charset[] =
Expand Down Expand Up @@ -140,7 +146,7 @@ namespace AntiDetection {

// Encode the string with varying techniques
for (char c : str) {
int choice = GetRNG() % 3;
int choice = GetRandomInt(0, 2);
switch (choice) {
case 0:
// Use decimal value
Expand Down Expand Up @@ -310,20 +316,36 @@ namespace AntiDetection {
std::regex stringRegex("([\"'])((?:(?!\1).|\\.)*?)\\1");

// Replace all string literals with obfuscated versions
result = std::regex_replace(result, stringRegex, [](const std::smatch& match) {
// Use standard callback function for regex_replace (iOS doesn't support lambda version)
std::string processed = result;
std::smatch match;
std::string::const_iterator searchStart(result.cbegin());

// Manual regex search and replace since direct lambda replacement not supported
while (std::regex_search(searchStart, result.cend(), match, stringRegex)) {
// Don't obfuscate empty strings
std::string replacement;
if (match[2].str().empty()) {
return match[0].str();
replacement = match[0].str();
}

// Don't obfuscate strings that look like requires or other special patterns
if (match[2].str().find("/") != std::string::npos ||
match[2].str().find(".lua") != std::string::npos) {
return match[0].str();
else if (match[2].str().find("/") != std::string::npos ||
match[2].str().find(".lua") != std::string::npos) {
replacement = match[0].str();
}
else {
replacement = ObfuscateString(match[2].str());
}

return ObfuscateString(match[2].str());
});
// Replace in the processed string
size_t pos = std::distance(result.cbegin(), match[0].first);
processed.replace(pos, match[0].length(), replacement);

// Move search position
searchStart = match.suffix().first;
}

result = processed;

return result;
}
Expand Down Expand Up @@ -464,17 +486,30 @@ namespace AntiDetection {
std::regex numberRegex("\\b(\\d+)\\b");

// Replace all numeric constants with obfuscated expressions
result = std::regex_replace(result, numberRegex, [](const std::smatch& match) {
// Use standard callback function for regex_replace (iOS doesn't support lambda version)
std::string processed = result;
std::smatch match;
std::string::const_iterator searchStart(result.cbegin());

// Manual regex search and replace since direct lambda replacement not supported
while (std::regex_search(searchStart, result.cend(), match, numberRegex)) {
try {
int value = std::stoi(match[1]);
if (value > 0 && value < 1000) { // Only obfuscate reasonable sized numbers
return ObfuscateConstant(value);
// Replace in the processed string
std::string replacement = ObfuscateConstant(value);
size_t pos = std::distance(result.cbegin(), match[0].first);
processed.replace(pos, match[0].length(), replacement);
}
} catch (...) {
// If conversion fails, just return the original
// If conversion fails, just leave as is
}
return match[0].str();
});

// Move search position
searchStart = match.suffix().first;
}

result = processed;

return result;
}
Expand Down
Loading
Loading