How is the IMSI protected ?
/* gcc -Wall imsi_example.c -o imsi_example `pkg-config --cflags --libs glib-2.0 dbus-glib-1` */ #include <stdlib.h> #include <glib.h> #include <glib/gprintf.h> #include <dbus/dbus-glib.h> #define SIM_DBUS_NAME "com.nokia.phone.SIM" #define SIM_DBUS_IFACE "Phone.Sim" #define SIM_DBUS_PATH "/com/nokia/phone/SIM" #define SIM_IMSI_SIG "get_imsi" static gchar* get_imsi(DBusGConnection *connection) { GError *error = NULL; DBusGProxy *proxy; gchar *imsi = NULL; guint32 tmp1; g_return_val_if_fail(connection, imsi); proxy = dbus_g_proxy_new_for_name(connection, SIM_DBUS_NAME, SIM_DBUS_PATH, SIM_DBUS_IFACE); if (!dbus_g_proxy_call(proxy, SIM_IMSI_SIG, &error, G_TYPE_INVALID, G_TYPE_STRING, &imsi, G_TYPE_INT, &tmp1, G_TYPE_INVALID)) { if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) g_printerr("Caught remote method exception %s: %s", dbus_g_error_get_name(error), error->message); else g_printerr("Failed to call method: %s\n", error->message); g_clear_error(&error); } g_object_unref(proxy); return imsi; } int main(void) { GError *error = NULL; DBusGConnection *connection; gchar* imsi; g_type_init(); connection = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); if (!connection) { g_printerr("Failed to open connection to system bus: %s\n", error->message); g_clear_error(&error); return EXIT_FAILURE; } imsi = get_imsi(connection); (void) g_printf("%s\n", imsi ? imsi : "Failed to retrieve IMSI\n"); if (!imsi) return EXIT_FAILURE; g_free(imsi); return EXIT_SUCCESS; }