Lines Matching +full:mach +full:- +full:o
14 # Mach header "magic" constants
22 # Mach haeder "filetype" constants
35 # Mach haeder "flag" constant bits
62 # Mach load command constants
105 # Mach CPU constants
135 # Values for nlist N_TYPE bits of the "Mach.NList.type" field.
142 # Section indexes for the "Mach.NList.sect_idx" fields
177 vm_prot_names = ["---", "r--", "-w-", "rw-", "--x", "r-x", "-wx", "rwx"]
182 if hex_bytes_len == -1:
204 padding = num_per_line - ((i / 2) % num_per_line)
371 """Returns the unpack prefix that will for non-native endian-ness."""
428 class Mach: class
429 """Class that does everything mach-o related"""
432 """Class that implements mach-o architectures"""
479 ["ppc970-64", CPU_TYPE_POWERPC64, 100],
536 self.magic = Mach.Magic()
553 print("I/O error({0}): {1}".format(errno, strerror))
590 self.content = Mach.Skinny(self.path)
592 self.content = Mach.Universal(self.path)
625 self.magic = Mach.Magic()
629 self.file_off = self.file_off - 4
634 self.archs.append(Mach.Universal.ArchInfo())
637 self.archs[i].mach = Mach.Skinny(self.path)
639 skinny_magic = Mach.Magic()
641 self.archs[i].mach.unpack(data, skinny_magic)
651 "Universal Mach File: magic = %s, nfat_arch = %u"
663 self.archs[i].mach.dump(options)
669 self.archs[i].mach.dump_header(True, options)
676 self.archs[i].mach.dump_load_commands(True, options)
683 self.archs[i].mach.dump_sections(True, options)
688 self.archs[i].mach.dump_section_contents(options)
695 self.archs[i].mach.dump_symtab(True, options)
700 self.archs[i].mach.dump_symbol_names_matching_regex(regex, file)
704 self.arch = Mach.Arch(0, 0)
708 self.mach = None
724 print("---------- ---------- ---------- ---------- ----------")
727 print("---------- ---------- ---------- ----------")
743 "%-10s %#8.8x %#8.8x %#8.8x"
755 return "Mach.Universal.ArchInfo: %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x" % (
764 return "Mach.Universal.ArchInfo: %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x" % (
830 s = s[0:-2]
858 self.arch = Mach.Arch(0, 0)
859 self.filetype = Mach.FileType(0)
862 self.flags = Mach.Flags(0)
868 self.sections.append(Mach.Section())
877 self.magic = Mach.Magic()
881 self.file_off = self.file_off - 4
907 lc = Mach.LoadCommand()
911 lc = Mach.SegmentLoadCommand(lc)
919 lc = Mach.DylibLoadCommand(lc)
930 lc = Mach.LoadDYLDLoadCommand(lc)
933 lc = Mach.DYLDInfoOnlyLoadCommand(lc)
936 lc = Mach.SymtabLoadCommand(lc)
939 lc = Mach.DYLDSymtabLoadCommand(lc)
942 lc = Mach.UUIDLoadCommand(lc)
949 lc = Mach.DataBlobLoadCommand(lc)
952 lc = Mach.UnixThreadLoadCommand(lc)
955 lc = Mach.EncryptionInfoLoadCommand(lc)
1027 "error: comparing a %s mach-o file with a %s mach-o file is not supported"
1032 print("error: mach files differ")
1041 "---------- ---------- ---------- ---------- -------- ---------- ----------"
1048 "------------ ---------- -------------- -------- ---------- ----------"
1067 "%-12s %-10s %-14s %#8u %#8.8x %s"
1099 print("Mach Header")
1151 # print "Extracting modules from mach file..."
1221 linkedit_vmaddr + lc_symtab.symoff - linkedit_fileoff
1224 linkedit_vmaddr + lc_symtab.stroff - linkedit_fileoff
1232 nlist = Mach.NList()
1304 def __init__(self, c=None, l=0, o=0): argument
1308 self.command = Mach.LoadCommand.Command(0)
1310 self.file_off = o
1321 return "%#8.8x: <%#4.4x> %-24s" % (self.file_off, self.length, lc_name)
1374 …= ------------------ ------------------ ---------- ---------- ---------- ---------- ---------- ---…
1381 …"===== ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---…
1440 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1455 self.name = data.get_fixed_length_c_string(self.length - 24)
1458 s = Mach.LoadCommand.__str__(self)
1469 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1474 self.name = data.get_fixed_length_c_string(self.length - 12)
1477 s = Mach.LoadCommand.__str__(self)
1503 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1507 reg_set = Mach.UnixThreadLoadCommand.ThreadState()
1512 s = Mach.LoadCommand.__str__(self)
1519 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1547 s = Mach.LoadCommand.__str__(self)
1569 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1613 s = Mach.LoadCommand.__str__(self)
1624 s += "ilocalsym = %-10u, nlocalsym = %u\n" % (
1629 … " iextdefsym = %-10u, nextdefsym = %u\n"
1633 … " iundefsym = %-10u, nundefsym = %u\n"
1664 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1675 s = Mach.LoadCommand.__str__(self)
1686 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1698 s = Mach.LoadCommand.__str__(self)
1704 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1713 s = Mach.LoadCommand.__str__(self)
1719 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1729 s = Mach.LoadCommand.__str__(self)
1730 s += "file-range = [%#8.8x - %#8.8x), cryptsize = %u, cryptid = %u" % (
1740 Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
1771 section = Mach.Section()
1777 s = Mach.LoadCommand.__str__(self)
1845 stab = Mach.NList.Type.Stab(self.value)
1872 self.type = Mach.NList.Type()
1897 return "%#8.8x %#2.2x (%-20s) %#2.2x %#4.4x %16.16x%s" % (
1908 """Interactive command interpreter to mach-o files."""
1910 def __init__(self, mach, options): argument
1912 self.intro = "Interactive mach-o command interpreter"
1913 self.prompt = "mach-o: %s %% " % mach.path
1914 self.mach = mach
1931 """Dump mach-o file headers"""
1932 self.mach.dump_header(True, self.options)
1936 """Dump all mach-o load commands"""
1937 self.mach.dump_load_commands(True, self.options)
1941 """Dump all mach-o sections"""
1942 self.mach.dump_sections(True, self.options)
1946 """Dump all mach-o symbols in the symbol table"""
1947 self.mach.dump_symtab(True, self.options)
1953 description="A script that parses skinny and universal mach-o files."
1956 "--arch",
1957 "-a",
1965 "-v",
1966 "--verbose",
1973 "-H",
1974 "--header",
1977 help="dump the mach-o file header",
1981 "-l",
1982 "--load-commands",
1985 help="dump the mach-o load commands",
1989 "-s",
1990 "--symtab",
1993 help="dump the mach-o symbol table",
1997 "-S",
1998 "--sections",
2001 help="dump the mach-o sections",
2005 "--section",
2014 "-o",
2015 "--out",
2018 …help="Used in conjunction with the --section=NAME option to save a single section's data to disk.",
2022 "-i",
2023 "--interactive",
2030 "-m",
2031 "--mangled",
2034 help="dump all mangled names in a mach file",
2038 "-c",
2039 "--compare",
2042 help="compare two mach files",
2046 "-M",
2047 "--extract-modules",
2054 "-C",
2055 "--count",
2059 default=-1,
2065 print("error: can't use --section option with the --extract-modules option")
2069 … "error: the --output=FILE option must be specified with the --extract-modules option"
2075 mach_a = Mach()
2076 mach_b = Mach()
2081 print("error: --compare takes two mach files as arguments")
2097 mach = Mach() variable
2098 mach.parse(path)
2100 interpreter = Mach.Interactive(mach, options)
2103 mach.dump(options)