コード例 #1
0
ファイル: Callibration.cs プロジェクト: WildGenie/uoaioldsvn
        public static void Callibrate(ProcessHandler clientprocess)
        {
            uint           entrypoint;
            Stack <string> errstack = new Stack <string>();
            asmInstruction curinsn  = null;
            asmChunk       curchunk = null;

            entrypoint = clientprocess.MainModule.EntryPointAddress;

            if ((entrypoint == 0) || (entrypoint == 0xFFFFFFFF))
            {
                throw new Exception("Failed to obtain entrypoint address!");
            }

            clientprocess.Position = (long)entrypoint;

            if (System.IO.File.Exists("Callibrations.xml"))
            {
                CallibrationFile.Load("Callibrations.xml");
            }
            else//fall back to the embedded callibrations
            {
                CallibrationFile.Load(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("UOAIBasic.Callibrations.xml"));
            }

            if (!ActionList.actionlists["ActionList1"].ExecuteActionList(clientprocess, Callibrations, ref curchunk, ref curinsn, errstack))
            {
                throw BuildCallibrationException(errstack);
            }
        }
コード例 #2
0
        public static CallibrationFile Load(Stream fromstream)
        {
            CallibrationFile toreturn = null;
            SoapFormatter    sf       = new SoapFormatter();

            toreturn = (CallibrationFile)sf.Deserialize(fromstream);
            return(toreturn);
        }
コード例 #3
0
        public static CallibrationFile Load(string path)
        {
            CallibrationFile toreturn = null;

            if (File.Exists(path))
            {
                FileStream    fs = File.OpenRead(path);
                SoapFormatter sf = new SoapFormatter();
                toreturn = (CallibrationFile)sf.Deserialize(fs);
                fs.Close();
            }
            return(toreturn);
        }