Что я сделал для решения проблемы, это снова отсоединить и снова подключить USB-кабель к USB-порту (выполняется с другим портом на моей машине).
Затем я решил зарядить, и это Это.
При работе с устройствами adb я увидел устройство в списке.
(Выполнено в Windows 10 home).
Похоже, вы действительно просто хотите получить указатель на соответствующий mach_header_64
(или mach_header
в 32-битных системах).
Если у вас есть указатель, вы можете использовать функцию dladdr
, чтобы узнать, с какой (если есть) машины, с которой он был загружен. Эта функция заполняет структуру Dl_info
, которая включает, помимо прочего, указатель на mach_header_64
для mach-o.
// For TARGET_RT_64_BIT:
#import <TargetConditionals.h>
// For dladdr:
#import <dlfcn.h>
// For mach_header and mach_header_64:
#import <mach-o/loader.h>
#ifdef TARGET_RT_64_BIT
struct mach_header_64 *mach_header_for_address(const void *address) {
Dl_info info;
if (dladdr(address, &info) == 0) {
// address doesn't point into a mach-o.
return 0;
}
struct mach_header_64 *header = (struct mach_header_64 *)info.dli_fbase;
if (header->magic != MH_MAGIC_64) {
// Something went wrong...
return 0;
}
return header;
}
#else
struct mach_header mach_header_for_address(const void *address) {
Dl_info info;
if (dladdr(address, &info) == 0) {
// address doesn't point into a mach-o.
return 0;
}
struct mach_header *header = (struct mach_header *)info.dli_fbase;
if (header->magic != MH_MAGIC) {
// Something went wrong...
return 0;
}
return header;
}
#endif