當前位置: 首頁>>代碼示例>>Python>>正文


Python idaapi.get_user_idadir方法代碼示例

本文整理匯總了Python中idaapi.get_user_idadir方法的典型用法代碼示例。如果您正苦於以下問題:Python idaapi.get_user_idadir方法的具體用法?Python idaapi.get_user_idadir怎麽用?Python idaapi.get_user_idadir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在idaapi的用法示例。


在下文中一共展示了idaapi.get_user_idadir方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_disassembler_user_directory

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import get_user_idadir [as 別名]
def get_disassembler_user_directory(self):
        return idaapi.get_user_idadir() 
開發者ID:gaasedelen,項目名稱:lighthouse,代碼行數:4,代碼來源:ida_api.py

示例2: init

# 需要導入模塊: import idaapi [as 別名]
# 或者: from idaapi import get_user_idadir [as 別名]
def init(self):
    """Set up menu hooks and implements search methods."""

    valid_config = False
    self.menu = None
    config_file = os.path.join(idaapi.get_user_idadir(), 'virustotal.conf')
    vtsetup = VTpluginSetup(config_file)

    if vtsetup.check_version():
      ida_kernwin.info('VirusTotal\'s IDA Pro Plugin\nNew version available!')
      logging.info('[VT Plugin] There\'s a new version of this plugin!')
    else:
      logging.debug('[VT Plugin] No update available.')

    if os.path.exists(config_file):
      valid_config = vtsetup.read_config()
    else:
      answer = vtsetup.show_warning()
      if answer == 1:     # OK
        vtsetup.auto_upload = True
        valid_config = vtsetup.write_config()
      elif answer == 0:   # NO
        vtsetup.auto_upload = False
        valid_config = vtsetup.write_config()
      elif answer == -1:  # Cancel
        valid_config = False

    if valid_config:
      checksample = CheckSample(vtsetup.auto_upload, vtsetup.file_path)
      checksample.start()

      self.menu = Popups()
      self.menu.hook()
      arch_info = idaapi.get_inf_structure()

      try:
        if arch_info.procName in self.SEARCH_STRICT_SUPPORTED:
          VTGrepWildcards.register(self, 'Search for similar code')
          VTGrepWildCardsStrict.register(
              self,
              'Search for similar code (strict)'
          )
          VTGrepWildCardsFunction.register(self, 'Search for similar functions')
        elif arch_info.procName in self.SEARCH_CODE_SUPPORTED:
          VTGrepWildcards.register(self, 'Search for similar code')
          VTGrepWildCardsFunction.register(self, 'Search for similar functions')
        else:
          logging.info('\n - Processor detected: %s', arch_info.procName)
          logging.info(' - Searching for similar code is not available.')
        VTGrepBytes.register(self, 'Search for bytes')
        VTGrepStrings.register(self, 'Search for string')
      except:
        logging.error('[VT Plugin] Unable to register popups actions.')
    else:
      logging.info('[VT Plugin] Plugin disabled, restart IDA to proceed. ')
      ida_kernwin.warning('Plugin disabled, restart IDA to proceed.')
    return idaapi.PLUGIN_KEEP 
開發者ID:VirusTotal,項目名稱:vt-ida-plugin,代碼行數:59,代碼來源:plugin_loader.py


注:本文中的idaapi.get_user_idadir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。