ghidra.program.model.address.AddressSetView Java Examples

The following examples show how to use ghidra.program.model.address.AddressSetView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AsciiExporter.java    From ghidra with Apache License 2.0 6 votes vote down vote up
@Override
public boolean export(File file, DomainObject domainObj, AddressSetView addressSet,
		TaskMonitor monitor) throws IOException {

	log.clear();

	if (!(domainObj instanceof Program)) {
		log.appendMsg("Unsupported type: " + domainObj.getClass().getName());
		return false;
	}
	Program program = (Program) domainObj;

	getOptions(() -> program);
	new ProgramTextWriter(file, program, addressSet, monitor, options, provider);
	return true;
}
 
Example #2
Source File: AutoAnalysisPlugin.java    From ghidra with Apache License 2.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionContext context) {
	ListingActionContext programContext = getListingContext(context);
	AddressSetView set;
	if (programContext.hasSelection()) {
		set = programContext.getSelection();
	}
	else {
		set = programContext.getProgram().getMemory();
	}

	AutoAnalysisManager analysisMgr =
		AutoAnalysisManager.getAnalysisManager(programContext.getProgram());

	Program program = programContext.getProgram();
	Options options = program.getOptions(Program.ANALYSIS_PROPERTIES);
	options = options.getOptions(analyzer.getName());
	analyzer.optionsChanged(options, program);

	analysisMgr.schedule(
		new OneShotAnalysisCommand(analyzer, set, analysisMgr.getMessageLog()),
		analyzer.getPriority().priority());

	tool.setStatusInfo("Analysis scheduled: " + analyzer.getName());
}
 
Example #3
Source File: BasicBlockCounterFunctionAlgorithm.java    From ghidra with Apache License 2.0 6 votes vote down vote up
@Override
public int score(Function function, TaskMonitor monitor) throws CancelledException {
	Program program = function.getProgram();
	CodeBlockModel blockModel = new BasicBlockModel(program);

	AddressSetView body = function.getBody();
	long maxIterations = body.getNumAddresses();
	monitor.initialize(maxIterations);

	CodeBlockIterator iterator = blockModel.getCodeBlocksContaining(body, monitor);

	int blockCount = 0;
	while (iterator.hasNext()) {
		monitor.checkCanceled();
		iterator.next();
		blockCount++;
		monitor.incrementProgress(1);

		artificialSleepForDemoPurposes();
	}
	return blockCount;
}
 
Example #4
Source File: FieldSearcher.java    From ghidra with Apache License 2.0 6 votes vote down vote up
protected FieldSearcher(Pattern pattern, boolean forward, ProgramLocation startLoc,
		AddressSetView set) {
	this.pattern = pattern;
	this.forward = forward;
	this.startLocation = startLoc;

	if (forward && set != null && !set.isEmpty() && startLoc != null &&
		!set.getMinAddress().equals(startLoc.getAddress())) {
		throw new IllegalArgumentException("Start location and addressSet are inconsistent!");
	}
	if (!forward && set != null && !set.isEmpty() && startLoc != null &&
		!set.getMaxAddress().equals(startLoc.getAddress())) {
		throw new IllegalArgumentException("Start location and addressSet are inconsistent!");
	}

}
 
Example #5
Source File: GhidraScript.java    From ghidra with Apache License 2.0 6 votes vote down vote up
/**
 * Sets the background of the Listing at the given addresses to the given color.  See the
 * Listing help page in Ghidra help for more information.
 * <p>
 * This method is unavailable in headless mode.
 * <p>
 * Note: you can use the {@link ColorizingService} directly to access more color changing
 * functionality.  See the source code of this method to learn how to access services from
 * a script.
 *
 * @param addresses The addresses at which to set the color
 * @param color The color to set
 * @see #setBackgroundColor(Address, Color)
 * @see #clearBackgroundColor(AddressSetView)
 * @see ColorizingService
 * @throws ImproperUseException if this method is run in headless mode
 */
public void setBackgroundColor(AddressSetView addresses, Color color)
		throws ImproperUseException {

	if (isRunningHeadless()) {
		throw new ImproperUseException(
			"The setBackgroundColor() method can only be used when running headed Ghidra.");
	}

	PluginTool tool = state.getTool();
	ColorizingService service = tool.getService(ColorizingService.class);
	if (service == null) {
		printerr("Cannot set background colors without the " +
			ColorizingService.class.getSimpleName() + " installed");
		return;
	}

	service.setBackgroundColor(addresses, color);
}
 
Example #6
Source File: FollowFlowForwardTest.java    From ghidra with Apache License 2.0 6 votes vote down vote up
@Test
public void testFollowAllFlowsFrom0x5024() {

	AddressSetView flowAddresses = getFlowsFrom(0x5024, followAllFlows());

	AddressSet expectedAddresses = new AddressSet();
	expectedAddresses.add(addr(0x90), addr(0xb4));
	expectedAddresses.add(addr(0xb6), addr(0xbf));
	expectedAddresses.add(addr(0x330), addr(0x331));
	expectedAddresses.add(addr(0x360), addr(0x361));
	expectedAddresses.add(addr(0x390), addr(0x391));
	expectedAddresses.add(addr(0x5024), addr(0x5027));
	expectedAddresses.add(addr(0x5040), addr(0x5043));

	assertEquals(new MySelection(expectedAddresses), new MySelection(flowAddresses));
}
 
Example #7
Source File: NextPreviousNonFunctionAction.java    From ghidra with Apache License 2.0 6 votes vote down vote up
private Address findNextInstructionAddressNotInFunction(TaskMonitor monitor, Program program,
		Address address, boolean isForward) throws CancelledException {
	Function function = program.getListing().getFunctionContaining(address);
	AddressSetView body = function.getBody();
	InstructionIterator it = program.getListing().getInstructions(address, isForward);
	while (it.hasNext()) {
		monitor.checkCanceled();
		Instruction instruction = it.next();
		Address instructionAddress = instruction.getMinAddress();
		if (!body.contains(instructionAddress)) {
			function = program.getListing().getFunctionContaining(instructionAddress);
			if (function == null) {
				return instructionAddress;
			}
			body = function.getBody();
		}
	}
	return null;
}
 
Example #8
Source File: FollowFlowBackwardTest.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Test
public void testConditionalCallsBackFrom0x161() {

	AddressSetView flowAddresses = getFlowsTo(0x161, followOnlyConditionalCalls());

	AddressSet expectedAddresses = new AddressSet();
	expectedAddresses.add(addr(0x3e), addr(0x50));
	expectedAddresses.add(addr(0x160), addr(0x161));

	assertEquals(new MySelection(expectedAddresses), new MySelection(flowAddresses));
}
 
Example #9
Source File: CommentsDBAdapterV0.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * @see ghidra.program.database.code.CommentsDBAdapter#getKeys(ghidra.program.model.address.AddressSetView, boolean)
 */
@Override
public AddressKeyIterator getKeys(AddressSetView set, boolean forward) throws IOException {
	if (forward) {
		return new AddressKeyIterator(commentTable, addrMap, set, set.getMinAddress(), true);
	}
	return new AddressKeyIterator(commentTable, addrMap, set, set.getMaxAddress(), false);
}
 
Example #10
Source File: VTAbstractProgramCorrelatorFactory.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public final VTProgramCorrelator createCorrelator(ServiceProvider serviceProvider,
		Program sourceProgram, AddressSetView sourceAddressSet, Program destinationProgram,
		AddressSetView destinationAddressSet, VTOptions options) {

	return doCreateCorrelator(serviceProvider, sourceProgram, sourceAddressSet,
		destinationProgram, destinationAddressSet, options == null ? createDefaultOptions()
				: (VTOptions) options.copy());
}
 
Example #11
Source File: MarkUnimplementedPcode.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public void run() throws Exception {
	if (currentProgram == null) {
		return;
	}
	AddressSetView set = currentSelection;
	if (set == null || set.isEmpty()) {
		set = currentProgram.getMemory().getExecuteSet();
	}

	Disassembler.clearUnimplementedPcodeWarnings(currentProgram, set, monitor);

	int completed = 0;
	monitor.initialize(set.getNumAddresses());

	InstructionIterator instructions = currentProgram.getListing().getInstructions(set, true);
	while (instructions.hasNext()) {
		monitor.checkCanceled();
		Instruction instr = instructions.next();

		PcodeOp[] pcode = instr.getPcode();
		if (pcode != null && pcode.length == 1 &&
			pcode[0].getOpcode() == PcodeOp.UNIMPLEMENTED) {
			markUnimplementedPcode(instr);
		}

		completed += instr.getLength();
		if ((completed % 1000) == 0) {
			monitor.setProgress(completed);
		}
	}

}
 
Example #12
Source File: InstructionMnemonicOperandFieldSearcher.java    From ghidra with Apache License 2.0 5 votes vote down vote up
public static InstructionMnemonicOperandFieldSearcher createInstructionOperandOnlyFieldSearcher(
		Program program, ProgramLocation startLoc, AddressSetView set, boolean forward,
		Pattern pattern, CodeUnitFormat format) {
	return new InstructionMnemonicOperandFieldSearcher(program, startLoc, set, forward,
		pattern, format, false, true);

}
 
Example #13
Source File: ApplyDataArchiveAnalyzer.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) {
	AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);
	DataTypeManagerService service = mgr.getDataTypeManagerService();

	// pick the archives to apply
	List<String> archiveList = DataTypeArchiveUtility.getArchiveList(program);
	List<DataTypeManager> managerList = new ArrayList<>();
	monitor.initialize(archiveList.size());

	// apply the archive restricted to the address set
	for (String archiveName : archiveList) {
		if (monitor.isCancelled()) {
			break;
		}
		DataTypeManager dtm = null;
		try {
			dtm = service.openDataTypeArchive(archiveName);
			if (dtm == null) {
				Msg.showError(this, null, "Failed to Apply Data Types",
					"Failed to locate data type archive: " + archiveName);
			}
			else {
				managerList.add(dtm);
			}
		}
		catch (Exception e) {
			if (mgr.debugOn) {
				Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
			}
		}
	}
	monitor.setMessage("Applying Function Signatures...");
	// TODO: SourceType of imported is not exactly right here.
	//       This isn't imported.  Need to add some other sourceType, like SecondaryInfo
	ApplyFunctionDataTypesCmd cmd = new ApplyFunctionDataTypesCmd(managerList, set,
		SourceType.IMPORTED, false, createBookmarksEnabled);
	cmd.applyTo(program, monitor);
	return true;
}
 
Example #14
Source File: AddressInfo.java    From ghidra with Apache License 2.0 5 votes vote down vote up
AddressInfo(FGVertex vertex) {
	if (vertex == null) {
		throw new NullPointerException("Vertex cannot be null");
	}

	AddressSetView addresses = vertex.getAddresses();
	this.addressRangeStart = addresses.getMinAddress().toString();
	this.addressRangeEnd = addresses.getMaxAddress().toString();
}
 
Example #15
Source File: Apple8900Analyzer.java    From ghidra with Apache License 2.0 5 votes vote down vote up
public boolean analyze(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log)
		throws Exception {
	monitor.setMessage("Processing Apple 8900 header...");

	ByteProvider provider =
		new MemoryByteProvider(program.getMemory(),
			program.getAddressFactory().getDefaultAddressSpace());
	BinaryReader reader = new BinaryReader(provider, true);

	Apple8900Header header = new Apple8900Header(reader);

	if (!header.getMagic().equals(Apple8900Constants.MAGIC)) {
		log.appendMsg("Invalid 8900 file!");
		return false;
	}

	DataType headerDataType = header.toDataType();
	Data headerData = createData(program, toAddr(program, 0), headerDataType);
	createFragment(program, headerDataType.getName(), headerData.getMinAddress(),
		headerData.getMaxAddress().add(1));

	Address dataStart = toAddr(program, 0x800);
	Address dataEnd = toAddr(program, 0x800 + header.getSizeOfData());
	createFragment(program, "Data", dataStart, dataEnd);

	Address footerSigStart = toAddr(program, 0x800 + header.getFooterSignatureOffset());
	Address footerSigEnd = toAddr(program, 0x800 + header.getFooterCertificateOffset());
	createFragment(program, "FooterSig", footerSigStart, footerSigEnd);

	Address footerCertStart = toAddr(program, 0x800 + header.getFooterCertificateOffset());
	Address footerCertEnd =
		toAddr(program,
			0x800 + header.getFooterCertificateOffset() + header.getFooterCertificateLength());
	createFragment(program, "FooterCert", footerCertStart, footerCertEnd);

	removeEmptyFragments(program);

	return true;
}
 
Example #16
Source File: OldFunctionDataDB.java    From ghidra with Apache License 2.0 5 votes vote down vote up
OldFunctionDataDB(OldFunctionManager functionManager, AddressMap addrMap,
		Record functionRecord, AddressSetView body) {

	this.functionManager = functionManager;
	this.addrMap = addrMap;
	this.functionRecord = functionRecord;
	this.body = body;

	entryPoint = addrMap.decodeAddress(functionRecord.getKey());
	program = functionManager.getProgram();
	functionAdapter = functionManager.getFunctionAdapter();
	registerAdapter = functionManager.getRegisterVariableAdapter();
	frame = new OldStackFrameDB(this);

}
 
Example #17
Source File: CompositeLoadImage.java    From ghidra with Apache License 2.0 5 votes vote down vote up
public void addProvider(MemoryLoadImage provider, AddressSetView view) {
	if (view == null) {
		providers.add(providers.size(), provider);
	}
	else {
		providers.add(0, provider);
	}
	addrSets.put(provider, view);
}
 
Example #18
Source File: DigestChecksumAlgorithm.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public void updateChecksum(Memory memory, AddressSetView addrSet, TaskMonitor monitor,
		ComputeChecksumsProvider provider) throws MemoryAccessException, CancelledException {
	MemoryByteIterator bytes = new MemoryByteIterator(memory, addrSet);
	while (bytes.hasNext()) {
		if (monitor.isCancelled()) {
			throw new CancelledException();
		}
		digester.update(bytes.next());
	}
	checksum = digester.digest();
}
 
Example #19
Source File: FGActionManager.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private void clearGraphSelection() {
	// assume that we have a selection or we would not have gotten called
	FGData functionGraphData = controller.getFunctionGraphData();
	Function function = functionGraphData.getFunction();
	AddressSetView functionBody = function.getBody();
	AddressSet subtraction = provider.getCurrentProgramSelection().subtract(functionBody);

	ProgramSelection programSelectionWithoutGraphBody = new ProgramSelection(subtraction);
	plugin.getTool().firePluginEvent(new ProgramSelectionPluginEvent("Spoof!",
		programSelectionWithoutGraphBody, provider.getCurrentProgram()));
}
 
Example #20
Source File: FollowFlowBackwardTest.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Test
public void testComputedCallsBackFrom0x96() {

	AddressSetView flowAddresses = getFlowsTo(0x96, followOnlyComputedCalls());

	AddressSet expectedAddresses = new AddressSet();
	expectedAddresses.add(addr(0x25), addr(0x2c));
	expectedAddresses.add(addr(0x90), addr(0x97));

	assertEquals(new MySelection(expectedAddresses), new MySelection(flowAddresses));
}
 
Example #21
Source File: FollowFlowForwardTest.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Test
public void testFollowComputedCall0x25() {

	AddressSetView flowAddresses = getFlowsFrom(0x25, followOnlyComputedCalls());

	AddressSet expectedAddresses = new AddressSet();
	expectedAddresses.add(addr(0x25), addr(0x2f));
	expectedAddresses.add(addr(0x90), addr(0x99));

	assertEquals(new MySelection(expectedAddresses), new MySelection(flowAddresses));
}
 
Example #22
Source File: FunctionComparisonPanel.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Load the given addresses of the indicated programs into the views of 
 * this panel
 * 
 * @param leftProgram the program for the left side of the panel
 * @param rightProgram the program for the right side of the panel
 * @param leftAddresses addresses for the info to display in the left side 
 * of the panel
 * @param rightAddresses addresses for the info to display in the right 
 * side of the panel
 */
public void loadAddresses(Program leftProgram, Program rightProgram,
		AddressSetView leftAddresses, AddressSetView rightAddresses) {
	leftComparisonData.setAddressSet(leftAddresses);
	rightComparisonData.setAddressSet(rightAddresses);
	leftComparisonData.setProgram(leftProgram);
	rightComparisonData.setProgram(rightProgram);
	CodeComparisonPanel<? extends FieldPanelCoordinator> activePanel =
		getActiveComparisonPanel();
	if (activePanel != null) {
		activePanel.loadAddresses(leftComparisonData.getProgram(),
			rightComparisonData.getProgram(), leftComparisonData.getAddressSet(),
			rightComparisonData.getAddressSet());
	}
}
 
Example #23
Source File: ApplyDiffCommand.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor.
 */
ApplyDiffCommand(ProgramDiffPlugin plugin, AddressSetView program1AddressSet,
		DiffController diffControl) {
	super("Apply Differences", false, true, true);
	this.plugin = plugin;
	this.p1AddressSet = program1AddressSet;
	this.diffControl = diffControl;
}
 
Example #24
Source File: FollowFlowBackwardTest.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Test
public void testFollowAllFlowsBackFrom0x5f() {

	AddressSetView flowAddresses = getFlowsTo(0x5f, followAllFlows());

	AddressSet expectedAddresses = new AddressSet();
	expectedAddresses.add(addr(0x0), addr(0x15));
	expectedAddresses.add(addr(0x30), addr(0x5f));

	assertEquals(new MySelection(expectedAddresses), new MySelection(flowAddresses));
}
 
Example #25
Source File: CombinedStringSearcher.java    From ghidra with Apache License 2.0 5 votes vote down vote up
/**
 * Searches the current program for strings based on the user-defined settings in
 * {@link StringTableOptions}.
 * 
 * @param monitor the task monitor
 * @throws CancelledException 
 */
public void search(TaskMonitor monitor) throws CancelledException {
				
	AbstractStringSearcher searcher = createSearcher();
	
	// Save off the set of addresses to search. This will be modified during the
	// search operation depending on whether loaded or unloaded blocks are to be 
	// searched.	
	AddressSetView updatedAddressSet = options.getAddressSet();
	
	updateNextString();
	
	if (options.includeUndefinedStrings() || options.includePartiallyDefinedStrings() ||
		options.includeConflictingStrings()) {
		updatedAddressSet = searcher.search(options.getAddressSet(), new AccumulatorAdapter(), options.useLoadedBlocksOnly(), monitor);
	}

	if (!options.includeDefinedStrings()) {
		return;
	}

	// Add defined strings to the accumulator that haven't been found by the StringSearcher
	monitor.setIndeterminate(true);
	while (nextDefinedString != null) {
		monitor.checkCanceled();
		if (!inRange(updatedAddressSet, nextDefinedString)) {
			updateNextString();
			continue;
		}

		if (!onlyShowWordStrings() ||
			((FoundStringWithWordStatus) nextDefinedString).isHighConfidenceWord()) {
			add(nextDefinedString);
		}

		updateNextString();
	}
}
 
Example #26
Source File: FollowFlowBackwardTest.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Test
public void testFollowAllFlowsBackFrom0x5040() {

	AddressSetView flowAddresses = getFlowsTo(0x5040, followAllFlows());

	AddressSet expectedAddresses = new AddressSet();
	expectedAddresses.add(addr(0x0), addr(0x2e));
	expectedAddresses.add(addr(0x30), addr(0x5e));
	expectedAddresses.add(addr(0x90), addr(0xbe));
	expectedAddresses.add(addr(0x390), addr(0x390));
	expectedAddresses.add(addr(0x5024), addr(0x5027));
	expectedAddresses.add(addr(0x5040), addr(0x5040));

	assertEquals(new MySelection(expectedAddresses), new MySelection(flowAddresses));
}
 
Example #27
Source File: DexMarkupDataAnalyzer.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Override
public boolean analyze( Program program, AddressSetView set, TaskMonitor monitor, MessageLog log ) throws Exception {
	monitor.setMaximum( set == null ? program.getMemory( ).getSize( ) : set.getNumAddresses( ) );
	monitor.setProgress( 0 );

	DexAnalysisState analysisState = DexAnalysisState.getState(program);
	DexHeader header = analysisState.getHeader();

	int headerLength = header.toDataType( ).getLength( );

	Listing listing = program.getListing( );

	DataIterator dataIterator = listing.getDefinedData( set, true );
	while ( dataIterator.hasNext( ) ) {
		monitor.checkCanceled( );
		monitor.incrementProgress( 1 );

		Data data = dataIterator.next( );

		if ( data.getMinAddress( ).getOffset( ) == 0x0 ) {
			continue;// skip the main dex header..
		}

		monitor.setMessage( "DEX: Data markup ... " + data.getMinAddress( ) );

		if ( data.isStructure( ) ) {
			processData( data, headerLength, monitor );
		}
	}

	return true;
}
 
Example #28
Source File: AnalyzerScheduler.java    From ghidra with Apache License 2.0 5 votes vote down vote up
synchronized void added(AddressSetView set) {
	if (!enabled) {
		return;
	}
	boolean alreadyScheduled = !addressSet.isEmpty();
	addressSet.add(set);

	if (!alreadyScheduled) {
		analysisManager.scheduleAnalysisTask(new AnalysisTask(executionPhase, this));
	}
}
 
Example #29
Source File: FollowFlowBackwardTest.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Test
public void testFollowAllFlowsBackFrom0x361() {

	AddressSetView flowAddresses = getFlowsTo(0x361, followAllFlows());

	AddressSet expectedAddresses = new AddressSet();
	expectedAddresses.add(addr(0x0), addr(0x2e));
	expectedAddresses.add(addr(0x30), addr(0x5e));
	expectedAddresses.add(addr(0x90), addr(0xb0));
	expectedAddresses.add(addr(0x360), addr(0x361));
	expectedAddresses.add(addr(0x5024), addr(0x5027));

	assertEquals(new MySelection(expectedAddresses), new MySelection(flowAddresses));
}
 
Example #30
Source File: FollowFlowForwardTest.java    From ghidra with Apache License 2.0 5 votes vote down vote up
@Test
public void testFollowAllFlowsFrom0x47() {

	AddressSetView flowAddresses = getFlowsFrom(0x47, followAllFlows());

	AddressSet expectedAddresses = new AddressSet();
	expectedAddresses.add(addr(0x0), addr(0x24));
	expectedAddresses.add(addr(0x26), addr(0x2f));
	expectedAddresses.add(addr(0x30), addr(0x52));
	expectedAddresses.add(addr(0x54), addr(0x5f));
	expectedAddresses.add(addr(0x60), addr(0x84));
	expectedAddresses.add(addr(0x86), addr(0x8f));
	expectedAddresses.add(addr(0x90), addr(0xb4));
	expectedAddresses.add(addr(0xb6), addr(0xbf));
	expectedAddresses.add(addr(0x130), addr(0x131));
	expectedAddresses.add(addr(0x160), addr(0x161));
	expectedAddresses.add(addr(0x190), addr(0x191));
	expectedAddresses.add(addr(0x230), addr(0x231));
	expectedAddresses.add(addr(0x260), addr(0x261));
	expectedAddresses.add(addr(0x290), addr(0x291));
	expectedAddresses.add(addr(0x330), addr(0x331));
	expectedAddresses.add(addr(0x360), addr(0x361));
	expectedAddresses.add(addr(0x390), addr(0x391));
	expectedAddresses.add(addr(0x5034), addr(0x5037));
	expectedAddresses.add(addr(0x5040), addr(0x5043));

	assertEquals(new MySelection(expectedAddresses), new MySelection(flowAddresses));
}