Skip to content

Commit

Permalink
set_name: restore old behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Sep 11, 2024
1 parent dbe41c6 commit 3c83a05
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions fa/commands/set_name.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
from typing import List

from fa.commands.locate import locate_single
from fa.fa_types import IDA_MODULE
from fa.utils import ArgumentParserNoExit

try:
import ida_bytes
import ida_name
from ida_idaapi import BADADDR
except ImportError:
pass

Expand All @@ -25,16 +21,6 @@ def is_address_nameless(addr: int) -> bool:

def set_name(addresses: List[int], name: str, interpreter) -> List[int]:
for ea in addresses:
if IDA_MODULE:
current_name = ida_name.get_ea_name(ea)
remote_addr = locate_single(current_name)
if current_name == name:
continue

# we want to avoid accidental renames from bad sigs, therefore we assert the following:
assert remote_addr == BADADDR, f'Rename failed, name already used at {hex(remote_addr)} ({hex(ea)})'
assert is_address_nameless(ea), f'Rename failed, address has a different name {current_name} ({hex(ea)})'

interpreter.set_symbol(name, ea)
return addresses

Expand Down

0 comments on commit 3c83a05

Please sign in to comment.