public static void updateAddressKey(Table table, AddressMap addrMap, Address fromAddr,
			Address endAddr, Address toAddr, TaskMonitor monitor)
			throws IOException, CancelledException {

		long length = endAddr.subtract(fromAddr);
		if (length < 0) {
			throw new IllegalArgumentException("endAddr must be greater than fromAddr");
		}
		try {
			toAddr.addNoWrap(length);
		}
		catch (AddressOverflowException e) {
			throw new IllegalArgumentException("Illegal range: end range overflow");
		}

		DBHandle tmp = new DBHandle();
		try {
			tmp.startTransaction();

			Table tmpTable = tmp.createTable("tmp", table.getSchema());

			RecordIterator it =
				new AddressKeyRecordIterator(table, addrMap, fromAddr, endAddr, fromAddr, true);
			while (it.hasNext()) {
				if (monitor.isCancelled()) {
					throw new CancelledException();
				}
				DBRecord rec = it.next();
				Address addr = addrMap.decodeAddress(rec.getKey());
				long offset = addr.subtract(fromAddr);
				addr = toAddr.add(offset);
				rec.setKey(addrMap.getKey(addr, true));
				tmpTable.putRecord(rec);
			}

			AddressRecordDeleter.deleteRecords(table, addrMap, fromAddr, endAddr);

			it = tmpTable.iterator();
			while (it.hasNext()) {
				if (monitor.isCancelled()) {
					throw new CancelledException();
				}
				DBRecord rec = it.next();
				table.putRecord(rec);
			}
		}
		finally {
			tmp.close();
		}
	}
Handles redoing a table whose key is address based when a ranges of addresses is moved.
@param table the database table.
@param addrMap the address map.
@param fromAddr the first address of the block being moved.
@param endAddr the last address of the block being moved.
@param toAddr the destination address of the block being moved.
@param monitor the task monitor
@throws IOException thrown if a database io error occurs.
@throws CancelledException thrown if the user cancels the move operation.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/util/DatabaseTableUtils.java