(self)
| 9102 | return |
| 9103 | |
| 9104 | def setup(self) -> None: |
| 9105 | ok("Tracking malloc() & calloc()") |
| 9106 | self.bp_malloc = TraceMallocBreakpoint("__libc_malloc") |
| 9107 | self.bp_calloc = TraceMallocBreakpoint("__libc_calloc") |
| 9108 | ok("Tracking free()") |
| 9109 | self.bp_free = TraceFreeBreakpoint() |
| 9110 | ok("Tracking realloc()") |
| 9111 | self.bp_realloc = TraceReallocBreakpoint() |
| 9112 | |
| 9113 | ok("Disabling hardware watchpoints (this may increase the latency)") |
| 9114 | gdb.execute("set can-use-hw-watchpoints 0") |
| 9115 | |
| 9116 | info("Dynamic breakpoints correctly setup, " |
| 9117 | "GEF will break execution if a possible vulnerabity is found.") |
| 9118 | warn(f"{Color.colorify('Note', 'bold underline yellow')}: " |
| 9119 | "The heap analysis slows down the execution noticeably.") |
| 9120 | |
| 9121 | # when inferior quits, we need to clean everything for a next execution |
| 9122 | gef_on_exit_hook(self.clean) |
| 9123 | return |
| 9124 | |
| 9125 | def dump_tracked_allocations(self) -> None: |
| 9126 | global gef |
no test coverage detected