aboutsummaryrefslogtreecommitdiffstats
path: root/server/patch_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'server/patch_server.py')
-rw-r--r--server/patch_server.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/patch_server.py b/server/patch_server.py
index 7ee490a..ff14a09 100644
--- a/server/patch_server.py
+++ b/server/patch_server.py
@@ -42,6 +42,25 @@ def _idatui_lv_get(x):
@tool
@idasync
+def resolve_names(
+ queries: Annotated[list, "Symbol name(s) to resolve to their OWN address"],
+) -> list:
+ """Resolve named locations (functions, labels like loc_/locret_, data) to the
+ exact address the NAME denotes, via get_name_ea. Unlike lookup_funcs, a
+ mid-function label resolves to the label's address, not the containing
+ function's entry."""
+ import idaapi
+ qs = queries if isinstance(queries, list) else [queries]
+ out = []
+ for q in qs:
+ q = str(q).strip()
+ ea = idaapi.get_name_ea(idaapi.BADADDR, q)
+ out.append({"query": q, "ea": (hex(ea) if ea != idaapi.BADADDR else None)})
+ return out
+
+
+@tool
+@idasync
def del_type(
name: Annotated[str, "Local type name to delete (struct/union/enum/typedef)"],
) -> dict: