环境
作者:桑相
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 *callBacks);
typedef     void(*func_CFArrayAppendValue)(CFMutableArrayRef theArray, CFTypeRef value);
typedef     void(*func_CFArrayAppendArray)(CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange);
typedef     CFMutableDictionaryRef(*func_CFDictionaryCreateMutable)(CFAllocatorRef allocator, CFIndex capacity, CFDictionaryKeyCallBacks *keyCallBacks, CFDictionaryValueCallBacks *valueCallBacks);
typedef     void(*func_CFDictionaryAddValue)(CFMutableDictionaryRef theDict, CFTypeRef key, CFTypeRef value);//service
typedef     int(*func_AMDeviceSecureStartService)(HANDLE hDevice, HANDLE hCFServiceName, HANDLE hUnknow, HANDLE* pServiceHandle);
typedef     UINT(*func_AMDServiceConnectionGetSocket)(HANDLE pServiceHandle);
typedef     int(*func_AMDServiceConnectionGetSecureIOContext)(HANDLE pServiceHandle);
typedef     int(*func_AFCConnectionOpen)(UINT pServiceSocketHandle, unsigned int io_timeout, HANDLE* pAfcServiceHandle);
typedef     int(*func_AFCConnectionClose)(HANDLE pAfcServiceHandle);
typedef     int(*func_AFCFileInfoOpen)(HANDLE pAfcServiceHandle, const char* pszPath, HANDLE* pFileInfo);
typedef     int(*func_AFCKeyValueRead)(HANDLE pFileInfo, HANDLE* pKey, HANDLE* pValue);
typedef     int(*func_AFCKeyValueClose)(HANDLE pFileInfo);
typedef     int(*func_AFCFileRefOpen)(HANDLE pAfcServiceHandle, const char* pszPath, int mode, HANDLE& pFileRefHandle);
typedef     int(*func_AFCFileRefWrite)(HANDLE pAfcServiceHandle, HANDLE pFileRefHandle, char* pszData, LONG64 writeSize);
typedef     int(*func_AFCFileRefRead)(HANDLE pAfcServiceHandle, HANDLE pFileRefHandle, char* pszData, LONG64* readSize);
typedef     int(*func_AFCFileRefClose)(HANDLE pAfcServiceHandle, HANDLE pFileRefHandle);
typedef     int(*func_AFCDirectoryCreate)(HANDLE pAfcServiceHandle, const char *path);
typedef     int(*func_AFCDirectoryOpen)(HANDLE pAfcServiceHandle, const char* pszPath, HANDLE* pDirHandle);
typedef     int(*func_AFCDirectoryRead)(HANDLE pAfcServiceHandle, HANDLE pDirHandle, HANDLE* pBuffer);
typedef     int(*func_AFCDirectoryClose)(HANDLE pAfcServiceHandle, HANDLE pDirHandle);
typedef     int(*func_AFCRemovePath)(HANDLE pAfcServiceHandle, const char* pszPath);//ATH Functions
typedef     ATHConnectionRef(*func_ATHostConnectionCreateWithLibrary)(CFStringRef cfGuid, CFStringRef cfLibraryID, HANDLE unkown);//yes
typedef     int(*func_ATHostConnectionRetain)(ATHConnectionRef athconn);//yes
typedef     CFTypeRef(*func_ATHostConnectionReadMessage)(ATHConnectionRef athconn);//yes
typedef     int(*func_ATHostConnectionSendPowerAssertion)(ATHConnectionRef athconn, CFBooleanRef unknown);//yes
typedef     int(*func_ATHostConnectionSendSyncRequest)(ATHConnectionRef athconn, CFTypeRef cfData1, CFTypeRef cfData2, CFTypeRef cfData3);//yes
typedef     int(*func_ATHostConnectionGetGrappaSessionId)(ATHConnectionRef athconn);//yes
typedef     int(*func_ATHostConnectionSendMetadataSyncFinished)(ATHConnectionRef athconn, CFTypeRef cfData1, CFTypeRef cfData2);//yes
typedef     int(*func_ATHostConnectionSendFileProgress)(ATHConnectionRef athconn, CFStringRef cfstring1, CFStringRef cfstring2);
typedef     int(*func_ATHostConnectionSendAssetCompleted)(ATHConnectionRef athconn, CFStringRef cfstring1, CFStringRef cfstring2, CFStringRef cfstring3);//yes
typedef     int(*func_ATHostConnectionDestroy)(ATHConnectionRef athconn);
typedef     int(*func_ATHostConnectionSendFileError)(ATHConnectionRef athconn, CFStringRef cfstring1, CFStringRef cfstring2);//iTunes.dll
typedef     int(__cdecl *fun_GetHashCig)(unsigned int grappaSessionId, const char* plistdata, int plist_length, unsigned char** cigdata, int* ciglength);//itunes environment
struct ituens_environment
{wchar_t sz_dll_AppleApplicationSupport_folder[ituens_max_path] = { 0 };wchar_t sz_dll_AppleMobileDeviceSupport_folder[ituens_max_path] = { 0 };wchar_t sz_dll_iTunes_folder[ituens_max_path] = { 0 };wchar_t sz_dll_itunesmobiledevice_path[ituens_max_path] = { 0 };wchar_t sz_dll_airtraffichost_path[ituens_max_path] = { 0 };wchar_t sz_dll_corefoundation_path[ituens_max_path] = { 0 };wchar_t sz_dll_avfoundationcf_path[ituens_max_path] = { 0 };wchar_t sz_dll_itunes_path[ituens_max_path] = { 0 };wchar_t sz_itunes_version[ituens_max_path] = { 0 };DWORD is64 = 0;HMODULE hAvFoundationCF = NULL;HMODULE hCoreFoundation = NULL;HMODULE hAirTrafficHost = NULL;HMODULE hiTunesMobileDevice = NULL;HMODULE hiTunes = NULL;
};// 获取各个DLL的路径信息
iTunesApiError iTunes::get_itunes_environment(ituens_environment & env)
{iTunesApiError ituens_ret = iTunes_Ok;ituens_ret = iTunes_ReadReg_Failed;;do {HKEY regKey = nullptr;wchar_t regValue[ituens_max_path] = { 0 };unsigned long regSize = ituens_max_path * sizeof(wchar_t);DWORD dwType = REG_NONE;long ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, itunes_AppleApplicationSupport_reg, 0, KEY_WOW64_64KEY | KEY_READ, &regKey);if (!ret) {ret = RegQueryValueEx(regKey, _T("InstallDir"), 0, &dwType, (LPBYTE)env.sz_dll_AppleApplicationSupport_folder, &regSize);if (ret != 0) break;swprintf(env.sz_dll_avfoundationcf_path, L"%sAVFoundationCF.dll", env.sz_dll_AppleApplicationSupport_folder);swprintf(env.sz_dll_corefoundation_path, L"%sCoreFoundation.dll", env.sz_dll_AppleApplicationSupport_folder);}ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, itunes_AppleMobileDeviceSupport_reg, 0, KEY_WOW64_64KEY | KEY_READ, &regKey);if (!ret) {ret = RegQueryValueEx(regKey, _T("InstallDir"), 0, &dwType, (LPBYTE)env.sz_dll_AppleMobileDeviceSupport_folder, &regSize);if (ret != 0) break;swprintf(env.sz_dll_airtraffichost_path, L"%sAirTrafficHost.dll", env.sz_dll_AppleMobileDeviceSupport_folder);swprintf(env.sz_dll_itunesmobiledevice_path, L"%siTunesMobileDevice.dll", env.sz_dll_AppleMobileDeviceSupport_folder);}ret = RegOpenKeyEx(HKEY_LOCAL_MACHINE, itunes_iTunes_reg, 0, KEY_WOW64_64KEY | KEY_READ, &regKey);if (!ret) {ret = RegQueryValueEx(regKey, _T("InstallDir"), 0, &dwType, (LPBYTE)env.sz_dll_iTunes_folder, &regSize);if (ret != 0) break;swprintf(env.sz_dll_itunes_path, L"%siTunes.dll", env.sz_dll_iTunes_folder);ret = RegQueryValueEx(regKey, _T("Version"), 0, &dwType, (LPBYTE)env.sz_itunes_version, &regSize);if (ret != 0) break;regSize = sizeof(DWORD);ret = RegQueryValueEx(regKey, _T("Installed64Bit"), 0, &dwType, (LPBYTE)(&env.is64), &regSize);if (ret != 0) break;}ituens_ret = iTunes_Ok;} while (0);return ituens_ret;
}// 加载DLL和需要使用的函数以及常数值
iTunesApiError iTunes::load_itunes_library()
{iTunesApiError ituens_ret = iTunes_Ok;ituens_ret = get_itunes_environment(itunes_env);if (iTunes_Ok == ituens_ret) {wchar_t* lpsz_env = _wgetenv(L"path");wchar_t sz_env[ituens_max_path * 10] = { 0 };wsprintf(sz_env, _T("path=%s;%s;%s;%s"), itunes_env.sz_dll_AppleApplicationSupport_folder, itunes_env.sz_dll_AppleMobileDeviceSupport_folder, itunes_env.sz_dll_iTunes_folder, lpsz_env);_wputenv(sz_env);//load librarysSetCurrentDirectory(itunes_env.sz_dll_AppleApplicationSupport_folder);itunes_env.hCoreFoundation = LoadLibraryEx(itunes_env.sz_dll_corefoundation_path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);itunes_env.hAvFoundationCF = LoadLibraryEx(itunes_env.sz_dll_avfoundationcf_path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);SetCurrentDirectory(itunes_env.sz_dll_AppleMobileDeviceSupport_folder);itunes_env.hAirTrafficHost = LoadLibraryEx(itunes_env.sz_dll_airtraffichost_path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);itunes_env.hiTunesMobileDevice = LoadLibraryEx(itunes_env.sz_dll_itunesmobiledevice_path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);SetCurrentDirectory(itunes_env.sz_dll_iTunes_folder);itunes_env.hiTunes = LoadLibraryEx(itunes_env.sz_dll_itunes_path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);do{ituens_ret = iTunes_LoadLibrary_Failed;//amLoadLibraryModule(itunes_env.hiTunesMobileDevice, AMRestoreRegisterForDeviceNotifications, func_AMRestoreRegisterForDeviceNotifications, "AMRestoreRegisterForDeviceNotifications");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDServiceConnectionSend, func_AMDServiceConnectionSend, "AMDServiceConnectionSend");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDServiceConnectionReceive, func_AMDServiceConnectionReceive, "AMDServiceConnectionReceive");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceGetInterfaceType, func_AMDeviceGetInterfaceType, "AMDeviceGetInterfaceType");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDServiceConnectionInvalidate, func_AMDServiceConnectionInvalidate, "AMDServiceConnectionInvalidate");//这个API函数这个版本好像不见了//LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceRetain, func_AMDeviceRetain, "AMDeviceRetain");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceNotificationSubscribe, func_AMDeviceNotificationSubscribe, "AMDeviceNotificationSubscribe");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceConnect, func_AMDeviceConnect, "AMDeviceConnect");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceCopyDeviceIdentifier, func_AMDeviceCopyDeviceIdentifier, "AMDeviceCopyDeviceIdentifier");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceDisconnect, func_AMDeviceDisconnect, "AMDeviceDisconnect");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceIsPaired, func_AMDeviceIsPaired, "AMDeviceIsPaired");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceValidatePairing, func_AMDeviceValidatePairing, "AMDeviceValidatePairing");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceStartSession, func_AMDeviceStartSession, "AMDeviceStartSession");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceStopSession, func_AMDeviceStopSession, "AMDeviceStopSession");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceSetValue, func_AMDeviceSetValue, "AMDeviceSetValue");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceCopyValue, func_AMDeviceCopyValue, "AMDeviceCopyValue");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceGetInterfaceType, func_AMDeviceGetInterfaceType, "AMDeviceGetInterfaceType");//cfstringLoadLibraryModule(itunes_env.hCoreFoundation, CFStringMakeConstantString, func_CFStringMakeConstantString, "__CFStringMakeConstantString");LoadLibraryModule(itunes_env.hCoreFoundation, CFStringGetCString, func_CFStringGetCString, "CFStringGetCString");LoadLibraryModule(itunes_env.hCoreFoundation, CFGetTypeID, func_CFGetTypeID, "CFGetTypeID");LoadLibraryModule(itunes_env.hCoreFoundation, CFStringGetTypeID, func_CFStringGetTypeID, "CFStringGetTypeID");LoadLibraryModule(itunes_env.hCoreFoundation, CFStringGetLength, func_CFStringGetLength, "CFStringGetLength");LoadLibraryModule(itunes_env.hCoreFoundation, CFBooleanGetValue, func_CFBooleanGetValue, "CFBooleanGetValue");LoadLibraryModule(itunes_env.hCoreFoundation, CFBooleanGetTypeID, func_CFBooleanGetTypeID, "CFBooleanGetTypeID");LoadLibraryModule(itunes_env.hCoreFoundation, CFNumberGetTypeID, func_CFNumberGetTypeID, "CFNumberGetTypeID");LoadLibraryModule(itunes_env.hCoreFoundation, CFNumberGetValue, func_CFNumberGetValue, "CFNumberGetValue");LoadLibraryModule(itunes_env.hCoreFoundation, CFNumberGetType, func_CFNumberGetType, "CFNumberGetType");LoadLibraryModule(itunes_env.hCoreFoundation, CFNumberGetByteSize, func_CFNumberGetByteSize, "CFNumberGetByteSize");LoadLibraryModule(itunes_env.hCoreFoundation, CFDataCreate, func_CFDataCreate, "CFDataCreate");LoadLibraryModule(itunes_env.hCoreFoundation, CFPropertyListCreateFromXMLData, func_CFPropertyListCreateFromXMLData, "CFPropertyListCreateFromXMLData");LoadLibraryModule(itunes_env.hCoreFoundation, CFWriteStreamCreateWithAllocatedBuffers, func_CFWriteStreamCreateWithAllocatedBuffers, "CFWriteStreamCreateWithAllocatedBuffers");LoadLibraryModule(itunes_env.hCoreFoundation, CFWriteStreamOpen, func_CFWriteStreamOpen, "CFWriteStreamOpen");LoadLibraryModule(itunes_env.hCoreFoundation, CFPropertyListWriteToStream, func_CFPropertyListWriteToStream, "CFPropertyListWriteToStream");LoadLibraryModule(itunes_env.hCoreFoundation, CFWriteStreamCopyProperty, func_CFWriteStreamCopyProperty, "CFWriteStreamCopyProperty");LoadLibraryModule(itunes_env.hCoreFoundation, CFDataGetLength, func_CFDataGetLength, "CFDataGetLength");LoadLibraryModule(itunes_env.hCoreFoundation, CFDataGetBytePtr, func_CFDataGetBytePtr, "CFDataGetBytePtr");LoadLibraryModule(itunes_env.hCoreFoundation, CFWriteStreamClose, func_CFWriteStreamClose, "CFWriteStreamClose");LoadLibraryModule(itunes_env.hCoreFoundation, CFRelease, func_CFRelease, "CFRelease");LoadLibraryModule(itunes_env.hCoreFoundation, CFArrayCreateMutable, func_CFArrayCreateMutable, "CFArrayCreateMutable");LoadLibraryModule(itunes_env.hCoreFoundation, CFArrayAppendValue, func_CFArrayAppendValue, "CFArrayAppendValue");LoadLibraryModule(itunes_env.hCoreFoundation, CFArrayAppendArray, func_CFArrayAppendArray, "CFArrayAppendArray");LoadLibraryModule(itunes_env.hCoreFoundation, CFDictionaryCreateMutable, func_CFDictionaryCreateMutable, "CFDictionaryCreateMutable");LoadLibraryModule(itunes_env.hCoreFoundation, CFDictionaryAddValue, func_CFDictionaryAddValue, "CFDictionaryAddValue");LoadLibraryModule(itunes_env.hCoreFoundation, CFDictionaryGetTypeID, func_CFDictionaryGetTypeID, "CFDictionaryGetTypeID");LoadLibraryModule(itunes_env.hCoreFoundation, CFDictionaryGetCount, func_CFDictionaryGetCount, "CFDictionaryGetCount");LoadLibraryModule(itunes_env.hCoreFoundation, CFDictionaryGetKeysAndValues, func_CFDictionaryGetKeysAndValues, "CFDictionaryGetKeysAndValues");LoadLibraryModule(itunes_env.hCoreFoundation, CFArrayGetTypeID, func_CFArrayGetTypeID, "CFArrayGetTypeID");LoadLibraryModule(itunes_env.hCoreFoundation, CFArrayGetCount, func_CFArrayGetCount, "CFArrayGetCount");LoadLibraryModule(itunes_env.hCoreFoundation, CFArrayGetValueAtIndex, func_CFArrayGetValueAtIndex, "CFArrayGetValueAtIndex");LoadLibraryModule(itunes_env.hCoreFoundation, CFDataGetTypeID, func_CFDataGetTypeID, "CFDataGetTypeID");LoadLibraryModule(itunes_env.hCoreFoundation, CFDataGetLength, func_CFDataGetLength, "CFDataGetLength");LoadLibraryModule(itunes_env.hCoreFoundation, CFDataGetBytePtr, func_CFDataGetBytePtr, "CFDataGetBytePtr");LoadLibraryModule(itunes_env.hCoreFoundation, CFDataGetBytes, func_CFDataGetBytes, "CFDataGetBytes");LoadLibraryModule(itunes_env.hCoreFoundation, CFDateGetTypeID, func_CFDateGetTypeID, "CFDateGetTypeID");LoadLibraryModule(itunes_env.hCoreFoundation, CFDateCreate, func_CFDateCreate, "CFDateCreate");LoadLibraryModule(itunes_env.hCoreFoundation, CFDateGetAbsoluteTime, func_CFDateGetAbsoluteTime, "CFDateGetAbsoluteTime");LoadLibraryModule(itunes_env.hCoreFoundation, CFDateGetTimeIntervalSinceDate, func_CFDateGetTimeIntervalSinceDate, "CFDateGetTimeIntervalSinceDate");LoadLibraryModule(itunes_env.hCoreFoundation, CFDateCompare, func_CFDateCompare, "CFDateCompare");LoadLibraryModule(itunes_env.hCoreFoundation, CFNumberCreate, func_CFNumberCreate, "CFNumberCreate");//serviceLoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDeviceSecureStartService, func_AMDeviceSecureStartService, "AMDeviceSecureStartService");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDServiceConnectionGetSocket, func_AMDServiceConnectionGetSocket, "AMDServiceConnectionGetSocket");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AMDServiceConnectionGetSecureIOContext, func_AMDServiceConnectionGetSecureIOContext, "AMDServiceConnectionGetSecureIOContext");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCConnectionOpen, func_AFCConnectionOpen, "AFCConnectionOpen");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCConnectionClose, func_AFCConnectionClose, "AFCConnectionClose");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCFileInfoOpen, func_AFCFileInfoOpen, "AFCFileInfoOpen");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCKeyValueRead, func_AFCKeyValueRead, "AFCKeyValueRead");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCKeyValueClose, func_AFCKeyValueClose, "AFCKeyValueClose");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCFileRefOpen, func_AFCFileRefOpen, "AFCFileRefOpen");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCFileRefWrite, func_AFCFileRefWrite, "AFCFileRefWrite");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCFileRefRead, func_AFCFileRefRead, "AFCFileRefRead");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCFileRefClose, func_AFCFileRefClose, "AFCFileRefClose");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCDirectoryCreate, func_AFCDirectoryCreate, "AFCDirectoryCreate");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCDirectoryOpen, func_AFCDirectoryOpen, "AFCDirectoryOpen");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCDirectoryRead, func_AFCDirectoryRead, "AFCDirectoryRead");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCDirectoryClose, func_AFCDirectoryClose, "AFCDirectoryClose");LoadLibraryModule(itunes_env.hiTunesMobileDevice, AFCRemovePath, func_AFCRemovePath, "AFCRemovePath");kCFBooleanTrue = *(CFBooleanRef*)GetProcAddress(itunes_env.hCoreFoundation, "kCFBooleanTrue");kCFBooleanFalse = *(CFBooleanRef*)GetProcAddress(itunes_env.hCoreFoundation, "kCFBooleanFalse");kCFStreamPropertyAppendToFile = *(CFStringRef*)GetProcAddress(itunes_env.hCoreFoundation, "kCFStreamPropertyAppendToFile");kCFStreamPropertyFileCurrentOffset = *(CFStringRef*)GetProcAddress(itunes_env.hCoreFoundation, "kCFStreamPropertyFileCurrentOffset");kCFStreamPropertyDataWritten = *(CFStringRef*)GetProcAddress(itunes_env.hCoreFoundation, "kCFStreamPropertyDataWritten");kCFStreamPropertySocketNativeHandle = *(CFStringRef*)GetProcAddress(itunes_env.hCoreFoundation, "kCFStreamPropertySocketNativeHandle");kCFStreamPropertySocketRemoteHostName = *(CFStringRef*)GetProcAddress(itunes_env.hCoreFoundation, "kCFStreamPropertySocketRemoteHostName");kCFStreamPropertySocketRemotePortNumber = *(CFStringRef*)GetProcAddress(itunes_env.hCoreFoundation, "kCFStreamPropertySocketRemotePortNumber");kCFTypeArrayCallBacks = *(CFArrayCallBacks*)GetProcAddress(itunes_env.hCoreFoundation, "kCFTypeArrayCallBacks");kCFTypeDictionaryKeyCallBacks = *(CFDictionaryKeyCallBacks*)GetProcAddress(itunes_env.hCoreFoundation, "kCFTypeDictionaryKeyCallBacks");kCFTypeDictionaryValueCallBacks = *(CFDictionaryValueCallBacks*)GetProcAddress(itunes_env.hCoreFoundation, "kCFTypeDictionaryValueCallBacks");//ATHLoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionCreateWithLibrary, func_ATHostConnectionCreateWithLibrary, "ATHostConnectionCreateWithLibrary");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionRetain, func_ATHostConnectionRetain, "ATHostConnectionRetain");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionReadMessage, func_ATHostConnectionReadMessage, "ATHostConnectionReadMessage");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionSendPowerAssertion, func_ATHostConnectionSendPowerAssertion, "ATHostConnectionSendPowerAssertion");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionSendSyncRequest, func_ATHostConnectionSendSyncRequest, "ATHostConnectionSendSyncRequest");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionGetGrappaSessionId, func_ATHostConnectionGetGrappaSessionId, "ATHostConnectionGetGrappaSessionId");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionSendMetadataSyncFinished, func_ATHostConnectionSendMetadataSyncFinished, "ATHostConnectionSendMetadataSyncFinished");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionSendFileProgress, func_ATHostConnectionSendFileProgress, "ATHostConnectionSendFileProgress");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionSendAssetCompleted, func_ATHostConnectionSendAssetCompleted, "ATHostConnectionSendAssetCompleted");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionDestroy, func_ATHostConnectionDestroy, "ATHostConnectionDestroy");LoadLibraryModule(itunes_env.hAirTrafficHost, ATHostConnectionSendFileError, func_ATHostConnectionSendFileError, "ATHostConnectionSendFileError");ituens_ret = iTunes_Ok;} while (0);}return ituens_ret;
}

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

  1. 苹果助手开发随笔系列:0、前言

    作者:桑相 QQ:438788593 交流群:227246737 很久没写关于苹果手机助手开发的文章了, 也很久没有接触苹果手机助手这一块了, 很多东西都不知道最近自己想做一个小软件,需要用到一些助手 ...

  2. 苹果助手开发随笔系列:4、获取应用列表以及访问应用内共享目录

    作者:桑相 QQ:438788593 交流群:227246737 [代码都是伪代码]// 启动对应的服务 HANDEL hServiceHandle = NULL; uint32_t fd; CFSt ...

  3. 苹果助手开发随笔系列:2、设备连接以及获取设备基本信息

    作者:桑相 QQ:438788593 交流群:227246737 // 调用流程(按照顺序...)// 注册回调 AMRestorableDeviceRegisterForNotifications ...

  4. 苹果助手开发随笔系列:3、后续功能所需要的服务

    作者:桑相 QQ:438788593 交流群:227246737 // 启动服务__CFStringMakeConstantString // 构造后续函数所需要的字符串类型的参数AMDeviceSe ...

  5. 软件开发随笔系列一——分布式架构实现

    软件开发随笔系列一--分布式架构实现 文章目录 软件开发随笔系列一--分布式架构实现 理论基础 分布式架构的实现 内核框架 应用开发 基础设施 服务接入 监控 日志监控 调用链监控 度量指标监控 健康 ...

  6. 软件开发随笔系列二——关于架构和模型

    软件开发随笔系列二--关于架构和模型 文章目录 软件开发随笔系列二--关于架构和模型 软件模型 功能模型 概念层 边界 参与方 分组分类 逻辑层 功能组织图 层次.模块化 接口 流程模型 概念层 业务 ...

  7. Unity3D的坑系列:动态加载dll

    Unity3D的坑系列:动态加载dll 我现在参与的项目是做MMO手游,目标平台是Android和iOS,iOS平台不能动态加载dll(什么原因找乔布斯去),可以直接忽略,而在Android平台是可以 ...

  8. 老调重弹:JDBC系列之驱动加载原理全面解析)

    前言 最近在研究Mybatis框架,由于该框架基于JDBC,想要很好地理解和学习Mybatis,必须要对JDBC有较深入的了解.所以便把JDBC 这个东东翻出来,好好总结一番,作为自己的笔记,也是给读 ...

  9. 老调重弹:JDBC系列 之 驱动加载原理全面解析

    前言 最近在研究Mybatis框架,由于该框架基于JDBC,想要很好地理解和学习Mybatis,必须要对JDBC有较深入的了解.所以便把JDBC 这个东东翻出来,好好总结一番,作为自己的笔记,也是给读 ...

最新文章

  1. 经典算法题之Maximal Square
  2. 创建cocos2dx lua 工程
  3. C++ 百炼成钢20
  4. 磁盘与文件系统管理( 认识磁盘,了解磁盘,文件系统的建立与自动挂载)
  5. python装饰器函数传参
  6. thinkphp mysql exp_thinkphp备份数据库的方法分享
  7. 关于数据挖掘关联规则的Oracle实现
  8. wpf treeview调整子菜单间距_完全由C编写,高度可移植,超级牛逼的菜单架构!...
  9. Day 20:网络编程(1)
  10. cocos2d-x中使用Http
  11. MYSQL的递归查询
  12. win10断网重连宽带(宽带王)强烈推荐, 关键词:自动拨号、IPV6、断网自动重连、无网络自动重连
  13. cad刷新快捷键_47个CAD快捷键+50个技巧,了解这些CAD操作,你就偷着乐吧
  14. 通过Java实现一个企业人事管理系统
  15. NET 常见网络命令
  16. 厉害了,Pandas表格还能五彩斑斓的展示数据,究竟是怎么做到的呢?
  17. ICMP隧道检测分析--icmptunnel
  18. 计算机学校教师培训方案,教师基本功培训方案范文
  19. 一篇文章告诉你大数据的重要性
  20. 分水岭算法c语言,分水岭算法的概念及原理

热门文章

  1. 少儿编程冠状病毒预防主题课-消灭病毒吧!
  2. 成功解决:declared ‘static‘ but never defined
  3. 用计算机进行开立方运算的步骤,七年级《3.4用计算器进行数的开方》教案.doc...
  4. 强制 code review:reviewboard+svn 的方案
  5. Mac Ffmpeg 合成视频
  6. 楼宇智能化豪门系列- 北斗武当之 江森自控
  7. 谈谈游戏AI的一些基础知识
  8. 达龙云服务器也垃圾别买,达龙云电脑:云游戏即将开启游戏领域新篇章
  9. 一文详解电商直播四大平台的优劣势
  10. 腾讯-- TDW数据仓库数据安全