Skip to content

Commit

Permalink
Add untested LLIL instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Hennenfent committed Oct 10, 2021
1 parent 79f6ad3 commit c359359
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
5 changes: 3 additions & 2 deletions explanations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
def find_missing():
_missing = set()
for op in LowLevelILOperation:
if op.name not in il_explanations and not op.name.endswith("_SSA"):
name: str = op.name
if name not in il_explanations and not ("_SSA" in name or "_PHI" in name):
_missing.add(op.name)
if _missing:
log_warn(
"Missing explanations for the following LLIL operations:\n"
+ "\n".join(_missing)
+ "\n".join(sorted(_missing))
)
24 changes: 23 additions & 1 deletion explanations/generic_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"LLIL_ADD": "{llil.left} + {llil.right}",
"LLIL_SUB": "{llil.left} - {llil.right}",
"LLIL_SBB": "{llil.left} - ({llil.right} + CarryFlag)",
"LLIL_ADDC": "{llil.left} + {llil.right} + CarryFlag",
"LLIL_ADC": "{llil.left} + {llil.right} + CarryFlag",
"LLIL_MUL": "{llil.left} * {llil.right}",
"LLIL_MULU_DP": "{llil.left} * {llil.right} (unsigned, double precision)",
"LLIL_MULS_DP": "{llil.left} * {llil.right} (signed, double precision)",
Expand Down Expand Up @@ -58,6 +58,7 @@
"LLIL_NOT": "the bitwise inverse of {llil.src}",
"LLIL_SET_REG_SPLIT": "Gets {llil.src} and stores the result in {llil.hi}:{llil.lo} (hi:lo)",
"LLIL_CONST_PTR": "{constant}",
"LLIL_EXTERN_PTR": "external pointer at {llil.constant}+{llil.offset}",
"LLIL_TRAP": "Halts the CPU until the next interrupt is fired.",
"LLIL_BP": "Processor Breakpoint",
"LLIL_FLAG_COND": "the last comparison was {condition}",
Expand All @@ -69,6 +70,27 @@
"LLIL_TEST_BIT": "{llil.left} bitwise compared with {llil.right}",
"LLIL_LOW_PART": "the low {llil.size} bytes of memory at {llil.src}",
"LLIL_ADD_OVERFLOW": "<NOT IMPLEMENTED> Adds {llil.left} and {llil.right} with overflow",
"LLIL_INT_TO_FLOAT": "{llil.src} converted to a float",
"LLIL_FLOAT_TO_INT": "{llil.src} converted to an int",
"LLIL_ROUND_TO_INT": "{llil.src} rounded to the nearest integer",
"LLIL_CEIL": "ceiling({llil.src})",
"LLIL_FLOOR": "floor({llil.src})",
"LLIL_FABS": "the absolute value of {llil.src}",
"LLIL_FADD": "{llil.left} + {llil.right} (as floats)",
"LLIL_FSUB": "{llil.left} - {llil.right} (as floats)",
"LLIL_FMUL": "{llil.left} * {llil.right} (as floats)",
"LLIL_FDIV": "{llil.left} / {llil.right} (as floats)",
"LLIL_FCMP_E": "{llil.left} == {llil.right} (as floats)",
"LLIL_FCMP_GE": "{llil.left} >= {llil.right} (as floats)",
"LLIL_FCMP_GT": "{llil.left} > {llil.right} (as floats)",
"LLIL_FCMP_LE": "{llil.left} <= {llil.right} (as floats)",
"LLIL_FCMP_LT": "{llil.left} < {llil.right} (as floats)",
"LLIL_FCMP_NE": "{llil.left} != {llil.right} (as floats)",
"LLIL_FLOAT_CONST": "floating point constant {llil.constant}",
"LLIL_FNEG": "-1 * {llil.src} (floating point)",
"LLIL_FSQRT": "the square root of {llil.src}",
"LLIL_FTRUNC": "{llil.src} (truncated)",
"LLIL_TAILCALL": "Calls {llil.dest} with {llil.params} as input and returns to {llil.output}",
"LLFC_E": "equal",
"LLFC_NE": "not equal",
"LLFC_SLT": "signed less than",
Expand Down

0 comments on commit c359359

Please sign in to comment.