From f37b592788bffcb9a70d211aef8b1f84751114ca Mon Sep 17 00:00:00 2001 From: Robert Gadbois Date: Wed, 21 Mar 2018 15:06:22 +0100 Subject: idevicediagnostics: Add ioregentry command to query device IORegistry by entry Starting with iOS 9.1, querying IORegistry by plane stopped working. This commit will add a new command that allows querying by entry that will allow gathering data for devices with newer iOS versions again (including iOS 11). --- tools/idevicediagnostics.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'tools/idevicediagnostics.c') diff --git a/tools/idevicediagnostics.c b/tools/idevicediagnostics.c index 2ea986f..66e192f 100644 --- a/tools/idevicediagnostics.c +++ b/tools/idevicediagnostics.c @@ -40,7 +40,8 @@ enum cmd_mode { CMD_SHUTDOWN, CMD_DIAGNOSTICS, CMD_MOBILEGESTALT, - CMD_IOREGISTRY + CMD_IOREGISTRY, + CMD_IOREGISTRY_ENTRY }; static void print_xml(plist_t node) @@ -156,6 +157,15 @@ int main(int argc, char **argv) } continue; } + else if (!strcmp(argv[i], "ioregentry")) { + cmd = CMD_IOREGISTRY_ENTRY; + /* read key */ + i++; + if (argv[i]) { + cmd_arg = strdup(argv[i]); + } + continue; + } else { print_usage(argc, argv); return 0; @@ -232,6 +242,16 @@ int main(int argc, char **argv) printf("Unable to query mobilegestalt keys.\n"); } break; + case CMD_IOREGISTRY_ENTRY: + if (diagnostics_relay_query_ioregistry_entry(diagnostics_client, cmd_arg == NULL ? "": cmd_arg, "", &node) == DIAGNOSTICS_RELAY_E_SUCCESS) { + if (node) { + print_xml(node); + result = EXIT_SUCCESS; + } + } else { + printf("Unable to retrieve IORegistry from device.\n"); + } + break; case CMD_IOREGISTRY: if (diagnostics_relay_query_ioregistry_plane(diagnostics_client, cmd_arg == NULL ? "": cmd_arg, &node) == DIAGNOSTICS_RELAY_E_SUCCESS) { if (node) { @@ -292,6 +312,7 @@ void print_usage(int argc, char **argv) printf(" diagnostics [TYPE]\t\tprint diagnostics information from device by TYPE (All, WiFi, GasGauge, NAND)\n"); printf(" mobilegestalt KEY [...]\tprint mobilegestalt keys passed as arguments seperated by a space.\n"); printf(" ioreg [PLANE]\t\t\tprint IORegistry of device, optionally by PLANE (IODeviceTree, IOPower, IOService) (iOS 5+ only)\n"); + printf(" ioregentry [KEY]\t\tprint IORegistry entry of device (AppleARMPMUCharger, ASPStorage, ...) (iOS 5+ only)\n"); printf(" shutdown\t\t\tshutdown device\n"); printf(" restart\t\t\trestart device\n"); printf(" sleep\t\t\t\tput device into sleep mode (disconnects from host)\n\n"); -- cgit v1.1-32-gdbae