Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            //Reset
            mbbsEmuCpuRegisters.Zero();
            mbbsEmuCpuCore.Reset();
            mbbsEmuMemoryCore.Clear();
            mbbsEmuCpuRegisters.CS = 1;
            mbbsEmuCpuRegisters.DS = 2;
            mbbsEmuCpuRegisters.IP = 0;

            var instructions = new Assembler(16);
            var label_start  = instructions.CreateLabel();
            var label_loop   = instructions.CreateLabel();

            instructions.Label(ref label_start);
            instructions.mov(__word_ptr[0], 1);
            instructions.Label(ref label_loop);
            instructions.mov(ax, __word_ptr[0]);
            instructions.cmp(ax, 0x7FFF);
            instructions.je(label_start);
            instructions.inc(__word_ptr[0]);
            instructions.jmp(label_loop);

            CreateCodeSegment(instructions);
            CreateDataSegment(new ReadOnlySpan <byte>());


            _isRunning = true;
            new Thread(RunThread).Start();
            new Thread(MonitorThread).Start();

            Console.ReadKey();
            _isRunning = false;
        }
Ejemplo n.º 2
0
        protected virtual void Reset()
        {
            mbbsEmuCpuRegisters.Zero();
            mbbsEmuCpuCore.Reset();
            mbbsEmuMemoryCore.Clear();
            mbbsEmuCpuRegisters.CS = CODE_SEGMENT;
            mbbsEmuCpuRegisters.IP = 0;

            testSessions = new PointerDictionary <SessionBase>();
            testSessions.Allocate(new TestSession(null));
            testSessions.Allocate(new TestSession(null));

            //Redeclare to re-allocate memory values that have been cleared
            majorbbs = new HostProcess.ExportedModules.Majorbbs(
                _serviceResolver.GetService <ILogger>(),
                _serviceResolver.GetService <AppSettings>(),
                _serviceResolver.GetService <IFileUtility>(),
                _serviceResolver.GetService <IGlobalCache>(),
                mbbsModule,
                testSessions,
                _serviceResolver.GetService <IAccountKeyRepository>(),
                _serviceResolver.GetService <IAccountRepository>());

            galgsbl = new HostProcess.ExportedModules.Galgsbl(
                _serviceResolver.GetService <ILogger>(),
                _serviceResolver.GetService <AppSettings>(),
                _serviceResolver.GetService <IFileUtility>(),
                _serviceResolver.GetService <IGlobalCache>(),
                mbbsModule,
                testSessions);
        }
Ejemplo n.º 3
0
 protected void Reset()
 {
     mbbsEmuCpuRegisters.Zero();
     mbbsEmuCpuCore.Reset();
     mbbsEmuMemoryCore.Clear();
     mbbsEmuCpuRegisters.CS = 1;
     mbbsEmuCpuRegisters.IP = 0;
 }
Ejemplo n.º 4
0
        protected void Reset()
        {
            mbbsEmuCpuRegisters.Zero();
            mbbsEmuCpuCore.Reset();
            mbbsEmuMemoryCore.Clear();
            mbbsEmuCpuRegisters.CS = CODE_SEGMENT;
            mbbsEmuCpuRegisters.IP = 0;

            //Redeclare to re-allocate memory values that have been cleared
            majorbbs = new HostProcess.ExportedModules.Majorbbs(mbbsModule, new PointerDictionary <Session.SessionBase>());
        }
Ejemplo n.º 5
0
        protected void Reset()
        {
            mbbsEmuCpuRegisters.Zero();
            mbbsEmuCpuCore.Reset();
            mbbsEmuMemoryCore.Clear();
            mbbsEmuCpuRegisters.CS = CODE_SEGMENT;
            mbbsEmuCpuRegisters.IP = 0;

            //Redeclare to re-allocate memory values that have been cleared
            majorbbs = new HostProcess.ExportedModules.Majorbbs(
                _serviceResolver.GetService <ILogger>(),
                _serviceResolver.GetService <IConfiguration>(),
                _serviceResolver.GetService <IFileUtility>(),
                _serviceResolver.GetService <IGlobalCache>(),
                mbbsModule,
                new PointerDictionary <Session.SessionBase>());
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            //Reset
            mbbsEmuCpuRegisters.Zero();
            mbbsEmuCpuCore.Reset();
            mbbsEmuMemoryCore.Clear();
            mbbsEmuCpuRegisters.CS = 1;
            mbbsEmuCpuRegisters.IP = 0;


            var msCodeSegment = new MemoryStream();

            //XOR AX, AX
            msCodeSegment.Write(new byte[] { 0x33, 0xC0 });
            //CMP AX, 0xF
            msCodeSegment.Write(new byte[] { 0x3D, 0xF, 0x00 });
            //JLE
            msCodeSegment.Write(new byte[] { 0x7E, 0x02 });
            //INC AX
            msCodeSegment.Write(new byte[] { 0x40 });
            //INC AX
            msCodeSegment.Write(new byte[] { 0x40 });
            //CMP AX, 0x64
            msCodeSegment.Write(new byte[] { 0x3D, 0x64, 0x00 });
            //JL
            msCodeSegment.Write(new byte[] { 0x7C, 0xF2 });

            CreateCodeSegment(msCodeSegment.ToArray());

            _isRunning = true;
            new Thread(RunThread).Start();
            new Thread(MonitorThread).Start();

            Console.ReadKey();
            _isRunning = false;
        }