当前位置: 首页>>代码示例>>Python>>正文


Python idaapi.warning方法代码示例

本文整理汇总了Python中idaapi.warning方法的典型用法代码示例。如果您正苦于以下问题:Python idaapi.warning方法的具体用法?Python idaapi.warning怎么用?Python idaapi.warning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在idaapi的用法示例。


在下文中一共展示了idaapi.warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ghida_finalize

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def ghida_finalize(use_ghidra_server, ghidra_server_url):
    """
    Remove temporary files and
    checkout from Ghidraaas server.
    """
    try:
        remove_temporary_files()

        if use_ghidra_server:
            ghidraaas_checkout(ghidra_server_url)

    except Exception:
        print("GhIDA:: [!] Finalization error")
        idaapi.warning("GhIDA finalization error")


# ------------------------------------------------------------
#   GHIDRA LOCAL
# ------------------------------------------------------------ 
开发者ID:Cisco-Talos,项目名称:GhIDA,代码行数:21,代码来源:lib.py

示例2: prepare_debug_ui

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def prepare_debug_ui(self):
		if idaapi.is_debugger_on():
			idaapi.warning("[%s] the debugger is currently running" % PLUGNAME)
			return

		wd = WaitDialog()
		idaapi.msg("[%s] waiting...\n" % (PLUGNAME))
		wd.thread.start()
		wd.exec_()

		target_pid = wd.get_target_pid()
		if target_pid != -1:
			ida_dbg.attach_process(target_pid,-1)
			ida_dbg.wait_for_next_event(ida_dbg.WFNE_SUSP, -1)
			ida_dbg.continue_process()
		else:
			idaapi.msg("[%s] exit waiting\n" % (PLUGNAME)) 
开发者ID:anic,项目名称:ida2pwntools,代码行数:19,代码来源:ida2pwntools.py

示例3: btn_villoc_on_click

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def btn_villoc_on_click(self):
        if self.tbl_traced_chunks.rowCount() == 0:
            idaapi.warning("Empty table")
            return

        try:
            villoc.Block.header = config.ptr_size*2
            villoc.Block.round  = self.parent.heap.malloc_alignment
            villoc.Block.minsz  = self.parent.heap.min_chunk_size

            result = self.dump_table_for_villoc()
            html = villoc.build_html(result)

            h, filename = tempfile.mkstemp(suffix='.html')

            with open(filename, 'wb') as f:
                f.write(html.encode("utf-8"))

            url = QtCore.QUrl.fromLocalFile(filename)
            QtGui.QDesktopServices.openUrl(url)

        except Exception as e:
            idaapi.warning(traceback.format_exc()) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:25,代码来源:tracer.py

示例4: next_on_click

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def next_on_click(self):
        chunk_addr = self.get_chunk_address()
        if chunk_addr is None:
            idaapi.warning("Invalid address / expression")
            return
        try:
            chunk = self.heap.get_chunk(chunk_addr)
            chunk_size = chunk.norm_size
            next_addr = chunk_addr+chunk_size
            if idaapi.is_loaded(next_addr):
                self.show_chunk("%#x" % next_addr)
            else:
                idaapi.warning("%#x: next chunk (%#x) is not loaded" % \
                    (chunk_addr, next_addr))

        except Exception as e:
            idaapi.warning("ERROR: " + str(e)) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:19,代码来源:chunk.py

示例5: update_config

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def update_config(self):
        try:
            config.start_tracing_at_startup = self.opt1.isChecked()
            config.stop_during_tracing = self.opt2.isChecked()
            config.detect_double_frees_and_overlaps = self.opt3.isChecked()
            config.filter_library_calls = self.opt4.isChecked()
            config.hexdump_limit = int(self.t_hexdump_limit.text())
            config.libc_offsets = self.get_offsets()

            config.save()
            idaapi.info("Config updated")

            self.parent.init_heap()
            self.parent.reload_gui_info()

        except Exception as e:
            idaapi.warning("ERROR: " + str(e)) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:19,代码来源:config.py

示例6: modify_value

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def modify_value(self):
        reg = self.get_selected_reg()
        if not reg:
            return

        reg_val = idc.get_reg_value(reg)
        b = idaapi.ask_str("0x%X" % reg_val, 0, "Modify register value")
        if b is not None:
            try:
                value = int(idaapi.str2ea(b))
                idc.set_reg_value(value, reg)
                self.reload_info()

                if reg == dbg.registers.flags:
                    self.reload_flags_view()
            except:
                idaapi.warning("Invalid expression") 
开发者ID:danigargu,项目名称:deREferencing,代码行数:19,代码来源:registers.py

示例7: switch_value

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def switch_value(self):
        lineno = self.GetLineNo()
        if lineno > len(dbg.registers.flags):
            return

        line = self.GetLine(lineno)
        line = idaapi.tag_remove(line[0])
        flag = line[:4].strip()
        new_val = not self.flag_vals[flag]

        rc = idc.set_reg_value(int(new_val), flag)
        if not rc:
            idaapi.warning("Unable to update the register value")
            return

        self.parent.reload_view() 
开发者ID:danigargu,项目名称:deREferencing,代码行数:18,代码来源:registers.py

示例8: reload_gui_info

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def reload_gui_info(self, from_arena_cb=False):
        if self.heap is None:
            return

        try:
            if not misc.is_process_suspended():
                answer = idaapi.ask_yn(
                    idaapi.ASKBTN_YES, 
                    "HIDECANCEL\nThe process must be suspended to reload the info.\n\
                    Do you want to suspend it?")

                if answer == idaapi.ASKBTN_NO:
                    return

                if not idaapi.suspend_process():
                    warning("Unable to suspend the process")
                    return
        
            idaapi.refresh_debugger_memory()
            if not self.heap.get_heap_base():
                self.show_warning("Heap not initialized")
                return

            if not config.libc_base:
                self.show_warning("Unable to resolve glibc base address.")
                return

            self.hide_warning()
            self.arenas_widget.setVisible(True)

            if not from_arena_cb:
                self.populate_arenas()

            self.arena_widget.populate_table()
            self.tcache_widget.populate_table()
            self.bins_widget.populate_tables()

        except Exception as e:
            self.show_warning(str(e))
            idaapi.warning(traceback.format_exc()) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:42,代码来源:plugin_gui.py

示例9: init_heap

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def init_heap(self):
        try:
            self.config_widget.load_config()
            self.heap = Heap()
            self.btn_reload.setEnabled(True)
            self.tabs.setTabEnabled(3, self.heap.tcache_enabled)

        except Exception as e:
            self.show_warning("Please, fix the config file")
            idaapi.warning(traceback.format_exc()) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:12,代码来源:plugin_gui.py

示例10: btn_dump_trace_on_click

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def btn_dump_trace_on_click(self):
        if self.tbl_traced_chunks.rowCount() == 0:
            idaapi.warning("Empty table")
            return

        filename = AskFile(1, "*.csv", "Select the file to store tracing results")
        if not filename:
            return            
        try:
            result = self.tbl_traced_chunks.dump_table_as_csv()
            with open(filename, 'wb') as f:
                f.write(result)

        except Exception as e:
            idaapi.warning(traceback.format_exc()) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:17,代码来源:tracer.py

示例11: jump_on_click

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def jump_on_click(self):
        chunk_addr = self.get_chunk_address()
        if chunk_addr is None:
            idaapi.warning("Invalid address / expression")
            return
        idc.jumpto(chunk_addr) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:8,代码来源:chunk.py

示例12: prev_on_click

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def prev_on_click(self):
        chunk_addr = self.get_chunk_address()
        if chunk_addr is None:
            idaapi.warning("Invalid address / expression")
            return
        try:
            chunk = self.heap.get_chunk(chunk_addr)
            if chunk.prev_inuse == 0:
                prev_addr = chunk_addr-chunk.prev_size
                self.show_chunk("%#x" % prev_addr)
            else:
                idaapi.warning("%#x: prev_chunk in use" % chunk_addr)
        except Exception as e:
            idaapi.warning("ERROR: " + str(e)) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:16,代码来源:chunk.py

示例13: edit_chunk_on_click

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def edit_chunk_on_click(self):
        chunk_addr = self.get_chunk_address()
        if chunk_addr is None:
            idaapi.warning("Invalid address / expression")
            return

        w = ChunkEditor(chunk_addr, self)
        if w.exec_() == 1:
            self.view_chunk_info()

# ----------------------------------------------------------------------- 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:13,代码来源:chunk.py

示例14: show_struct_on_click

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def show_struct_on_click(self):
        try:
            address = int(self.t_struct_addr.text(), 16)
            self.show_struct(address, "_IO_FILE")
        except:
            idaapi.warning("ERROR: Invalid address") 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:8,代码来源:magic.py

示例15: run

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import warning [as 别名]
def run(self, arg=0):
        try:
            if "ELF" not in idaapi.get_file_type_name():
                raise Exception("Executable must be ELF fomat")

            if not idaapi.is_debugger_on() or not is_process_suspended():
                raise Exception("The debugger must be active and suspended before using this plugin")

            f = plugin_gui.HeapPluginForm()
            f.Show()

        except Exception as e:
            idaapi.warning("[%s] %s" % (PLUGNAME, str(e))) 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:15,代码来源:heap_viewer.py


注:本文中的idaapi.warning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。