diff --git a/core/adapters/lldbadapter.cpp b/core/adapters/lldbadapter.cpp index 7346578..5f3931c 100644 --- a/core/adapters/lldbadapter.cpp +++ b/core/adapters/lldbadapter.cpp @@ -600,7 +600,8 @@ DebugBreakpoint LldbAdapter::AddBreakpoint(const ModuleNameAndOffset& address, u } else { - std::string entryBreakpointCommand = fmt::format("b -s \"{}\" -a 0x{:x}", address.module, address.offset); + uint64_t addr = address.offset + m_originalBase; + std::string entryBreakpointCommand = fmt::format("b -s \"{}\" -a 0x{:x}", address.module, addr); auto ret = InvokeBackendCommand(entryBreakpointCommand); DebuggerEvent evt; evt.type = BackendMessageEventType; diff --git a/core/debugadapter.cpp b/core/debugadapter.cpp index c0ea280..fe85fcc 100644 --- a/core/debugadapter.cpp +++ b/core/debugadapter.cpp @@ -44,6 +44,7 @@ DebugAdapter::DebugAdapter(BinaryView* data) // Here we check if there is actually a function at the entry point, to determine if the entry point is real. m_hasEntryFunction = (data->GetAnalysisEntryPoint() != nullptr); m_start = data->GetStart(); + m_originalBase = data->GetOriginalBase(); if (data->GetDefaultArchitecture()) m_defaultArchitecture = data->GetDefaultArchitecture()->GetName(); diff --git a/core/debugadapter.h b/core/debugadapter.h index a47e510..f1a2a01 100644 --- a/core/debugadapter.h +++ b/core/debugadapter.h @@ -198,6 +198,7 @@ namespace BinaryNinjaDebugger { uint64_t m_entryPoint; bool m_hasEntryFunction; uint64_t m_start; + uint64_t m_originalBase; std::string m_defaultArchitecture; std::string m_originalFileName;