Linux:No manual entry for std::vector

博客围绕Linux系统中出现的‘No manual entry for std::vector’报错展开,介绍了解决该报错的方法,并对解决结果进行验证,还给出了参考链接。
bool IsRooted() { const char* paths[] = { "/system/app/Superuser.apk", "/sbin/su", "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su", "/system/bin/failsafe/su", "/data/local/su", "/su/bin/su" }; for (const auto& path : paths) { if (access(path, F_OK) == 0) return true; } return false; } // ======================== // Check Running Processes for Suspicious Names // ======================== bool IsProcessSuspicious() { DIR* proc = opendir("/proc"); if (!proc) return false; struct dirent* ent; while ((ent = readdir(proc)) != nullptr) { if (ent->d_type != DT_DIR) continue; std::string pid = ent->d_name; if (!std::all_of(pid.begin(), pid.end(), ::isdigit)) continue; std::string cmdlinePath = "/proc/" + pid + "/cmdline"; std::ifstream cmdFile(cmdlinePath, std::ios::binary); std::string line; if (std::getline(cmdFile, line, '\0')) { // cmdline is null-terminated std::transform(line.begin(), line.end(), line.begin(), ::tolower); static const std::vector<std::string> suspiciousNames = { "frida-server", "frida", "gg", "gameguardian", "termux", "canary", "httpcanary", "su", "magisk", "sqlite", "tcpdump", "xposed", "substrate", "lsposed" }; for (const auto& name : suspiciousNames) { if (line.find(name) != std::string::npos) { closedir(proc); LOGI("Suspicious process detected: %s (PID: %s)", line.c_str(), pid.c_str()); return true; } } } cmdFile.close(); } closedir(proc); return false; } // ======================== // Check for known tool binaries on disk // ======================== bool HasToolBinary() { const std::vector<std::string> toolPaths = { "/data/local/tmp/frida-server", "/data/data/com.termux/", "/storage/emulated/0/Download/gg", "/data/local/tmp/gg", "/data/local/tmp/magisk", "/system/bin/frida-server", "/system/xbin/su", "/data/local/tmp/su", "/data/local/tmp/scrcpy" }; for (const auto& path : toolPaths) { if (access(path.c_str(), F_OK) == 0) { LOGI("Malicious binary detected at: %s", path.c_str()); return true; } } return false; } // ======================== // Root & Package Detection with Crash // ======================== void RootAndToolCheck() { uintptr_t UE4Base = GetModuleBase("libUE4.so"); // Change if your target is different (e.g. libil2cpp.so) if (!UE4Base) { LOGE("Cannot perform detection: libUE4.so not loaded yet or missing."); return; } // Apply offset to get function pointer uintptr_t CMessageBoxExt_address = UE4Base + 0x7d88bb4; // ⚠️ Ensure this offset matches your build! auto CMessageBoxExt = reinterpret_cast<int(*)(int, const char16_t*, const char16_t*)>(CMessageBoxExt_address); std::vector<std::string> dangerousTools = { "com.topjohnwu.magisk", "com.noshufou.android.su", "eu.chainfire.supersu", "com.koushikdutta.rommanager", "com.dimonvideo.luckypatcher", "com.chelpus.lackypatch", "com.termux", "org.kali.nethunter", "com.guoshi.httpcanary", "catch_.me_.if_.you_.can_", // GameGuardian "com.frida.server", "re.frida.server", "org.mozilla.fenix", // Firefox Canary "com.jakting.rns", // Root Navigation "com.ghidra", "com.jadx", "com.bin.mt", "com.mt.helper" }; std::string detectedTool; for (const auto& pkg : dangerousTools) { if (IsPackageInstalled(pkg.c_str())) { detectedTool = pkg; break; } } if (IsRooted() && detectedTool.empty()) { detectedTool = "ROOT ACCESS DETECTED"; } if (!detectedTool.empty()) { std::u16string msg = u"RAT INJECTING BECAUSE YOU TRYING TO CRACK OR DUMP\nTool: "; msg += convertToUtf16(detectedTool).c_str(); msg += u"\nPehle delete kar warna teri details leak"; CMessageBoxExt(0, msg.c_str(), u"warning !! mat panga le"); // Trigger crash (simulate anti-cheat kill) __builtin_trap(); // Safer than *(int*)0 = 0; } } // ======================== Add all packages if detect it crash the game
12-20
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值