MCPcopy Create free account
hub / github.com/caverav/flutterdec / _recover_functions

Function _recover_functions

adapters/python/adapter_template.py:72–113  ·  view source on GitHub ↗
(instr: bytes, base_va: int)

Source from the content-addressed store, hash-verified

70 "na",
71 "todo",
72 "tbd",
73 "unknown",
74 "<unknown>",
75 "unnamed",
76 "anonymous",
77 "placeholder",
78 "undefined",
79 ]
80)
81
82EXACT_LOWERCASE_PLACEHOLDERS = frozenset(["none", "null", "nil"])
83
84
85class BackendUnavailable(Exception):
86 """The backend's tooling is not installed. Distinct from it failing."""
87
88
89class BackendFailed(Exception):
90 """The backend ran and could not produce a model."""
91
92
93def _is_placeholder(text: str) -> bool:
94 t = text.strip()
95 return t in EXACT_LOWERCASE_PLACEHOLDERS or t.lower() in CASE_INSENSITIVE_PLACEHOLDERS
96
97def _usable_value(text: str) -> bool:
98 return bool(text) and not _is_placeholder(text)
99
100
101# --------------------------------------------------------------------------
102# protocol v1
103# --------------------------------------------------------------------------
104
105
106def _sha256(data: bytes) -> str:
107 return hashlib.sha256(data).hexdigest()
108
109
110def _load_request(path: Path) -> dict:
111 try:
112 request = json.loads(path.read_text(encoding="utf-8"))
113 except (OSError, json.JSONDecodeError) as exc:
114 raise ValueError(f"request is not readable JSON: {exc}") from exc
115 if request.get("protocol_major") != PROTOCOL_MAJOR:
116 raise ValueError(

Callers 1

entrypointFunction · 0.85

Calls 2

_decode_bl_targetFunction · 0.85
_is_frame_prologueFunction · 0.85

Tested by

no test coverage detected