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

Function safe_string

api/python/src/pySafeString.cpp:20–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19namespace LIEF::py {
20safe_string_t safe_string(const std::string& str) {
21 nb::bytes str_bytes(str.c_str(), str.size());
22 try {
23 return nb::str(str_bytes.attr("decode")("utf8"));
24 } catch (const std::exception& e) {
25 return str_bytes;
26 }
27}
28}

Callers 15

create<SymbolVersionAux>Function · 0.85
create<SegmentCommand>Function · 0.85
create<Symbol>Function · 0.85
create<Section>Function · 0.85
create<DelayImportEntry>Function · 0.85
create<ExportEntry>Function · 0.85
create<DelayImport>Function · 0.85
create<ResourcesManager>Function · 0.85

Calls 2

c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected