-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
504 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import typing | ||
|
||
from .register import RegisterReader, RflagsRegister | ||
|
||
DoesBranch = typing.Callable[ | ||
[RflagsRegister, RegisterReader], | ||
int, | ||
] | ||
|
||
BRANCH_MAP: dict[str, DoesBranch] = { | ||
"ja": lambda flags, _: not flags.cf and not flags.zf, | ||
"jae": lambda flags, _: not flags.cf, | ||
"jb": lambda flags, _: flags.cf, | ||
"jbe": lambda flags, _: flags.cf or flags.zf, | ||
"jc": lambda flags, _: flags.cf, | ||
"jcxz": lambda _, reader: reader.read_gp("cx").value == 0, | ||
"jecxz": lambda _, reader: reader.read_gp("ecx").value == 0, | ||
"jrcxz": lambda _, reader: reader.read_gp("rcx").value == 0, | ||
"je": lambda flags, _: flags.zf, | ||
"jg": lambda flags, _: not flags.zf and flags.sf == flags.of, | ||
"jge": lambda flags, _: flags.sf == flags.of, | ||
"jl": lambda flags, _: flags.sf != flags.of, | ||
"jle": lambda flags, _: flags.zf or flags.sf != flags.of, | ||
"jna": lambda flags, _: flags.cf or flags.zf, | ||
"jnae": lambda flags, _: flags.cf, | ||
"jnb": lambda flags, _: not flags.cf, | ||
"jnbe": lambda flags, _: not flags.cf and not flags.zf, | ||
"jnc": lambda flags, _: not flags.cf, | ||
"jne": lambda flags, _: not flags.zf, | ||
"jng": lambda flags, _: flags.zf or flags.sf != flags.of, | ||
"jnge": lambda flags, _: flags.sf != flags.of, | ||
"jnl": lambda flags, _: flags.sf == flags.of, | ||
"jnle": lambda flags, _: not flags.zf and flags.sf == flags.of, | ||
"jno": lambda flags, _: not flags.of, | ||
"jnp": lambda flags, _: not flags.pf, | ||
"jns": lambda flags, _: not flags.sf, | ||
"jnz": lambda flags, _: not flags.zf, | ||
"jo": lambda flags, _: flags.of, | ||
"jp": lambda flags, _: flags.pf, | ||
"jpe": lambda flags, _: flags.pf, | ||
"jpo": lambda flags, _: not flags.pf, | ||
"js": lambda flags, _: flags.sf, | ||
"jz": lambda flags, _: flags.zf, | ||
"cmova": lambda flags, _: not flags.cf and not flags.zf, | ||
"cmovae": lambda flags, _: not flags.cf, | ||
"cmovb": lambda flags, _: flags.cf, | ||
"cmovbe": lambda flags, _: flags.cf or flags.zf, | ||
"cmovc": lambda flags, _: flags.cf, | ||
"cmove": lambda flags, _: flags.zf, | ||
"cmovg": lambda flags, _: not flags.zf and flags.sf == flags.of, | ||
"cmovge": lambda flags, _: flags.sf == flags.of, | ||
"cmovl": lambda flags, _: flags.sf != flags.of, | ||
"cmovle": lambda flags, _: flags.zf or flags.sf != flags.of, | ||
"cmovna": lambda flags, _: flags.cf or flags.zf, | ||
"cmovnae": lambda flags, _: flags.cf, | ||
"cmovnb": lambda flags, _: not flags.cf, | ||
"cmovnbe": lambda flags, _: not flags.cf and not flags.zf, | ||
"cmovnc": lambda flags, _: not flags.cf, | ||
"cmovne": lambda flags, _: not flags.zf, | ||
"cmovng": lambda flags, _: flags.zf or flags.sf != flags.of, | ||
"cmovnge": lambda flags, _: flags.sf != flags.of, | ||
"cmovnl": lambda flags, _: flags.sf == flags.of, | ||
"cmovnle": lambda flags, _: not flags.zf and flags.sf == flags.of, | ||
"cmovno": lambda flags, _: not flags.of, | ||
"cmovnp": lambda flags, _: not flags.pf, | ||
"cmovns": lambda flags, _: not flags.sf, | ||
"cmovnz": lambda flags, _: not flags.zf, | ||
"cmovo": lambda flags, _: flags.of, | ||
"cmovp": lambda flags, _: flags.pf, | ||
"cmovpe": lambda flags, _: flags.pf, | ||
"cmovpo": lambda flags, _: not flags.pf, | ||
"cmovs": lambda flags, _: flags.sf, | ||
"cmovz": lambda flags, _: flags.zf, | ||
} |
3 changes: 1 addition & 2 deletions
3
...nfig/lldbdash/register_lookup/__init__.py → ...fig/lldbdash/modules/register/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
from .reader import RegisterReader | ||
from .register import ( | ||
AvxRegister, | ||
GeneralPurposeRegister, | ||
MxcsrRegister, | ||
RflagsRegister, | ||
SegmentRegister, | ||
) | ||
from .register_lookup import RegisterLookup | ||
from .register_set import get_avx_reg_set, get_fp_reg_set, get_gp_reg_set |
Oops, something went wrong.