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); } }
public static CallibrationFile Load(Stream fromstream) { CallibrationFile toreturn = null; SoapFormatter sf = new SoapFormatter(); toreturn = (CallibrationFile)sf.Deserialize(fromstream); return(toreturn); }
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); }