GP-3666: Remove duplicative MODULE_[UN]LOADED events. Fix NPEs in GDB

connector.
This commit is contained in:
Dan
2023-08-07 14:25:37 -04:00
parent 4fbb7bf45a
commit ccf18d75a7
12 changed files with 9 additions and 110 deletions

View File

@@ -69,12 +69,7 @@ public class FridaModelTargetKernelModuleContainerImpl extends FridaModelTargetO
Msg.error(this, "Module " + info.getModuleName(index) + " not found!");
return;
}
FridaThread thread = getManager().getCurrentThread();
TargetThread eventThread =
(TargetThread) getModel().getModelObject(thread);
changeElements(List.of(), List.of(targetModule), Map.of(), "Loaded");
broadcast().event(getProxy(), eventThread, TargetEventType.MODULE_LOADED,
"Library " + info.getModuleName(index) + " loaded", List.of(targetModule));
}
@Override
@@ -91,11 +86,6 @@ public class FridaModelTargetKernelModuleContainerImpl extends FridaModelTargetO
FridaCause cause) {
FridaModelTargetModule targetModule = getTargetModule(info.getModule(index));
if (targetModule != null) {
FridaThread thread = getManager().getCurrentThread();
TargetThread eventThread =
(TargetThread) getModel().getModelObject(thread);
broadcast().event(getProxy(), eventThread, TargetEventType.MODULE_UNLOADED,
"Library " + info.getModuleName(index) + " unloaded", List.of(targetModule));
FridaModelImpl impl = (FridaModelImpl) model;
impl.deleteModelObject(targetModule.getModule());
}

View File

@@ -87,12 +87,7 @@ public class FridaModelTargetModuleContainerImpl extends FridaModelTargetObjectI
Msg.error(this, "Module " + info.getModuleName(index) + " not found!");
return;
}
FridaThread thread = getManager().getCurrentThread();
TargetThread eventThread =
(TargetThread) getModel().getModelObject(thread);
changeElements(List.of(), List.of(targetModule), Map.of(), "Loaded");
broadcast().event(getProxy(), eventThread, TargetEventType.MODULE_LOADED,
"Library " + info.getModuleName(index) + " loaded", List.of(targetModule));
}
@Override
@@ -109,11 +104,6 @@ public class FridaModelTargetModuleContainerImpl extends FridaModelTargetObjectI
FridaCause cause) {
FridaModelTargetModule targetModule = getTargetModule(info.getModule(index));
if (targetModule != null) {
FridaThread thread = getManager().getCurrentThread();
TargetThread eventThread =
(TargetThread) getModel().getModelObject(thread);
broadcast().event(getProxy(), eventThread, TargetEventType.MODULE_UNLOADED,
"Library " + info.getModuleName(index) + " unloaded", List.of(targetModule));
FridaModelImpl impl = (FridaModelImpl) model;
impl.deleteModelObject(targetModule.getModule());
}