-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
import ida_gdl | ||
import ida_funcs | ||
import ida_lines | ||
import ida_bytes | ||
import idautils | ||
|
||
from . import annotation | ||
|
||
|
||
class CommentAnnotation(annotation.Annotation): | ||
@staticmethod | ||
def data(offset): | ||
func = ida_funcs.get_func(offset) | ||
def data(self): | ||
func = ida_funcs.get_func(self.offset) | ||
|
||
comments = {ea - offset: self.get_comment(ea) | ||
comments = {ea - self.offset: self.get_comment(ea) | ||
for ea in idautils.Heads(func.startEA, func.endEA)} | ||
return comments | ||
|
||
@staticmethod | ||
def get_comment(self, ea): | ||
raise NotImplementedError("get_comment method not implemented") | ||
|
||
|
||
def RegularCommentAnnotation(CommentAnnotation): | ||
class RegularCommentAnnotation(CommentAnnotation): | ||
@staticmethod | ||
def get_comment(ea): | ||
return ida_bytes.get_cmt(ea, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters