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

Function _extract_blutter_function_name

adapters/python/adapter_template.py:340–381  ·  view source on GitHub ↗
(head_line: str)

Source from the content-addressed store, hash-verified

338 return None
339 return cleaned
340
341
342def _normalize_library_uri(raw: str) -> Optional[str]:
343 t = raw.strip()
344 if not t:
345 return None
346 if t.startswith("package:") or t.startswith("dart:") or t.startswith("file:"):
347 return t
348 return None
349
350
351def _sanitize_class_name(raw: str) -> Optional[str]:
352 t = raw.strip()
353 if not t:
354 return None
355 t = re.sub(r"<.*?>", "", t)
356 t = "".join(ch for ch in t if ch.isalnum() or ch in "_$")
357 if not t or _is_placeholder(t):
358 return None
359 return t
360
361
362# --------------------------------------------------------------------------
363# internal backend: string carving plus prologue scanning
364# --------------------------------------------------------------------------
365
366
367def _decode_bl_target(pc: int, word: int) -> Optional[int]:
368 if ((word >> 26) & 0x3F) != 0b100101:
369 return None
370 imm26 = word & 0x03FFFFFF
371 if imm26 & (1 << 25):
372 imm26 -= 1 << 26
373 return pc + (imm26 << 2)
374
375
376def _is_frame_prologue(word: int) -> bool:
377 rt = word & 0x1F
378 rn = (word >> 5) & 0x1F
379 rt2 = (word >> 10) & 0x1F
380 is_store_pair = ((word >> 30) & 0x3) == 0b10
381 return is_store_pair and rt == 29 and rt2 == 30 and rn == 31
382
383
384def _recover_code_ranges(instr: bytes, base_va: int) -> List[dict]:

Callers 1

_parse_blutter_asmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected