Пример #1
0
StringRef MachOObjectFile::getFileFormatName() const {
  if (!MachOObj->is64Bit()) {
    switch (MachOObj->getHeader().CPUType) {
    case 0x00000007:
      return "MACHO32-i386";
    case 0x01000007:
      return "MACHO32-x86-64";
    case 0x0000000c:
      return "MACHO32-arm";
    case 0x00000012:
      return "MACHO32-ppc";
    case 0x01000012:
      return "MACHO32-ppc64";
    }
  }

  switch (MachOObj->getHeader().CPUType) {
  case 0x00000007:
    return "MACHO64-i386";
  case 0x01000007:
    return "MACHO64-x86-64";
  case 0x0000000c:
    return "MACHO64-arm";
  case 0x00000012:
    return "MACHO64-ppc";
  case 0x01000012:
    return "MACHO64-ppc64";
  default:
    return "MACHO64-unknown";
  }
}
Пример #2
0
uint8_t MachOObjectFile::getBytesInAddress() const {
  return MachOObj->is64Bit() ? 8 : 4;
}