mirror of
https://github.com/MadMin3r/UnconfuserEx
synced 2026-06-23 09:25:19 +00:00
35 lines
739 B
C#
35 lines
739 B
C#
using SharpDisasm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace X86Emulator.Instructions
|
|
{
|
|
internal class Push : Instruction
|
|
{
|
|
private Operand Operand;
|
|
|
|
public Push(Operand operand)
|
|
{
|
|
Operand = operand;
|
|
}
|
|
|
|
public override void Emulate(Stack<int> stack, Registers registers)
|
|
{
|
|
int val;
|
|
if (Operand.Type == SharpDisasm.Udis86.ud_type.UD_OP_REG)
|
|
{
|
|
val = registers.GetValue(Operand.Base);
|
|
}
|
|
else
|
|
{
|
|
val = Operand.LvalSDWord;
|
|
}
|
|
|
|
stack.Push(val);
|
|
}
|
|
}
|
|
}
|