苹果助手开发随笔系列:1、需要加载的DLL

环境
作者:桑相
QQ:438788593
交流群:227246737
// 后续文章里面的测试设备都是这个
操作系统:Windows 10
iTunes版本:12.5.3.16 (x64)
手机型号:iPhone 6 plus 金色
手机系统版本:10.1.1
目前需要的DLL
CoreFoundation.dll
iTunesMobileDevice.dll
AirTrafficHost.dll
AVFoundationCF.dll
iTunes.dll
加载DLL
注意:因为iTunes是64位的,所以我的主程序也是写的64位的
// 设备状态(回调函数会用到)
struct ios_connect_info {
    HANDLE hDevice;
    unsigned int state;
};

//LoadFunctions
#define LoadLibraryModule(lib_hmodule, fun_pointer, fun_type, fun_name)  \
    fun_pointer = (fun_type)GetProcAddress(lib_hmodule, fun_name); \
    if(!fun_pointer) { break;}

//FreeLibrarys
#define FreeLibraryHandle(lib_handle)  \
    if(lib_handle) FreeLibrary(lib_handle);

#define itunes_AppleApplicationSupport_reg      _T("SOFTWARE\\Apple Inc.\\Apple Application Support")
#define itunes_AppleMobileDeviceSupport_reg     _T("SOFTWARE\\Apple Inc.\\Apple Mobile Device Support")
#define itunes_iTunes_reg                       _T("SOFTWARE\\Apple Computer, Inc.\\iTunes")


typedef     int(*func_AMDServiceConnectionSend)(HANDLE conn, char* data, UINT len);
typedef     int(*func_AMDServiceConnectionReceive)(HANDLE conn, void* data, UINT len);
typedef     void(*func_AMDServiceConnectionInvalidate)(HANDLE conn);
typedef     int(*func_AMDeviceGetInterfaceType)(HANDLE handle);
typedef     HANDLE(*func_AMDeviceRetain)(HANDLE handle);
typedef     int(*func_AMDeviceNotificationSubscribe)(void(*callback)(ios_connect_info* state), UINT uint1, UINT uint2, UINT uint3, HANDLE *notify);
typedef     int(*func_AMDeviceConnect)(HANDLE handle);
typedef     HANDLE(*func_AMDeviceCopyDeviceIdentifier)(HANDLE handle);
typedef     int(*func_AMDeviceDisconnect)(HANDLE handle);
typedef     int(*func_AMDeviceIsPaired)(HANDLE handle);
typedef     int(*func_AMDeviceValidatePairing)(HANDLE handle);
typedef     int(*func_AMDeviceStartSession)(HANDLE handle);
typedef     int(*func_AMDeviceStopSession)(HANDLE handle);
typedef     int(*func_AMDeviceSetValue)(HANDLE handle, HANDLE cfstring1, HANDLE cfstring2);
typedef     CFTypeRef(*func_AMDeviceCopyValue)(HANDLE handle, HANDLE cfstring1, HANDLE cfstring2);
//cf functions
typedef     CFStringRef(*func_CFStringMakeConstantString)(const char* data);

typedef     CFIndex(*func_CFGetTypeID)(CFTypeRef data);
typedef     CFIndex(*func_CFDictionaryGetTypeID)();
typedef     CFIndex(*func_CFDictionaryGetCount)(CFDictionaryRef theDict);
typedef     void(*func_CFDictionaryGetKeysAndValues)(CFDictionaryRef theDict, CFTypeRef *keys, CFTypeRef *values);
typedef     CFIndex(*func_CFArrayGetTypeID)();
typedef     CFIndex(*func_CFArrayGetCount)(CFArrayRef theArray);
typedef     CFTypeRef(*func_CFArrayGetValueAtIndex)(CFArrayRef theArray, CFIndex idx);
typedef     CFIndex(*func_CFStringGetTypeID)();
typedef     CFIndex(*func_CFStringGetLength)(CFStringRef data);
typedef     bool(*func_CFStringGetCString)(HANDLE cfstring, char* byteString, UINT len, UINT encode);
typedef     CFBooleanRef(*func_CFBooleanGetValue)(CFBooleanRef data);
typedef     CFIndex(*func_CFBooleanGetTypeID)();
typedef     CFIndex(*func_CFNumberGetTypeID)();
typedef     CFIndex(*func_CFNumberGetValue)(CFTypeRef data, int type, void *valuePtr);
typedef     CFNumberType(*func_CFNumberGetType)(CFTypeRef data);
typedef     CFIndex(*func_CFNumberGetByteSize)(CFTypeRef data);
typedef     CFIndex(*func_CFDataGetTypeID)();
typedef     CFIndex(*func_CFDataGetLength)(CFDataRef theData);
typedef     const uint8_t*              (*func_CFDataGetBytePtr)(CFDataRef theData);
typedef     void(*func_CFDataGetBytes)(CFDataRef theData, CFRange range, uint8_t *buffer);
typedef     CFIndex(*func_CFDateGetTypeID)();
typedef     CFDateRef(*func_CFDateCreate)(CFAllocatorRef allocator, CFAbsoluteTime at);
typedef     CFAbsoluteTime(*func_CFDateGetAbsoluteTime)(CFDateRef theDate);
typedef     CFTimeInterval(*func_CFDateGetTimeIntervalSinceDate)(CFDateRef theDate, CFDateRef otherDate);
typedef     CFComparisonResult(*func_CFDateCompare)(CFDateRef theDate, CFDateRef otherDate, void *context);

typedef     CFNumberRef(*func_CFNumberCreate)(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);


typedef     CFDataRef(*func_CFDataCreate)(CFAllocatorRef allocator, const uint8_t *bytes, CFIndex length);
typedef     CFPropertyListRef(*func_CFPropertyListCreateFromXMLData)(CFAllocatorRef allocator, CFDataRef xmlData, CFOptionFlags mutabilityOption, CFStringRef *errorString);
typedef     CFWriteStreamRef(*func_CFWriteStreamCreateWithAllocatedBuffers)(CFAllocatorRef alloc, CFAllocatorRef bufferAllocator);
typedef     bool(*func_CFWriteStreamOpen)(CFWriteStreamRef stream);
typedef     CFIndex(*func_CFPropertyListWriteToStream)(CFPropertyListRef propertyList, CFWriteStreamRef stream, CFPropertyListFormat format, CFStringRef *errorString);
typedef     CFTypeRef(*func_CFWriteStreamCopyProperty)(CFWriteStreamRef stream, CFStringRef propertyName);
typedef     void(*func_CFWriteStreamClose)(CFWriteStreamRef stream);
typedef     void(*func_CFRelease)(CFTypeRef cf);

typedef     CFMutableArrayRef(*func_CFArrayCreateMutable)(CFAllocatorRef allocator, CFIndex capacity, CFArrayCallBacks 
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值