Use ihex_rs_iterate_data() in ihex_rs_get_address_range().

Remove custom iteration loop with lots of duplicated code.
Use ihex_rs_iterate_data() in ihex_mem_copy().

Remove custom iteration loop with lots of duplicated code.