public static MemoryBlock createInitializedBlock(Program program, boolean isOverlay,
			String name, Address start, FileBytes fileBytes, long offset, long length,
			String comment, String source, boolean r, boolean w, boolean x, MessageLog log)
			throws AddressOverflowException {

		if (!program.hasExclusiveAccess()) {
			log.appendMsg("Failed to create memory block: exclusive access/checkout required");
			return null;
		}
		MemoryBlock block;
		try {
			try {
				block = program.getMemory().createInitializedBlock(name, start, fileBytes, offset,
					length, isOverlay);
			}
			catch (MemoryConflictException e) {
				block = program.getMemory()
						.createInitializedBlock(name, start, fileBytes, offset, length, true);
				log.appendMsg("Conflict attempting to create memory block: " + name +
					" at address " + start.toString() + " Created block in new overlay instead");
			}
		}
		catch (LockException | MemoryConflictException e) {
			throw new RuntimeException(e);
		}

		setBlockAttributes(block, comment, source, r, w, x);
		adjustFragment(program, block.getStart(), name);
		return block;
	}
Creates a new initialized block in memory using the bytes from a {@link FileBytes} object.
If there is a conflict when creating this block (some other block occupies at least some
of the addresses that would be occupied by the new block), then an attempt will be made
to create the new block in an overlay.

@param program the program in which to create the block.
@param isOverlay if true, the block will be created in a new overlay space for that block
@param name the name of the new block.
@param start the starting address of the new block.
@param fileBytes the {@link FileBytes} object that supplies the bytes for this block.
@param offset the offset into the {@link FileBytes} object where the bytes for this block reside.
@param length the length of the new block
@param comment the comment text to associate with the new block.
@param source the source of the block (This field is not well defined - currently another comment)
@param r the read permission for the new block.
@param w the write permission for the new block.
@param x the execute permission for the new block.
@param log a {@link MessageLog} for appending error messages
@return the newly created block or null if the operation failed
@throws AddressOverflowException if the address
Ghidra/Features/Base/src/main/java/ghidra/app/util/MemoryBlockUtils.java