Last active
August 23, 2024 08:41
-
-
Save herrcore/01762779ae4ac130d3beb02bf8e99826 to your computer and use it in GitHub Desktop.
IDA Plugin for quickly copying disassembly as encoded hex bytes (updated for IDA 7xx) - moved https://github.com/OALabs/hexcopy-ida
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
Moved: https://github.com/OALabs/hexcopy-ida |
Hi,@herrcore,I found this script is not work at ida7.5 python3.7.7+ ,due to function
def copy_bytes():
"""
Copy selected bytes to clipboard
"""
if using_ida7api:
start = idc.read_selection_start()
end = idc.read_selection_end()
if idaapi.BADADDR in (start, end):
ea = idc.here()
start = idaapi.get_item_head(ea)
end = idaapi.get_item_end(ea)
data = idc.get_bytes(start, end - start).encode('hex')
print "Bytes copied: %s" % data
copy_to_clip(data)
else:
start = idc.SelStart()
end = idc.SelEnd()
if idaapi.BADADDR in (start, end):
ea = idc.here()
start = idaapi.get_item_head(ea)
end = idaapi.get_item_end(ea)
data = idc.GetManyBytes(start, end-start).encode('hex')
print "Bytes copied: %s" % data
copy_to_clip(data)
return
at 3.7.+,this should be
def copy_bytes():
"""
Copy selected bytes to clipboard
"""
if using_ida7api:
start = idc.read_selection_start()
end = idc.read_selection_end()
if idaapi.BADADDR in (start, end):
ea = idc.here()
start = idaapi.get_item_head(ea)
end = idaapi.get_item_end(ea)
# fix encode bug reference
# https://stackoverflow.com/questions/6624453/whats-the-correct-way-to-convert-bytes-to-a-hex-string-in-python-3
data = idc.get_bytes(start, end - start).hex()
print ("Bytes copied: %s" % data)
copy_to_clip(data)
else:
start = idc.SelStart()
end = idc.SelEnd()
if idaapi.BADADDR in (start, end):
ea = idc.here()
start = idaapi.get_item_head(ea)
end = idaapi.get_item_end(ea)
data = idc.GetManyBytes(start, end-start).hex()
print( "Bytes copied: %s" % data)
copy_to_clip(data)
return
This gist has been moved to a complete repo https://github.com/OALabs/hexcopy-ida
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any way to make hotkey work?