code: def showOptionalHeaderData(peInstance):
      
      
      print "[+] IMAGE_OPTIONAL_HEADER:\n"
      ohFields = peInstance.ntHeaders.optionalHeader.getFields()
      for field in ohFields:
          if not isinstance(ohFields[field],  datadirs.DataDirectory):
              print "--> %s = 0x%08x" % (field,  ohFields[field].value)
docs: Prints IMAGE_OPTIONAL_HEADER fields.