MCPcopy Create free account
hub / github.com/HexHive/NASS / get_function_length

Function get_function_length

tools/gef.py:3385–3390  ·  view source on GitHub ↗

Attempt to get the length of the raw bytes of a function.

(sym: str)

Source from the content-addressed store, hash-verified

3383
3384
3385def get_function_length(sym: str) -> int:
3386 """Attempt to get the length of the raw bytes of a function."""
3387 dis = gdb.execute(f"disassemble {sym}", to_string=True).splitlines()
3388 start_addr = int(dis[1].split()[0], 16)
3389 end_addr = int(dis[-2].split()[0], 16)
3390 return end_addr - start_addr
3391
3392
3393@lru_cache()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected