Reg � Register (i.e. EAX, EBX) Mem � Memory address (i.e. [EAX]) r/m � Register or Memory imm � Immediate Value (i.e. OP Reg, ACABh) OP = {ADC, ADD, AND, CMP, OR, SBB, SUB, XOR} OP1 = {DIV, IDIV, IMUL, MUL, NEG, NOT, TEST} OP2 = {RCL, RCR, ROL, ROR, SAL, SAR, SHL, SHR}
push [ebp+var_14] ; *outBuf (EDI) call GetSizeOfCode push eax ; sizeOfCode call SeekStartOfVirus push eax ; *inBuf (ESI) call MetaEngine cmp eax, 0 jz short EngineFailed
MetaEngine(*inBuf, sizeOfCode, *outBuf);
cmp al, 8Ah ; MOV r8, r/m8? jz short _Mutate? cmp al, 8Bh ; MOV r32, r/m32? jz short _Mutate? cmp al, 8Dh ; LEA r32, mem? jz short _Mutate?
- PUSH r/m8 - PUSH r/m32
MOV EAX, r/m PUSH EAX
- MOV reg, imm
a. MOV reg, Random ADD reg, imm-Random b. MOV reg, Random SUB reg, -(imm-Random) c. MOV reg, Random XOR reg, Random^imm
- MOV r/m, reg - MOV reg, r/m - TEST r/m, reg - LEA r32, mem - OP r/m, reg - OP reg, r/m
PUSH RandomReg MOV RandomReg, OriginalReg ADD RadnomReg, RandomImm8 OP r/m - RandomReg, OriginalReg POP RandomReg
- MOV r/m, reg - TEST r/m, reg - OP r/m, reg
PUSH RandomReg MOV RandomReg, OriginalReg OP OriginalR/M, RandomReg POP RandomReg
- MOV reg, r/m - LEA reg, mem - OP reg, r/m
PUSH RandomReg MOV RandomReg, OriginalReg OP RandomReg, OriginalR/M MOV OriginalReg, RandomReg POP RandomReg
- OP r/m8, imm8 - MOV r/m8, imm8 - TEST r/m8
PUSH RandomReg MOV RandomReg8, Imm8 OP OriginalR/M8, RandomReg8 POP RandomReg
A4
50 8A 06 83 C6 01 88 07 83 C7 01 58
MOVSB
PUSH EAX MOV AL, [ESI] ADD ESI, 1 MOV [EDI], AL ADD EDI, 1 POP EAX
A5
50 8B 06 83 C6 04 89 07 83 C7 04 58
MOVSD
PUSH EAX MOV [EAX], ESI ADD ESI, 4 MOV [EDI], EAX ADD EDI, 4 POP EAX
AA
88 07 83 C7 01
STOSB
MOV EDI, [AL] ADD EDI, 1
AB
88 07 83 C7 04
STOSD
MOV EDI, [EAX] ADD EDI, 4
AC
8A 06 83 C6 01
LODSB
MOV AL, [ESI] ADD ESI, 1
AD
8A 06 83 C6 04
LODSD
MOV EAX, [ESI] ADD ESI, 4
- MOV r32, [ebp+Random8] - MOV r32, Random32 - OP r32, Random32 ;ADC/ADD/AND/OR/SBB/SUB/XOR - MOV RandomReg8, Random8
90
NOP
Don't store
0F xx(80 > xx > 90)
Special Opcode 0FNot supported by engine
Abort Engine
CC
INT 3 (Debugger Breakpoint)
Anti Debug
81 C4
ADD ESP, imm32
Store
81 EC
SUB ESP, imm32
83 C4
ADD ESP, imm8
83 EC
C0
OP2 r/m8, imm8
D0
CD
INT
8B EC
MOV EBP, ESP
F3
REP Prefix
C3
RET
50 � 5F
PUSH r32 / POP r32
AntiDebug: cmp byte ptr [ebx+7], 0BFh ; are we in kernel mode? jnz short ret_AntiDebug mov ecx, 1000h ; counter = 1000h mov edi, 40000000h or edi, 80000000h add edi, ecx ; edi = C0001000h rep stosd ; copy bytes to [edi] ret_AntiDebug: retn ; this will result in a crash
B9 00 10 00 00 mov ecx, 1000h Transformed: B9 10 B2 00 3C mov ecx, 3C00B210h 81 C1 F0 5D FF C3 add ecx, 0C3FF5DF0h ; ecx = 1000h
8B 45 0C mov eax, [ebp+0Ch]
56 push esi 89 EE mov esi, ebp 83 C6 56 add esi, 56h 8B 46 B6 mov eax, [esi-4Ah] 5E pop esi
89 43 08 mov [ebx+8], eax
51 push ecx 8B C8 mov ecx, eax 89 4B 08 mov [ebx+8], ecx 59 pop ecx
33 C0 xor eax, eax
51 push ecx 89 C1 mov ecx, eax 33 C8 xor ecx, eax 8B C1 mov eax, ecx 59 pop ecx
80 F9 50 cmp cl, 50h
52 push edx B2 50 mov dl, 50h 38 D1 cmp cl, dl 5A pop edx
There are 31,320 total registered users.
[+] expand