23477ccb5f
x86 cflow and x86 constant decryption Backport of LINQ (LinqBridge) Shift left/right emulation fixes in de4dot core Block class extended to hold additional information
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using de4dot.Bea;
|
|
|
|
namespace ConfuserDeobfuscator.Engine.Routines.Ex.x86.Instructions
|
|
{
|
|
class X86ADD : X86Instruction
|
|
{
|
|
public X86ADD(Disasm rawInstruction) : base()
|
|
{
|
|
Operands = new IX86Operand[2];
|
|
Operands[0] = GetOperand(rawInstruction.Argument1);
|
|
Operands[1] = GetOperand(rawInstruction.Argument2);
|
|
}
|
|
|
|
public override X86OpCode OpCode { get { return X86OpCode.ADD; } }
|
|
|
|
public override void Execute(Dictionary<string, int> registers, Stack<int> localStack)
|
|
{
|
|
if (Operands[1] is X86ImmediateOperand)
|
|
registers[((X86RegisterOperand) Operands[0]).Register.ToString()] +=
|
|
((X86ImmediateOperand) Operands[1]).Immediate;
|
|
else
|
|
registers[((X86RegisterOperand) Operands[0]).Register.ToString()] +=
|
|
registers[((X86RegisterOperand) Operands[1]).Register.ToString()];
|
|
}
|
|
}
|
|
}
|