MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / ReadStr

Method ReadStr

KittyMemoryEx/KittyMemOp.cpp:43–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41/* =================== IKittyMemOp =================== */
42
43std::string IKittyMemOp::ReadStr(uintptr_t address, size_t maxLen)
44{
45 std::vector<char> chars(maxLen);
46
47 if (!Read(address, &chars[0], maxLen))
48 return "";
49
50 std::string str = "";
51 for (size_t i = 0; i < chars.size(); i++)
52 {
53 if (chars[i] == '\0')
54 break;
55
56 str.push_back(chars[i]);
57 }
58
59 if ((int)str[0] == 0 && str.size() == 1)
60 return "";
61
62 return str;
63}
64
65bool IKittyMemOp::WriteStr(uintptr_t address, std::string str)
66{

Callers 1

readMemStrMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected