Statistics
| Branch: | Tag: | Revision:

root / ui / opcodes.py

History | View | Annotate | Download (4.24 KB)

1
##      opcodes.py
2
#       -*- coding: utf-8 -*
3
#
4
#       Copyright 2011 David Martínez Moreno <ender@debian.org>
5
#       This software is not affiliated in any way with Facebook, my current employer.
6
#
7
#       This program is free software; you can redistribute it and/or modify
8
#       it under the terms of the GNU General Public License as published by
9
#       the Free Software Foundation; either version 2 of the License, or
10
#       at your option) any later version.
11
#
12
#       This program is distributed in the hope that it will be useful,
13
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
14
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
#       GNU General Public License for more details.
16
#
17
#       You should have received a copy of the GNU General Public License
18
#       along with this program; if not, write to the Free Software
19
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
#       MA 02110-1301, USA.
21

    
22
instructions = {
23
    "ADD <dst>, <src>":"Adds <src> to <dst>.\n<dst> may be a register or memory.\n<src> may be a register, memory or immediate value.",
24
    "CALL <loc>":"Call a function and return to the next instruction when finished.\n<loc> may be a relative offset from the current location, a register or memory addr.",
25
    "CMP <dst>, <src>":"Compare <src> with <dst>.\nSimilar to SUB instruction but does not modify the <dst> operand\nwith the result of the subtraction.",
26
    "DEC <dst>":"Subtract 1 from <dst>.\n<dst> may be a register or memory.",
27
    "DIV <divisor>":"Divide the EDX:EAX registers (64‐bit combo) by <divisor>.\n<divisor> may be a register or memory.",
28
    "INC <dst>":"Add 1 to <dst>.\n<dst> may be a register or memory.",
29
    "JE <loc>":"Jump if Equal (ZF=1) to <loc>.",
30
    "JGE <loc>":"Jump if Greater or Equal (SF=OF) to <loc>.",
31
    "JG <loc>":"Jump if Greater (ZF=0 and SF=OF) to <loc>.",
32
    "JLE <loc>":"Jump is Less or Equal (SF<>OF) to <loc>.",
33
    "JMP <loc>":"Jump to <loc>. Unconditional.",
34
    "JNE <loc>":"Jump if Not Equal (ZF=0) to <loc>.",
35
    "JNZ <loc>":"Jump if Not Zero (ZF=0) to <loc>.",
36
    "JZ <loc>":"Jump if Zero (ZF=1) to <loc>.",
37
    "LEA <dst>, <src>":"Load Effective Address.\nGets a pointer to the memory expression <src> and stores it in <dst>.",
38
    "MOV <dst>, <src>":"Move data from <src> to <dst>.\n<src> may be an immediate value, register, or a memory address.\n<dst> may be either a memory address or a register.\nBoth <src> and <dst> may not be memory addresses.",
39
    "MUL <src>":"Multiply the EDX:EAX registers (64‐bit combo) by <src>.\n<src> may be a register or memory.",
40
    "POP <dst>":"Take a 32‐bit value from the stack and store it in <dst>.\nESP is incremented by 4.\n<dst> may be a register, including segment registers, or memory.",
41
    "PUSH <value>":"Adds a 32‐bit value to the top of the stack.\nDecrements ESP by 4.\n<value> may be a register, segment register, memory or immediate value.",
42
    "ROL <dst>, <count>":"Bitwise Rotate Left the value in <dst> by <count> bits.\n<dst> may be a register or memory address.\n<count> may be immediate or CL register.",
43
    "ROR <dst>, <count>":"Bitwise Rotate Right the value in <dst> by <count> bits.\n<dst> may be a register or memory address.\n<count> may be immediate or CL register.",
44
    "SHL <dst>, <count>":"Bitwise Shift Left the value in <dst> by <count> bits.\nZero bits added to the least significant bits.\n<dst> may be reg. or mem. <count> is imm. or CL.",
45
    "SHR <dst>, <count>":"Bitwise Shift Right the value in <dst> by <count> bits.\nZero bits added to the least significant bits.\n<dst> may be reg. or mem. <count> is imm. or CL.",
46
    "SUB <dst>, <src>":"Subtract <src> from <dst>.\n<src> may be immediate, memory or a register.\n<dst> may be memory or a register.\n(src = dst)‐>ZF=1, (src > dst)‐>CF=1, (src < dst)‐>CF=0 and ZF=0",
47
    "TEST <dst>, <src>":"Performs a logical OR operation but does not modify the value in the <dst> operand.\n(src = dst)‐>ZF=1, (src <> dst)‐>ZF=0.",
48
    "XCHG <dst, <src>":"Exchange the contents of <src> and <dst>.\nOperands may be register or memory.\nBoth operands may not be memory.",
49
    "XOR <dst>, <src>":"Bitwise XOR the value in <src> with the value in <dst>, storing the result in <dst>.\n<dst> may be reg or mem and <src> may be reg, mem or imm."
50
}