MCPcopy Create free account
hub / github.com/lief-project/LIEF / is_string

Function is_string

plugins/binaryninja/analysis/src/ELF/AnalyzerBase.cpp:31–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29namespace analysis_plugin::elf {
30
31std::string is_string(LIEF::SpanStream& stream, size_t minsz = 4) {
32 std::string current;
33 while (stream) {
34 auto c = stream.read<uint8_t>();
35 if (!c) {
36 break;
37 }
38
39 // Terminator
40 if (*c == '\0') {
41 if (current.size() >= minsz) {
42 return current;
43 }
44 return "";
45 }
46
47 // Valid char
48 if (std::isprint(*c) == 0) {
49 return "";
50 }
51
52 current.push_back((char)*c);
53 }
54 return "";
55}
56
57AnalyzerBase::AnalyzerBase(BinaryNinja::BinaryView& bv, Binary& elf,
58 TypeBuilder& type_builder) :

Callers 1

define_relocated_typeMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected