Skip to content

Commit

Permalink
Add support for STx registers
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Jan 20, 2024
1 parent adc648e commit c4b7854
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dumpulator/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ def __init__(self, uc: Uc, x64):
"fs_base": UC_X86_REG_FS_BASE,
"gs_base": UC_X86_REG_GS_BASE,
}
for i in range(8):
reg = UC_X86_REG_ST0 + i
self._regmap[f"st{i}"] = reg
self._regmap[f"st({i})"] = reg
if unicorn.__version__[0] < '2':
self._regmap.update({
"riz": UC_X86_REG_RIZ,
Expand Down Expand Up @@ -340,7 +344,7 @@ def __init__(self, uc: Uc, x64):
def _resolve_reg(self, regname):
uc_reg = self._regmap.get(regname, None)
if uc_reg is None:
raise Exception(f"Unknown register '{regname}'")
raise KeyError(f"Unknown register '{regname}'")
#if not self._x64 and regname.startswith("r"):
# raise Exception(f"Register {regname} is not available in 32-bit mode")
return uc_reg
Expand Down

0 comments on commit c4b7854

Please sign in to comment.