Esempio n. 1
0
        public unsafe static string AMDeviceCopyValue(void *device, string name)
        {
            string result;

            try
            {
                MobileDeviceBase.__CFString *ptr = MobileDeviceBase.AMDeviceCopyValue_1(device, 0u, MobileDeviceBase.__CFStringMakeConstantString(MobileDeviceBase.StringToCString(name)));
                if (ptr != null)
                {
                    uint   num   = (uint)MobileDeviceBase.CFStringGetLength(ptr);
                    uint   num2  = 4u * num + 2u;
                    sbyte *value = (sbyte *)MobileDevice32.malloc(num2);
                    MobileDeviceBase.CFStringGetCString(ptr, (void *)value, (int)num2, 134217984u);
                    UTF8Marshaler uTF8Marshaler = new UTF8Marshaler();
                    result = (string)uTF8Marshaler.MarshalNativeToManaged(new IntPtr((void *)value));
                    return(result);
                }
            }
            catch (Exception ex)
            {
                LogViewer.LogEvent(0, "AMDeviceCopyValue Error: " + ex.ToString());
                result = "Unknown";
                return(result);
            }
            result = string.Empty;
            return(result);
        }
Esempio n. 2
0
 public unsafe static extern int CFStringGetLength(MobileDeviceBase.__CFString *thisString);
Esempio n. 3
0
 public unsafe static extern byte CFStringGetCString(MobileDeviceBase.__CFString *thisString, void *value, int length, uint format);