Beispiel #1
0
        public void BeginCodeFrame(hCode code)
        {
            var codeFrame = new hCodeFrame();

            codeFrame.ModuleScope = CurrentModuleScope;
            codeFrame.Code        = Code;
            codeFrame.Stack       = Stack;

            CurrentModuleScope = code.GetModule();
            Code = code;

            Stack = new hStack(code.UnkStackSize1, code.UnkStackSize2);
            BeginFrame(codeFrame);
        }
Beispiel #2
0
        public void LoadCode(string file)
        {
            using var fs = new FileStream(file, FileMode.Open);
            using var br = new BinaryReader(fs);

            /* for (int i = 0; i < 7; i++)
             *  magic[i] = file.cget(); */
            var magic = br.ReadChars(7);

            br.ReadChar(); // file.cget();

            // strncmp
            bool isValidHeader = magic.AsSpan().SequenceEqual("ADCH007");

            if (isValidHeader)
            {
                int   version = int.Parse(magic.AsSpan(4)); // strtol
                hCode code    = new hCode();
            }
        }