thetlk / Mach-O

GNU General Public License v3.0
22 stars 20 forks source link

MachOHeader.py", line 47, in parse assert self.magic in [MH_MAGIC, MH_CIGAM, MH_MAGIC_64, MH_CIGAM_64] #3

Open jaegeral opened 9 years ago

jaegeral commented 9 years ago
python readmacho.py ../viper_2/viper/flashback.bin 
Traceback (most recent call last):
  File "readmacho.py", line 59, in <module>
    main()
  File "readmacho.py", line 34, in main
    m = MachO(args.filename)
  File "/Volumes/data/Users/user/scripts/Mach-O/pymacho/MachO.py", line 54, in __init__
    self.load_file(macho_file)
  File "/Volumes/data/Users/user/scripts/Mach-O/pymacho/MachO.py", line 57, in load_file
    self.header = MachOHeader(macho_file)
  File "/Volumes/data/Users/user/scripts/Mach-O/pymacho/MachOHeader.py", line 39, in __init__
    self.parse(macho_file)
  File "/Volumes/data/Users/user/scripts/Mach-O/pymacho/MachOHeader.py", line 47, in parse
    assert self.magic in [MH_MAGIC, MH_CIGAM, MH_MAGIC_64, MH_CIGAM_64]

There is no exception handling in that area, and it looks the headers are not read right.

File being tested: 5616687fac5d040ae65cb1b08717a6aa

https://github.com/botherder/viper/pull/244