use of com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryModule in project binnavi by google.
the class CRelocationNotifier method collectWronglyPlacedModules.
/**
* Finds wrongly relocated modules by comparing a snapshot of the modules in an address space
* being reported by the debug client with those configured in
* com.google.security.zynamics.binnavi.
*
* @param debugger The active debugger.
* @param viewContainer The view container that is being debugged.
* @param memoryModules The modules whose base addresses are checked.
*
* @return A list of wrongly relocated modules.
*/
private static List<Pair<INaviModule, MemoryModule>> collectWronglyPlacedModules(final IDebugger debugger, final IViewContainer viewContainer, final List<MemoryModule> memoryModules) {
final List<Pair<INaviModule, MemoryModule>> wronglyPlacedModules = new ArrayList<Pair<INaviModule, MemoryModule>>();
final List<INaviModule> modules = viewContainer.getModules();
for (final INaviModule module : modules) {
for (final MemoryModule memoryModule : memoryModules) {
if (module.getConfiguration().getName().equalsIgnoreCase(memoryModule.getName())) {
final RelocatedAddress assumedAddress = debugger.fileToMemory(module, new UnrelocatedAddress(module.getConfiguration().getFileBase()));
final IAddress memoryAddress = memoryModule.getBaseAddress().getAddress();
if (!assumedAddress.getAddress().equals(memoryAddress)) {
wronglyPlacedModules.add(new Pair<INaviModule, MemoryModule>(module, memoryModule));
}
}
}
}
return wronglyPlacedModules;
}
Aggregations