Skip to content

libdebug.data.symbol

Symbol dataclass

A symbol in the target process.

start (int): The start address of the symbol in the target process. end (int): The end address of the symbol in the target process. name (str): The name of the symbol in the target process. backing_file (str): The backing file of the symbol in the target process.

Source code in libdebug/data/symbol.py
@dataclass
class Symbol:
    """A symbol in the target process.

    start (int): The start address of the symbol in the target process.
    end (int): The end address of the symbol in the target process.
    name (str): The name of the symbol in the target process.
    backing_file (str): The backing file of the symbol in the target process.
    """

    start: int
    end: int
    name: str
    backing_file: str

    def __hash__(self: Symbol) -> int:
        """Returns the hash of the symbol."""
        return hash((self.start, self.end, self.name, self.backing_file))

    def __repr__(self: Symbol) -> str:
        """Returns the string representation of the symbol."""
        return f"Symbol(start={self.start:#x}, end={self.end:#x}, name={self.name}, backing_file={self.backing_file})"

__hash__()

Returns the hash of the symbol.

Source code in libdebug/data/symbol.py
def __hash__(self: Symbol) -> int:
    """Returns the hash of the symbol."""
    return hash((self.start, self.end, self.name, self.backing_file))

__repr__()

Returns the string representation of the symbol.

Source code in libdebug/data/symbol.py
def __repr__(self: Symbol) -> str:
    """Returns the string representation of the symbol."""
    return f"Symbol(start={self.start:#x}, end={self.end:#x}, name={self.name}, backing_file={self.backing_file})"