Skip to content

Commit

Permalink
Add "L" in front of the string annotation if a register points to a w…
Browse files Browse the repository at this point in the history
…ide string. Fix Vector35#437
  • Loading branch information
xusheng6 committed Mar 8, 2023
1 parent 2061312 commit d60deaf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/debuggercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1864,15 +1864,15 @@ static std::string CheckForPrintableString(const DataBuffer& memory)
std::string result;
result = CheckForASCIIString(memory);
if (!result.empty())
return result;
return fmt::format("\"{}\"", BinaryNinja::EscapeString(result));

result = CheckForUTF16String(memory);
if (!result.empty())
return result;
return fmt::format("L\"{}\"", BinaryNinja::EscapeString(result));;

result = CheckForUTF32String(memory);
if (!result.empty())
return result;
return fmt::format("L\"{}\"", BinaryNinja::EscapeString(result));;

return "";
}
Expand Down Expand Up @@ -1918,7 +1918,7 @@ std::string DebuggerController::GetAddressInformation(uint64_t address)
auto result = CheckForPrintableString(memory);
// If we can find a string at the address, return it
if (!result.empty())
return fmt::format("\"{}\"", BinaryNinja::EscapeString(result));
return result;

// Check pointer to strings
auto buffer = m_liveView->ReadBuffer(address, m_liveView->GetAddressSize());
Expand All @@ -1930,7 +1930,7 @@ std::string DebuggerController::GetAddressInformation(uint64_t address)
const DataBuffer pointerMemory = ReadMemory(pointerValue, 128);
result = CheckForPrintableString(pointerMemory);
if (!result.empty())
return fmt::format("&\"{}\"", BinaryNinja::EscapeString(result));
return std::string("&") + result;
}
}

Expand Down

0 comments on commit d60deaf

Please sign in to comment.