Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef TW_CRYPTO_SYSTEM_VOLD_DEBUG
- bool strace_ing(void) {
- static int ret = -1;
- if (ret != -1)
- return ret;
- if (!TWFunc::Path_Exists("/sbin/strace")) {
- LOGDECRYPT("strace binary not found, disabling strace_ing vold_decrypt!\n");
- ret = 0;
- } else
- ret = 1;
- return ret;
- }
- pid_t strace_init(void) {
- if (!strace_ing())
- return -1;
- pid_t pid;
- int status;
- switch(pid = fork())
- {
- case -1:
- LOGDECRYPT_KMSG("forking strace_init failed: %d!\n", errno);
- return -1;
- case 0: // child
- execl("/sbin/strace", "strace", "-q", "-tt", "-ff", "-v", "-y", "-s", "1000", "-o", "/tmp/strace_init.log", "-p", "1" , NULL);
- LOGDECRYPT_KMSG("strace_init fork failed: %d!\n", errno);
- return -1;
- default:
- LOGDECRYPT_KMSG("Starting strace_init (pid=%d)\n", pid);
- //strace_ing = true;
- return pid;
- }
- }
- #endif
- bool timeout_ing(void) {
- static int ret = -1;
- if (ret != -1)
- return ret;
- if (!TWFunc::Path_Exists("/sbin/timeout")) {
- LOGDECRYPT("timeout binary not found, disabling timeout_ing vold_decrypt!\n");
- ret = 0;
- } else
- ret = 1;
- return ret;
- }
- string vdc_cryptfs_cmd(string info_text) {
- string cmd;
- cmd = "LD_LIBRARY_PATH=/system/lib64:/system/lib /system/bin/vdc cryptfs ";
- #ifdef TW_CRYPTO_SYSTEM_VOLD_DEBUG
- if (timeout_ing() && strace_ing())
- cmd = "/sbin/timeout -t 30 /sbin/strace -q -tt -ff -v -y -s 1000 -o /tmp/strace_vdc_" + info_text + " -E " + cmd;
- else if (strace_ing())
- cmd = "/sbin/strace -q -tt -ff -v -y -s 1000 -o /tmp/strace_vdc_" + info_text + " -E " + cmd;
- else
- #endif
- if (timeout_ing())
- cmd = "/sbin/timeout -t 30 env " + cmd;
- return cmd;
- }
Advertisement
Add Comment
Please, Sign In to add comment