File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -242,21 +242,27 @@ bool TEView::Init()
242242 {
243243 case IMAGE_FILE_MACHINE_I386:
244244 platform = Platform::GetByName (" efi-x86" );
245+ m_addressSize = 4 ;
245246 break ;
246247 case IMAGE_FILE_MACHINE_AMD64:
247248 platform = Platform::GetByName (" efi-x86_64" );
249+ m_addressSize = 8 ;
248250 break ;
249251 case IMAGE_FILE_MACHINE_ARM64:
250252 platform = Platform::GetByName (" efi-aarch64" );
253+ m_addressSize = 8 ;
251254 break ;
252255 case IMAGE_FILE_MACHINE_ARM:
253256 platform = Platform::GetByName (" efi-armv7" );
257+ m_addressSize = 4 ;
254258 break ;
255259 case IMAGE_FILE_MACHINE_THUMB:
256260 platform = Platform::GetByName (" efi-thumb2" );
261+ m_addressSize = 4 ;
257262 break ;
258263 default :
259264 LogError (" TE platform '0x%x' is not supported" , header.machine );
265+ m_addressSize = 4 ;
260266 if (!m_parseOnly)
261267 m_logger->LogWarn (" Unable to determine architecture. Please open the file with options and select a valid architecture." );
262268 return false ;
@@ -276,6 +282,8 @@ bool TEView::Init()
276282 return false ;
277283 }
278284
285+ m_addressSize = m_arch->GetAddressSize ();
286+
279287 SetDefaultPlatform (platform);
280288 SetDefaultArchitecture (m_arch);
281289
@@ -309,7 +317,7 @@ uint64_t TEView::PerformGetEntryPoint() const
309317
310318size_t TEView::PerformGetAddressSize () const
311319{
312- return m_arch-> GetAddressSize () ;
320+ return m_addressSize ;
313321}
314322
315323TEViewType::TEViewType () : BinaryViewType(" TE" , " TE" )
Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ namespace BinaryNinja
6262 uint64_t m_headersOffset;
6363 Ref<Architecture> m_arch;
6464 uint64_t m_entryPoint;
65-
65+ uint32_t m_addressSize = 4 ;
66+
6667 protected:
6768 virtual uint64_t PerformGetEntryPoint () const override ;
6869 virtual bool PerformIsExecutable () const override { return true ; }
You can’t perform that action at this time.
0 commit comments