Method: Rex::MachParsey::Fat#_parse_fat_header

Defined in:
lib/rex/machparsey/mach.rb

#_parse_fat_header(isource, offset) ⇒ Object

this is useful for debugging but we don’t use it for anything.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/rex/machparsey/mach.rb', line 132

def _parse_fat_header(isource, offset)
  archs = []
  nfat_arch = self.fat_header.nfat_arch

  print "Number of archs in binary: " + nfat_arch.to_s + "\n"

  nfat_arch.times do
    arch = FatArch.new(isource.read(offset, FAT_ARCH_SIZE), self.endian)

    case arch.cpu_type

    when CPU_TYPE_I386
      print "i386\n"

    when CPU_TYPE_X86_64
      print "x86_64\n"

    when CPU_TYPE_ARM
      print "Arm\n"

    when CPU_TYPE_POWERPC
      print "Power PC\n"

    when CPU_TYPE_POWERPC64
      print "Power PC 64\n"
    end

    offset += FAT_ARCH_SIZE
  end
end