From 205f828bd669772ee319595fa6792953f0abd327 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 18 Mar 2023 21:21:43 -0400 Subject: symtbl: Support offset translation for int-like objects This fixes a bug with Symtbl's __getitem__. An object that is convertable to int should also cause __getitem__ to behave as though an int was given, and translate the object as a foreign offset. Signed-off-by: Malfurious Signed-off-by: dusoleil --- sploit/symtbl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sploit/symtbl.py b/sploit/symtbl.py index 4b80a0a..9412a47 100644 --- a/sploit/symtbl.py +++ b/sploit/symtbl.py @@ -146,7 +146,7 @@ class SymtblImpl: """Return symbol offset, subtable, or translated offset via subscript""" if symbol == "base": return self.base - offset = symbol if type(symbol) is int else self.__entries__[symbol] + offset = self.__entries__[symbol] if type(symbol) is str else symbol return offset + (self.base + self.__adjust__) def __setitem__(self, symbol, value): -- cgit v1.2.3