(self)
| 51 | |
| 52 | |
| 53 | def parseHeader(self): |
| 54 | self.magic = self.getMagic(self.binary_file) |
| 55 | |
| 56 | if self.magic in MAGIC_64: |
| 57 | self.ql.log.debug("Got a 64bit Header ") |
| 58 | self.header = BinaryHeader(self.binary_file) |
| 59 | |
| 60 | #elif self.magic in MAGIC_X86: |
| 61 | # # x86 |
| 62 | # ql.log.debug("Got a x86 Header") |
| 63 | # self.header = BinaryHeader(self.binary_file) |
| 64 | |
| 65 | elif self.magic in MAGIC_FAT: |
| 66 | # fat |
| 67 | self.ql.log.debug("Got a fat header") |
| 68 | fat = FatHeader(self.binary_file) |
| 69 | file_info = fat.getBinary(self.archtype) |
| 70 | self.binary_file = self.binary_file[file_info.offset : file_info.offset + file_info.size] |
| 71 | self.header = BinaryHeader(self.binary_file) |
| 72 | else: |
| 73 | self.ql.log.info("unknow header!") |
| 74 | return False |
| 75 | |
| 76 | if not self.header: |
| 77 | self.ql.log.info("parse header error") |
| 78 | return False |
| 79 | |
| 80 | return True |
| 81 | |
| 82 | def parseLoadCommand(self): |
| 83 | self.ql.log.debug("Parse LoadCommand") |
no test coverage detected