summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2023-03-18 21:21:43 -0400
committerdusoleil <howcansocksbereal@gmail.com>2023-03-19 04:19:18 -0400
commit205f828bd669772ee319595fa6792953f0abd327 (patch)
tree55024b3f6f9fda0677b0da8f209c319391bff6b6
parent42ab380423553720a2a80d03dee68957e6f3b4ff (diff)
downloadsploit-205f828bd669772ee319595fa6792953f0abd327.tar.gz
sploit-205f828bd669772ee319595fa6792953f0abd327.zip
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 <m@lfurio.us> Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--sploit/symtbl.py2
1 files changed, 1 insertions, 1 deletions
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):