add: additional information to ptrace command

This commit adds more information to the ptrace command to allow better integration with external features.
This commit is contained in:
ThePedroo
2024-08-10 13:43:14 -03:00
parent 88f1b7fdb9
commit 75a004f9d5
6 changed files with 139 additions and 21 deletions
+46 -1
View File
@@ -82,7 +82,52 @@ int main(int argc, char **argv) {
}
}
printf("Is the daemon running: %s\n", info.running ? "yes" : "no");
#ifdef __LP64__
printf("Daemon64 running: %d\n", status64.daemon_running);
printf("Zygote64 injected: %s\n", status64.zygote_injected ? "yes" : "no");
#else
printf("Daemon32 running: %s\n", status32.daemon_running ? "yes" : "no");
printf("Zygote32 injected: %s\n", status32.zygote_injected ? "yes" : "no");
#endif
switch (tracing_state) {
case TRACING: {
printf("Tracing state: TRACING\n");
break;
}
case STOPPING: {
printf("Tracing state: STOPPING\n");
printf("Stop reason: %s\n", monitor_stop_reason);
break;
}
case STOPPED: {
printf("Tracing state: STOPPED\n");
printf("Stop reason: %s\n", monitor_stop_reason);
break;
}
case EXITING: {
printf("Tracing state: EXITING\n");
break;
}
}
if (info.modules->modules_count != 0) {
printf("Modules: %zu\n", info.modules->modules_count);
for (size_t i = 0; i < info.modules->modules_count; i++) {
printf(" - %s\n", info.modules->modules[i]);
free(info.modules->modules[i]);
}
free(info.modules->modules);
} else {
printf("Modules: N/A\n");
}
return 0;
} else {