-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
idb2pat: incorporate fixes from @HongThatCong #98
base: master
Are you sure you want to change the base?
Conversation
if ea > func.start_ea: # skip first byte | ||
name = idc.get_name(ea) | ||
if name != "" and idaapi.is_uname(name): | ||
logger.debug(str("ea 0x%X has a name %s" % (ea, name))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first parameter to a log method is a format string, so we can do this instead:
logger.debug("ea 0x%X has a name %s", ea, name)
f.write("---") | ||
if os.path.exists(filename): | ||
with open(filename, "rb") as f: | ||
old_sigs = f.readlines() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably need to decode the bytes into a string, like:
old_sigs = f.read().decode("utf-8").split("\n")
f.write("\r\n") | ||
f.write("---") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be writing bytes, not str, since the file is open in binary mode.
sigs.append(sig) | ||
|
||
for sig in sigs: | ||
f.write(sig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sig.encode("utf-8")
need to test this on py3, since i think there's some issues around str/bytes handling. |
Hi ! |
this is the updated script that @HongThatCong referenced in #97