经典定长指令_修改ERX

1.PUSH / POP

0x50       push eax

0x51       push ecx

0x52       push edx

0x53       push ebx

0x54       push esp

0x55       push ebp

0x56       push esi

0x57       push edi

- - - - - - - - - - - - - -

0x58       pop eax

0x59       pop ecx

0x5a       pop edx

0x5b       pop ebx

0x5c       pop esp

0x5d       pop ebp

0x5e       pop esi

0x5f        pop edi

 2. INC./DEC:

0x40-0x47         INC ERX   //同样对应各个寄存器 加法

0x48-0x4F    DEC ERX   //减法

32位系统和64位系统硬编码表的表述不一致。

3.XCHG word, double-word or quad-word register with rAX        

XCHG字,双字或四字寄存器与rAX

  0x91   XCHG EAX, ECX ;             把ECX的值放到EAX里

  0x92   XCHG EAX, EDX ;

......

90  NOP 空指令  用来对齐;  因为XCHG EAX,EAX 互换没意义 所以操作系统把90设置成对齐指令;

4.所谓的花指令 就是通过E0 等等的硬编码把下面一个地址给隐藏了!

MOV immediate byte into byte register

立即将MOV字节存入字节寄存器

如果想去花,可以直接把Ex 编码改成90 就行了


Table A-1. Superscripts Utilized in Opcode Tables
Superscript
Symbol
Meaning of Symbol
1A Bits 5, 4, and 3 of ModR/M byte used as an opcode extension (refer to Section A.4, “Opcode Extensions For One-Byte
And Two-byte Opcodes”).
1B Use the 0F0B opcode (UD2 instruction) or the 0FB9H opcode when deliberately trying to generate an invalid opcode
exception (#UD).
1C Some instructions use the same two-byte opcode. If the instruction has variations, or the opcode represents
different instructions, the ModR/M byte will be used to differentiate the instruction. For the value of the ModR/M
byte needed to decode the instruction, see Table A-6.
i64 The instruction is invalid or not encodable in 64-bit mode. 40 through 4F (single-byte INC and DEC) are REX prefix
combinations when in 64-bit mode (use FE/FF Grp 4 and 5 for INC and DEC).
o64 指令仅在64位模式下可用。
d64 在64位模式下,指令默认为64位操作数大小,不能编码32位操作数大小。  可以通过66前缀编码来强转;
f64  在64位模式下,操作数大小强制为64位操作数大小(更改操作数大小的前缀为在64位模式下忽略此指令)。
v  VEX形式只存在。没有遗留的SSE形式的指令。对于整数GPR指令,它的意思是VEX需要前缀。
v1 VEX128 & SSE forms only exist (no VEX256), when can’t be inferred from the data size.

 

原文地址:https://www.cnblogs.com/hanhandaren/p/11158527.html