예제 #1
0
파일: CPU.cs 프로젝트: SplittyDev/Imardin2
 CPU(UInt64 stackPointer = 0x1024)
 {
     Registers = new List<Register32> ();
     EAX = new Register32 (TargetRegister.eax, 0);
     EBX = new Register32 (TargetRegister.ebx, 0);
     ECX = new Register32 (TargetRegister.ecx, 0);
     EDX = new Register32 (TargetRegister.edx, 0);
     EBP = new Register32 (TargetRegister.ebp, 0);
     if (stackPointer > UInt32.MaxValue) {
         Console.WriteLine ("[ERROR] Long addresses are currently not supported.");
         Environment.Exit (0);
     }
     ESP = new Register32 (TargetRegister.esp, (uint)stackPointer);
     ESI = new Register32 (TargetRegister.esi, 0);
     EDI = new Register32 (TargetRegister.edi, 0);
     Registers.AddRange (new [] {
         EAX, EBX, ECX, EDX,
         EBP, ESP, ESI, EDI,
     });
 }
예제 #2
0
 public Register16(Register32 base_register)
 {
     Base = base_register;
     Name = string.Format ("{0}x", Base.Name.Skip (1).First ());
 }