From c5edc003b1c0667c936c2ba3a278821da28c3b42 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 11 Feb 2025 21:56:13 -0500 Subject: [SharedCache] Fix misc compiler warnings These are from clang so there are still a bunch of warnings on GCC and MSVC --- view/sharedcache/core/DSCView.h | 2 +- view/sharedcache/core/ObjC.cpp | 1 - view/sharedcache/core/SharedCache.cpp | 3 --- view/sharedcache/core/SharedCache.h | 3 ++- 4 files changed, 3 insertions(+), 6 deletions(-) (limited to 'view/sharedcache') diff --git a/view/sharedcache/core/DSCView.h b/view/sharedcache/core/DSCView.h index bde2f7c2..d47dc179 100644 --- a/view/sharedcache/core/DSCView.h +++ b/view/sharedcache/core/DSCView.h @@ -9,7 +9,7 @@ class DSCView : public BinaryNinja::BinaryView { - bool m_parseOnly; + [[maybe_unused]] bool m_parseOnly; public: DSCView(const std::string &typeName, BinaryView *data, bool parseOnly = false); diff --git a/view/sharedcache/core/ObjC.cpp b/view/sharedcache/core/ObjC.cpp index 8d04d8d4..fa0e603c 100644 --- a/view/sharedcache/core/ObjC.cpp +++ b/view/sharedcache/core/ObjC.cpp @@ -549,7 +549,6 @@ void DSCObjCProcessor::LoadCategories(VMReader* reader, Ref
classPtrSec if (size == 0) return; auto ptrSize = m_data->GetAddressSize(); - auto ptrCount = size / m_data->GetAddressSize(); auto classPtrSectionStart = classPtrSection->GetStart(); auto classPtrSectionEnd = classPtrSection->GetEnd(); diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp index 2eae9d44..1f3219df 100644 --- a/view/sharedcache/core/SharedCache.cpp +++ b/view/sharedcache/core/SharedCache.cpp @@ -1539,7 +1539,6 @@ bool SharedCache::LoadSectionAtAddress(uint64_t address) } SharedCacheMachOHeader targetHeader; - CacheImage* targetImage = nullptr; MemoryRegion* targetSegment = nullptr; for (auto& image : MutableState().images) @@ -1549,7 +1548,6 @@ bool SharedCache::LoadSectionAtAddress(uint64_t address) if (region.start <= address && region.start + region.size > address) { targetHeader = MutableState().headers[image.headerLocation]; - targetImage = ℑ targetSegment = ®ion; break; } @@ -2532,7 +2530,6 @@ void SharedCache::InitializeHeader( vm->MappingAtAddress(header.linkeditSegment.vmaddr) .first.fileAccessor->lock() ->ReadBuffer(header.functionStarts.funcoff, header.functionStarts.funcsize); - size_t i = 0; uint64_t curfunc = header.textBase; uint64_t curOffset; diff --git a/view/sharedcache/core/SharedCache.h b/view/sharedcache/core/SharedCache.h index 19445dd9..54c63bb3 100644 --- a/view/sharedcache/core/SharedCache.h +++ b/view/sharedcache/core/SharedCache.h @@ -578,12 +578,13 @@ namespace SharedCacheCore { bool m_metadataValid = false; /* VIEWSTATE END -- NOTHING PAST THIS IS SERIALIZED */ - std::shared_ptr m_viewSpecificState; /* API VIEW START */ BinaryNinja::Ref m_dscView; /* API VIEW END */ + std::shared_ptr m_viewSpecificState; + private: void PerformInitialLoad(); void DeserializeFromRawView(); -- cgit v1.3.1