diff options
| author | kat <kat@vector35.com> | 2024-10-23 21:56:29 -0400 |
|---|---|---|
| committer | kat <kat@vector35.com> | 2024-10-23 21:58:47 -0400 |
| commit | 3006c68e108a18f9b8782bc937dc9ec7e2cb3b54 (patch) | |
| tree | f589bb38909349142c09b6215244205aef0a57ac /view/sharedcache/ui/SharedCacheBDNotifications.cpp | |
| parent | 80fcccec8f686e0e5c89626b60af121a97baf856 (diff) | |
Initial commit of the alpha dyld_shared_cache view API Plugin.
This is an early release of our DSC processing plugin. We're still hard at work improving this feature. You should be able to just drop in a dyld_shared_cache and use the 'Shared Cache Triage' view to load and analyze images.
Diffstat (limited to 'view/sharedcache/ui/SharedCacheBDNotifications.cpp')
| -rw-r--r-- | view/sharedcache/ui/SharedCacheBDNotifications.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/view/sharedcache/ui/SharedCacheBDNotifications.cpp b/view/sharedcache/ui/SharedCacheBDNotifications.cpp new file mode 100644 index 00000000..f59f313c --- /dev/null +++ b/view/sharedcache/ui/SharedCacheBDNotifications.cpp @@ -0,0 +1,69 @@ +// +// Created by kat on 8/22/24. +// + +#include "SharedCacheBDNotifications.h" + + +SharedCacheBDNotifications::SharedCacheBDNotifications(Ref<BinaryView> view) + : BinaryDataNotification(FunctionUpdates | DataVariableUpdates) +{ +} + +void SharedCacheBDNotifications::OnAnalysisFunctionAdded(BinaryView* view, Function* func) +{ + // + // We just cannot do this until one of: + // "Component::AddAutoFunction" + // BinaryView::BeginIgnoredUndoActions + // some similar fix + + /* + if (view->GetTypeName() == VIEW_NAME) + { + auto sections = view->GetSectionsAt(func->GetStart()); + if (sections.size() > 0) + { + auto section = sections[0]; + auto imageName = section->GetName().substr(0, section->GetName().find("::")); + auto id = view->BeginUndoActions(); + auto comp = view->GetComponentByPath(imageName); + if (!comp) + { + comp = view->CreateComponentWithName(imageName); + } + comp.value()->AddFunction(func); + view->ForgetUndoActions(id); + } + } + */ +} + + +void SharedCacheBDNotifications::OnSectionAdded(BinaryView* data, Section* section) +{ + +} + + +void SharedCacheBDNotifications::OnDataVariableAdded(BinaryView* view, const DataVariable& var) +{ + /* + if (view->GetTypeName() == VIEW_NAME) + { + auto sections = view->GetSectionsAt(var.address); + if (sections.size() > 0) + { + auto section = sections[0]; + auto imageName = section->GetName().substr(0, section->GetName().find("::")); + auto comp = view->GetComponentByPath(imageName); + auto id = view->BeginUndoActions(); + if (!comp) + { + comp = view->CreateComponentWithName(imageName); + } + comp.value()->AddDataVariable(var); + view->ForgetUndoActions(id); + } + }*/ +} |
