Skip to content

Conversation

@PimmyTrousers
Copy link

Wasn't working in 7.0 so added some changes to how the bytes are printed

Copy link
Owner

@williballenthin williballenthin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the contribution!

md5 = idautils.GetInputFileMD5().decode("utf-8", errors="ignore").rstrip('\x00')
ret = []
ret.append(f'rule a_{md5}_{safe_name}')
ret.append('rule a_{}_{}'.format(md5, safe_name))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these look good

else:
bytes.append(byte)
masked_bytes.append('%02X' % (byte))
masked_bytes.append('%02x' % int(byte.encode('hex'), 16))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks a bit roundabout. could the same be accomplished like: (ord(byte)) ?

i'm also hesitant about py2/py3 here. the proposed solution looks like its a py2 construct. would you add a version switch here to handle both py2 and py3?

@PimmyTrousers
Copy link
Author

This also seems to cause IDA Pro to become unresponsive when trying to close it. I wonder if IDA Python is holding a handle or the script isn't being exited properly? Ill see if I can fix up those 2 lines

@williballenthin williballenthin force-pushed the master branch 20 times, most recently from fe7896a to 3c9f7e2 Compare June 6, 2025 11:17
@williballenthin williballenthin force-pushed the master branch 7 times, most recently from 43c6eef to 3a80405 Compare June 17, 2025 08:56
@williballenthin williballenthin force-pushed the master branch 14 times, most recently from 5d8e88a to f6e7d12 Compare June 17, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants