@@ -134,13 +134,27 @@ struct FileUploadData {
134
134
135
135
#pragma region Dll_Type_Definitions
136
136
137
- typedef unsigned (__cdecl *device_notification_subscribe_ptr)(void (*f)(const DevicePointer*), long, long, long, HANDLE*);
138
137
139
138
#ifdef _WIN32
139
+ typedef unsigned (__cdecl *device_notification_subscribe_ptr)(void (*f)(const DevicePointer*), long, long, long, HANDLE*);
140
140
typedef void (__cdecl *run_loop_ptr)();
141
+ typedef void * CFArrayRef ;
141
142
typedef void * CFStringRef ;
142
- typedef void * CFURLRef ;
143
143
typedef void * CFDictionaryRef ;
144
+ typedef void * CFURLRef ;
145
+ typedef void * CFPropertyListFormat ;
146
+ extern CFPropertyListFormat kCFPropertyListXMLFormat_v1_0 ;
147
+ typedef void * CFSocketNativeHandle ;
148
+ typedef unsigned (__cdecl *device_secure_start_service_ptr)(AMDeviceRef device, CFStringRef service_name, unsigned int *unknown, ServiceConnRef * handle);
149
+ typedef CFSocketNativeHandle (__cdecl *service_connection_get_socket_ptr)(ServiceConnRef con);
150
+ typedef long (__cdecl *service_connection_receive_ptr)(ServiceConnRef, void *, long );
151
+ typedef long (__cdecl *service_connection_send_message_ptr)(ServiceConnRef serviceConnection, CFDictionaryRef message, CFPropertyListFormat format);
152
+
153
+ extern service_connection_send_message_ptr __AMDServiceConnectionSendMessage;
154
+ extern service_connection_receive_ptr __AMDServiceConnectionReceive;
155
+
156
+ typedef unsigned (__cdecl *device_create_house_arrest_service_ptr)(const DeviceInfo*, CFStringRef identifier, void * unknown, AFCConnectionRef * handle);
157
+
144
158
typedef void *(__cdecl *device_copy_device_identifier)(const DeviceInfo*);
145
159
typedef void *(__cdecl *device_copy_value)(const DeviceInfo*, CFStringRef , CFStringRef );
146
160
typedef unsigned (__cdecl *device_uninstall_application)(HANDLE, CFStringRef , void *, void (*f)(), void*);
@@ -153,6 +167,7 @@ typedef unsigned long(__cdecl *cf_get_concrete_type_id)();
153
167
typedef unsigned (__cdecl *cfdictionary_get_count)(CFDictionaryRef );
154
168
typedef void (__cdecl *cfdictionary_get_keys_and_values)(CFDictionaryRef , const void **, const void **);
155
169
typedef CFStringRef (__cdecl *cfstring_create_with_cstring)(void *, const char *, unsigned );
170
+ typedef CFArrayRef (__cdecl *cfarray_create)(void *, const void **, long , void **);
156
171
typedef unsigned (__cdecl *device_secure_operation_with_path)(int , const DeviceInfo*, CFURLRef , CFDictionaryRef , void (*f)(), int);
157
172
typedef unsigned (__cdecl *device_secure_operation_with_bundle_id)(int , const DeviceInfo*, CFStringRef , int , void (*f)(), int);
158
173
typedef void (__cdecl *cfrelease)(CFStringRef );
@@ -183,8 +198,14 @@ typedef int(__cdecl *usb_mux_connect_by_port)(int, int, long long*);
183
198
#pragma region Dll_Method_Definitions
184
199
185
200
#ifdef _WIN32
201
+ extern HINSTANCE mobile_device_dll;
186
202
#define GET_IF_EXISTS (variable, type, dll, method_name ) (variable ? variable : variable = (type)GetProcAddress(dll, method_name))
187
203
204
+ #define AMDeviceSecureStartService GET_IF_EXISTS (__AMDeviceSecureStartService, device_secure_start_service_ptr, mobile_device_dll, " AMDeviceSecureStartService" )
205
+ #define AMDServiceConnectionGetSocket GET_IF_EXISTS (__AMDServiceConnectionGetSocket, service_connection_get_socket_ptr, mobile_device_dll, " AMDServiceConnectionGetSocket" )
206
+ #define AMDServiceConnectionReceive GET_IF_EXISTS (__AMDServiceConnectionReceive, service_connection_receive_ptr, mobile_device_dll, " AMDServiceConnectionReceive" )
207
+ #define AMDServiceConnectionSendMessage GET_IF_EXISTS (__AMDServiceConnectionSendMessage, service_connection_send_message_ptr, mobile_device_dll, " AMDServiceConnectionSendMessage" )
208
+ #define AMDeviceCreateHouseArrestService GET_IF_EXISTS (__AMDeviceCreateHouseArrestService, device_create_house_arrest_service_ptr, mobile_device_dll, " AMDeviceCreateHouseArrestService" )
188
209
#define AMDeviceNotificationSubscribe GET_IF_EXISTS (__AMDeviceNotificationSubscribe, device_notification_subscribe_ptr, mobile_device_dll, " AMDeviceNotificationSubscribe" )
189
210
#define AMDeviceCopyDeviceIdentifier GET_IF_EXISTS (__AMDeviceCopyDeviceIdentifier, device_copy_device_identifier, mobile_device_dll, " AMDeviceCopyDeviceIdentifier" )
190
211
#define AMDeviceCopyValue GET_IF_EXISTS (__AMDeviceCopyValue, device_copy_value, mobile_device_dll, " AMDeviceCopyValue" )
@@ -215,6 +236,7 @@ typedef int(__cdecl *usb_mux_connect_by_port)(int, int, long long*);
215
236
#define CFDictionaryGetCount GET_IF_EXISTS (__CFDictionaryGetCount, cfdictionary_get_count, core_foundation_dll, " CFDictionaryGetCount" )
216
237
#define CFDictionaryGetKeysAndValues GET_IF_EXISTS (__CFDictionaryGetKeysAndValues, cfdictionary_get_keys_and_values, core_foundation_dll, " CFDictionaryGetKeysAndValues" )
217
238
#define CFStringCreateWithCString GET_IF_EXISTS (__CFStringCreateWithCString, cfstring_create_with_cstring, core_foundation_dll, " CFStringCreateWithCString" )
239
+ #define CFArrayCreate GET_IF_EXISTS (__CFArrayCreate, cfarray_create, core_foundation_dll, " CFArrayCreate" )
218
240
#define CFURLCreateWithString GET_IF_EXISTS (__CFURLCreateWithString, cfurl_create_with_string, core_foundation_dll, " CFURLCreateWithString" )
219
241
#define CFDictionaryCreate GET_IF_EXISTS (__CFDictionaryCreate, cfdictionary_create, core_foundation_dll, " CFDictionaryCreate" )
220
242
#define CFRelease GET_IF_EXISTS (__CFRelease, cfrelease, core_foundation_dll, " CFRelease" )
0 commit comments