def load_file(self, header_indexies, footer_indexies): try: self.remove_old_signature_cell_color() self.update_rows(self.resource.binary) self.change_signature_cell_color(header_indexies, footer_indexies) if fy.check_hidden_data(self.resource.binary, header_indexies, footer_indexies): ui_parts.message_box('This file include hidden file.', 'Hidden File Alert', wx.OK | wx.ICON_ERROR) except Exception, e: print e ui_parts.message_box('Can not open file {0}.'.format(self.resource.file_path), 'Load File Error', wx.OK | wx.ICON_ERROR)
def on_idle(self, event): if not self.strings_queue.empty(): self.strings_textctrl.WriteText(self.strings_queue.get() + '\n') if not self.pdfid_queue.empty(): pdfid_tuple = self.pdfid_queue.get() index = pdfid_tuple[0] pdfid = pdfid_tuple[1] self.pdfid_textctrl.AppendText(pdfid) if pdfid.startswith('/JS') or pdfid.startswith('/JavaScript') or pdfid.startswith('/ObjStm'): self.pdfid_textctrl.SetStyle(21*(index), 21*(index+1), wx.TextAttr("RED", "White")) if not self.pdf_parse_queue.empty(): result = self.pdf_parse_queue.get() if 'JavaScript' in result: ui_parts.message_box('This PDF include JavaScript code.', 'Hidden File Alert', wx.OK | wx.ICON_ERROR) self.pdf_parse_textctrl.WriteText(result + '\n')
def check_hidden_data(self, binary_string, header_indexies, footer_indexies): if fy.check_hidden_data(binary_string, header_indexies, footer_indexies): ui_parts.message_box('This file include hidden file.', 'Hidden File Alert', wx.OK | wx.ICON_ERROR)