MCPcopy Create free account
hub / github.com/Vector35/debugger / CheckForLiteralString

Function CheckForLiteralString

core/debuggercontroller.cpp:2003–2030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2001
2002
2003static std::string CheckForLiteralString(uint64_t address)
2004{
2005 bool ok = true;
2006 bool zeroFound = false;
2007 std::string result;
2008 for (size_t i = 0; i < 8; i++)
2009 {
2010 uint8_t c = (address >> (8 * i)) & 0xff;
2011 if (IsPrintableChar(c) && (!zeroFound))
2012 {
2013 result = std::string(1, c) + result;
2014 }
2015 else if (c == 0)
2016 {
2017 zeroFound = true;
2018 }
2019 else if (c != 0)
2020 {
2021 ok = false;
2022 break;
2023 }
2024 }
2025
2026 if (ok)
2027 return result;
2028
2029 return "";
2030}
2031
2032
2033std::string DebuggerController::GetAddressInformation(uint64_t address)

Callers 1

GetAddressInformationMethod · 0.85

Calls 1

IsPrintableCharFunction · 0.85

Tested by

no test coverage detected