import ida_bytes
def main():
start_ea = ida_kernwin.ask_addr(ida_ida.inf_get_min_ea(), "Please enter the starting address for the data to be analyzed.")
end_ea = ida_kernwin.ask_addr(ida_ida.inf_get_max_ea(), "Please enter the ending address for the data to be analyzed.")
size = end_ea-start_ea
file = ida_kernwin.ask_file(1, "*.*", "save file path")
list = ida_bytes.get_bytes(start_ea,size)
buf = bytearray(list)
with open(file, 'wb') as fw:
fw.write(buf)
print('dump over')
if __name__ == '__main__':
main()