#include <x86InstructionSemantics.h>
Collaboration diagram for X86InstructionSemantics< Policy, WordType >:

Public Member Functions | |
| Word (32) orig_eip | |
| X86InstructionSemantics (Policy &policy) | |
| virtual | ~X86InstructionSemantics () |
| WordType< 1 > | rep_enter () |
| Beginning of a 'rep', 'repe', or 'repne' loop. | |
| void | rep_repeat (SgAsmx86Instruction *insn, WordType< 1 > repeat, WordType< 1 > cond) |
| Decrement the counter for a 'rep', 'repe', or 'repne' loop and adjust the instruction pointer. | |
| template<size_t N> | |
| WordType< 8 *N > | stringop_load_si (SgAsmx86Instruction *insn, WordType< 1 > cond) |
| Return the value of the memory pointed to by the SI register. | |
| template<size_t N> | |
| WordType< 8 *N > | stringop_load_di (WordType< 1 > cond) |
| Return the value of memory pointed to by the DI register. | |
| template<size_t N> | |
| void | stos_semantics (SgAsmx86Instruction *insn, WordType< 1 > cond) |
| Instruction semantics for stosN where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | rep_stos_semantics (SgAsmx86Instruction *insn) |
| Instruction semantics for rep_stosN where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | movs_semantics (SgAsmx86Instruction *insn, WordType< 1 > cond) |
| Instruction semantics for movsN where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | rep_movs_semantics (SgAsmx86Instruction *insn) |
| Instruction semantics for rep_movsN where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | cmps_semantics (SgAsmx86Instruction *insn, WordType< 1 > cond) |
| Instruction semantics for cmpsN where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | repe_cmps_semantics (SgAsmx86Instruction *insn) |
| Instruction semantics for one iteration of the repe_cmpsN instruction, where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | repne_cmps_semantics (SgAsmx86Instruction *insn) |
| Instruction semantics for one iteration of the repne_cmpsN instruction, where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | scas_semantics (SgAsmx86Instruction *insn, WordType< 1 > cond) |
| Instruction semantics for scasN where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | repe_scas_semantics (SgAsmx86Instruction *insn) |
| Instruction semantics for one iteration of repe_scasN where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t N> | |
| void | repne_scas_semantics (SgAsmx86Instruction *insn) |
| Instruction semantics for one iterator of repne_scasN where N is 1 (b), 2 (w), or 4 (d). | |
| void | lods_semantics_regupdate (WordType< 8 > v) |
| Helper for lods_semantics() to load one byte into the AL register. | |
| void | lods_semantics_regupdate (WordType< 16 > v) |
| Helper for lods_semantics() to load one word into the AX register. | |
| void | lods_semantics_regupdate (WordType< 32 > v) |
| Helper for lods_semantics() to load one doubleword into the EAX register. | |
| template<size_t N> | |
| void | lods_semantics (SgAsmx86Instruction *insn) |
| Instruction semantics for lodsN where N is 1 (b), 2 (w), or 4 (d). | |
| template<size_t Len> | |
| Word (Len) invertMaybe(const Word(Len)&w | |
| size_t size_t Len | Word (To-From) extract(Word(Len) w) |
| template<size_t From, size_t To> | |
| Word (To) signExtend(Word(From) w) | |
| template<size_t Len> | |
| Word (Len) readRegister(const RegisterDescriptor ®) | |
| Reads from a named register. | |
| template<size_t Len> | |
| void | writeRegister (const RegisterDescriptor ®, const Word(Len)&value) |
| Writes to a named register. | |
| template<size_t Len> | |
| Word (1) greaterOrEqualToTen(Word(Len) w) | |
| template<size_t Len> | |
| Word (Len) readMemory(X86SegmentRegister segreg | |
| const | Word (32)&addr |
| const | Word (1) cond) |
| Word (32) readEffectiveAddress(SgAsmExpression *expr) | |
| Word (8) read8(SgAsmExpression *e) | |
| Word (16) read16(SgAsmExpression *e) | |
| Word (32) read32(SgAsmExpression *e) | |
| void | write8 (SgAsmExpression *e, const Word(8)&value) |
| void | write16 (SgAsmExpression *e, const Word(16)&value) |
| void | write32 (SgAsmExpression *e, const Word(32)&value) |
| Word (1) parity(Word(8) w) | |
| template<size_t Len> | |
| void | setFlagsForResult (const Word(Len)&result) |
| template<size_t Len> | |
| void | setFlagsForResult (const Word(Len)&result, Word(1) cond) |
| template<size_t Len> | |
| Word (Len) doAddOperation(const Word(Len)&a | |
| const | Word (Len)&b |
| const bool | Word (1) carryIn) |
| template<size_t Len> | |
| Word (Len) doAddOperation(const Word(Len)&a | |
| const | Word (Len)&b |
| const bool | Word (1) carryIn |
| const bool | Word (1) cond) |
| template<size_t Len> | |
| Word (Len) doIncOperation(const Word(Len)&a | |
Public Attributes | |
| Policy & | policy |
| SgAsmInstruction * | current_instruction |
| RegisterDescriptor | REG_EAX |
| RegisterDescriptor | REG_EBX |
| RegisterDescriptor | REG_ECX |
| RegisterDescriptor | REG_EDX |
| RegisterDescriptor | REG_EDI |
| RegisterDescriptor | REG_EIP |
| RegisterDescriptor | REG_ESI |
| RegisterDescriptor | REG_ESP |
| RegisterDescriptor | REG_EBP |
| RegisterDescriptor | REG_AX |
| RegisterDescriptor | REG_CX |
| RegisterDescriptor | REG_DX |
| RegisterDescriptor | REG_AL |
| RegisterDescriptor | REG_AH |
| RegisterDescriptor | REG_EFLAGS |
| RegisterDescriptor | REG_AF |
| RegisterDescriptor | REG_CF |
| RegisterDescriptor | REG_DF |
| RegisterDescriptor | REG_OF |
| RegisterDescriptor | REG_PF |
| RegisterDescriptor | REG_SF |
| RegisterDescriptor | REG_ZF |
| size_t | To |
| const bool | invertCarries |
| bool | dec |
Classes | |
| struct | Exception |
| X86InstructionSemantics< Policy, WordType >::X86InstructionSemantics | ( | Policy & | policy | ) | [inline] |
| virtual X86InstructionSemantics< Policy, WordType >::~X86InstructionSemantics | ( | ) | [inline, virtual] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | 32 | ) |
| WordType<1> X86InstructionSemantics< Policy, WordType >::rep_enter | ( | ) | [inline] |
Beginning of a 'rep', 'repe', or 'repne' loop.
The return value is the condition status, and is true if the loop body should execute, false otherwise.
| void X86InstructionSemantics< Policy, WordType >::rep_repeat | ( | SgAsmx86Instruction * | insn, | |
| WordType< 1 > | repeat, | |||
| WordType< 1 > | cond | |||
| ) | [inline] |
Decrement the counter for a 'rep', 'repe', or 'repne' loop and adjust the instruction pointer.
The instruction pointer is reset to the beginning of the instruction if the loop counter, cx register, is non-zero after decrementing and repeat is true. Otherwise the instruction pointer is not adjusted and the loop effectively exits. If cond is false then this function has no effect on the state.
| WordType<8*N> X86InstructionSemantics< Policy, WordType >::stringop_load_si | ( | SgAsmx86Instruction * | insn, | |
| WordType< 1 > | cond | |||
| ) | [inline] |
Return the value of the memory pointed to by the SI register.
| WordType<8*N> X86InstructionSemantics< Policy, WordType >::stringop_load_di | ( | WordType< 1 > | cond | ) | [inline] |
Return the value of memory pointed to by the DI register.
| void X86InstructionSemantics< Policy, WordType >::stos_semantics | ( | SgAsmx86Instruction * | insn, | |
| WordType< 1 > | cond | |||
| ) | [inline] |
Instruction semantics for stosN where N is 1 (b), 2 (w), or 4 (d).
If cond is false then this instruction does not change any state.
| void X86InstructionSemantics< Policy, WordType >::rep_stos_semantics | ( | SgAsmx86Instruction * | insn | ) | [inline] |
Instruction semantics for rep_stosN where N is 1 (b), 2 (w), or 4 (d).
This method handles semantics for one iteration of stosN. See https://siyobik.info/index.php?module=x86&id=279
| void X86InstructionSemantics< Policy, WordType >::movs_semantics | ( | SgAsmx86Instruction * | insn, | |
| WordType< 1 > | cond | |||
| ) | [inline] |
Instruction semantics for movsN where N is 1 (b), 2 (w), or 4 (d).
If cond is false then this instruction does not change any state.
| void X86InstructionSemantics< Policy, WordType >::rep_movs_semantics | ( | SgAsmx86Instruction * | insn | ) | [inline] |
Instruction semantics for rep_movsN where N is 1 (b), 2 (w), or 4 (d).
This method handles semantics for one iteration of the instruction.
| void X86InstructionSemantics< Policy, WordType >::cmps_semantics | ( | SgAsmx86Instruction * | insn, | |
| WordType< 1 > | cond | |||
| ) | [inline] |
Instruction semantics for cmpsN where N is 1 (b), 2 (w), or 4 (d).
If cond is false then this instruction does not change any state. See Intel Instruction Set Reference 3-154 Vol 2a, March 2009 for opcodes 0xa6 and 0xa7 with no prefix.
| void X86InstructionSemantics< Policy, WordType >::repe_cmps_semantics | ( | SgAsmx86Instruction * | insn | ) | [inline] |
Instruction semantics for one iteration of the repe_cmpsN instruction, where N is 1 (b), 2 (w), or 4 (d).
| void X86InstructionSemantics< Policy, WordType >::repne_cmps_semantics | ( | SgAsmx86Instruction * | insn | ) | [inline] |
Instruction semantics for one iteration of the repne_cmpsN instruction, where N is 1 (b), 2 (w), or 4 (d).
| void X86InstructionSemantics< Policy, WordType >::scas_semantics | ( | SgAsmx86Instruction * | insn, | |
| WordType< 1 > | cond | |||
| ) | [inline] |
Instruction semantics for scasN where N is 1 (b), 2 (w), or 4 (d).
If cond is false then this instruction does not change any state.
| void X86InstructionSemantics< Policy, WordType >::repe_scas_semantics | ( | SgAsmx86Instruction * | insn | ) | [inline] |
Instruction semantics for one iteration of repe_scasN where N is 1 (b), 2 (w), or 4 (d).
| void X86InstructionSemantics< Policy, WordType >::repne_scas_semantics | ( | SgAsmx86Instruction * | insn | ) | [inline] |
Instruction semantics for one iterator of repne_scasN where N is 1 (b), 2 (w), or 4 (d).
| void X86InstructionSemantics< Policy, WordType >::lods_semantics_regupdate | ( | WordType< 8 > | v | ) | [inline] |
Helper for lods_semantics() to load one byte into the AL register.
| void X86InstructionSemantics< Policy, WordType >::lods_semantics_regupdate | ( | WordType< 16 > | v | ) | [inline] |
Helper for lods_semantics() to load one word into the AX register.
| void X86InstructionSemantics< Policy, WordType >::lods_semantics_regupdate | ( | WordType< 32 > | v | ) | [inline] |
Helper for lods_semantics() to load one doubleword into the EAX register.
| void X86InstructionSemantics< Policy, WordType >::lods_semantics | ( | SgAsmx86Instruction * | insn | ) | [inline] |
Instruction semantics for lodsN where N is 1 (b), 2 (w), or 4 (d).
| X86InstructionSemantics< Policy, WordType >::Word | ( | Len | ) | const |
| size_t size_t Len X86InstructionSemantics< Policy, WordType >::Word | ( | To- | From | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | To | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | Len | ) | const [inline] |
Reads from a named register.
Delegated to policy.
| void X86InstructionSemantics< Policy, WordType >::writeRegister | ( | const RegisterDescriptor & | reg, | |
| const Word(Len)& | value | |||
| ) | [inline] |
Writes to a named register.
Delegated to policy.
| X86InstructionSemantics< Policy, WordType >::Word | ( | 1 | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | Len | ) |
| const X86InstructionSemantics< Policy, WordType >::Word | ( | 32 | ) |
| const X86InstructionSemantics< Policy, WordType >::Word | ( | 1 | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | 32 | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | 8 | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | 16 | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | 32 | ) | [inline] |
| void X86InstructionSemantics< Policy, WordType >::write8 | ( | SgAsmExpression * | e, | |
| const Word(8)& | value | |||
| ) | [inline] |
| void X86InstructionSemantics< Policy, WordType >::write16 | ( | SgAsmExpression * | e, | |
| const Word(16)& | value | |||
| ) | [inline] |
| void X86InstructionSemantics< Policy, WordType >::write32 | ( | SgAsmExpression * | e, | |
| const Word(32)& | value | |||
| ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | 1 | ) | [inline] |
| void X86InstructionSemantics< Policy, WordType >::setFlagsForResult | ( | const Word(Len)& | result | ) | [inline] |
| void X86InstructionSemantics< Policy, WordType >::setFlagsForResult | ( | const Word(Len)& | result, | |
| Word(1) | cond | |||
| ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | Len | ) | const |
| const X86InstructionSemantics< Policy, WordType >::Word | ( | Len | ) |
| const bool X86InstructionSemantics< Policy, WordType >::Word | ( | 1 | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | Len | ) | const |
| const X86InstructionSemantics< Policy, WordType >::Word | ( | Len | ) |
| const bool X86InstructionSemantics< Policy, WordType >::Word | ( | 1 | ) |
| const bool X86InstructionSemantics< Policy, WordType >::Word | ( | 1 | ) | [inline] |
| X86InstructionSemantics< Policy, WordType >::Word | ( | Len | ) | const |
| Policy& X86InstructionSemantics< Policy, WordType >::policy |
| SgAsmInstruction* X86InstructionSemantics< Policy, WordType >::current_instruction |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EAX |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EBX |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_ECX |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EDX |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EDI |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EIP |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_ESI |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_ESP |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EBP |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_AX |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_CX |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_DX |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_AL |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_AH |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_EFLAGS |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_AF |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_CF |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_DF |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_OF |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_PF |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_SF |
| RegisterDescriptor X86InstructionSemantics< Policy, WordType >::REG_ZF |
| size_t X86InstructionSemantics< Policy, WordType >::To |
| const bool X86InstructionSemantics< Policy, WordType >::invertCarries |
| bool X86InstructionSemantics< Policy, WordType >::dec |
1.4.7