public OutputPanel ClearAllDefaultOutputs() { ConsoleOutput.Clear(); BuildOutput.Clear(); DebugOutput.Clear(); return(this); }
public void AddLevel(ME3Package pcc) { try { Levelfile l = new Levelfile(); l.path = pcc.FileName; l.pcc = pcc; IReadOnlyList <IExportEntry> Exports = l.pcc.Exports; for (int i = 0; i < Exports.Count; i++) { IExportEntry e = Exports[i]; if (e.ClassName == "Level") { DebugOutput.Clear(); l.level = new Level(l.pcc, i); TreeNode t = new TreeNode(Path.GetFileName(pcc.FileName)); t.Nodes.Add(l.level.ToTree(i)); GlobalTree.Visible = false; GlobalTree.Nodes.Add(t); GlobalTree.Visible = true; //DirectXGlobal.Cam.dir = new Vector3(1.0f, 1.0f, 1.0f); Levels.Add(l); } } } catch (Exception ex) { MessageBox.Show("Error:\n" + ex.Message); } }
private void warrantyVoiderMethodToolStripMenuItem_Click(object sender, EventArgs e) { FolderBrowserDialog d = new FolderBrowserDialog(); if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string folder = d.SelectedPath + "\\"; string loc = Path.GetDirectoryName(Application.ExecutablePath); string template = System.IO.File.ReadAllText(loc + "\\exec\\template.code"); DebugOutput.Clear(); DebugOutput.PrintLn("Generating SDK into folder: " + folder); foreach (ClassDef c in Classes) { if (c.props.Count > 1 && !c.name.StartsWith("Default_")) { string file = folder + c.name + ".cs"; DebugOutput.PrintLn(".\\" + c.name + ".cs generated..."); FileStream fs = new FileStream(file, FileMode.Create, FileAccess.Write); string tmp = template; tmp = tmp.Replace("**CLASSNAME**", c.name); tmp = GenerateProps(tmp, c); tmp = GenerateLoadSwitch(tmp, c); tmp = GenerateTree(tmp, c); for (int i = 0; i < tmp.Length; i++) { fs.WriteByte((byte)tmp[i]); } fs.Close(); } } MessageBox.Show("Done."); } }
public void AddLevel(string path) { if (!File.Exists(path)) { return; } Levelfile l = new Levelfile(); l.path = path; l.pcc = new PCCObject(path); for (int i = 0; i < l.pcc.Exports.Count; i++) { PCCObject.ExportEntry e = l.pcc.Exports[i]; if (e.ClassName == "Level") { DebugOutput.Clear(); l.level = new Level(l.pcc, i); TreeNode t = new TreeNode(Path.GetFileName(path)); t.Nodes.Add(l.level.ToTree(i)); GlobalTree.Visible = false; GlobalTree.Nodes.Add(t); GlobalTree.Visible = true; DirectXGlobal.Cam.dir = new Vector3(1.0f, 1.0f, 1.0f); Levels.Add(l); } } }
public void CreateDataBase() { if (String.IsNullOrEmpty(ME3Directory.cookedPath)) { MessageBox.Show("This functionality requires ME3 to be installed. Set its path at:\n Options > Set Custom Path > Mass Effect 3"); return; } FileStream fs = new FileStream(DataBaseFile, FileMode.Create, FileAccess.Write); string pathcook = ME3Directory.cookedPath; DebugOutput.Clear(); DebugOutput.PrintLn("Levelbase.cs: Loading files from :" + pathcook); string[] files = Directory.GetFiles(pathcook, "*.pcc"); for (int i = 0; i < files.Length; i++) { string file = files[i]; DebugOutput.PrintLn(i + "/" + (files.Length - 1) + " Scanning : " + Path.GetFileName(file)); PCCObject pcc = new PCCObject(file); for (int j = 0; j < pcc.Exports.Count(); j++) { PCCObject.ExportEntry e = pcc.Exports[j]; if (e.ClassName == "Level") { Level l = new Level(pcc, j, true); DBEntry entry = new DBEntry(); entry.filepath = file; entry.index = j; entry.count = l.Objects.Count(); database.Add(entry); //foreach(int idx in l.Objects) // if (pcc.isExport(idx) && pcc.Exports[idx].ClassName == "BioPlaypenVolumeAdditive") // DebugOutput.PrintLn("#############################found"); DebugOutput.PrintLn("\tfound Level with " + entry.count + " Objects"); } } } database.Sort((a, b) => a.filepath.CompareTo(b.filepath)); BitConverter.IsLittleEndian = true; byte[] buff = BitConverter.GetBytes(database.Count()); fs.Write(buff, 0, 4); foreach (DBEntry e in database) { buff = BitConverter.GetBytes(e.index); fs.Write(buff, 0, 4); buff = BitConverter.GetBytes(e.count); fs.Write(buff, 0, 4); buff = BitConverter.GetBytes(e.filepath.Length); fs.Write(buff, 0, 4); foreach (char c in e.filepath) { fs.WriteByte((byte)c); } } fs.Close(); }
/// <summary> /// Gets the log details through the webclient. /// </summary> /// <param name="selectedLogFile">The selected log file.</param> /// <author>Jurie.smit</author> /// <date>2013/05/24</date> private void GetLogDetails(FilePath selectedLogFile) { DebugOutput.Clear(); try { var debugStates = _debugProvider.GetDebugStates(SelectedServer.Connection.WebServerUri.AbsoluteUri, LogDirectory, selectedLogFile); debugStates.ToList().ForEach(s => DebugOutput.Append(s)); } catch (Exception exception) { ShowError(exception); } }
private void HandleTextboxRightClick(object sender, MouseButtonEventArgs e) { const string fn = "JavascriptDebugWindow.HandleTextboxRightClick()"; try { // should do this with a right click menu item, but need time to figure out how to do that in WPF DebugOutput.Clear(); DebugOutputTextBox.Text = DebugOutput.ToString(); } catch (Exception ex) { LogHelper.LogMessage(LogLevel.Error, "Exception clearing log output", ex); } }
private void checkAndRebuildSFARToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog d = new OpenFileDialog(); d.Filter = "*.sfar|*.sfar"; if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { BitConverter.IsLittleEndian = true; DebugOutput.Clear(); DLC = new DLCPackage(d.FileName); DLC.UpdateTOCbin(true); DebugOutput.PrintLn("Done."); MessageBox.Show("Done."); } }
/// <summary> /// Deletes the specified file path by sending a message to web client. /// </summary> /// <param name="filePath">The file path.</param> /// <author>Jurie.smit</author> /// <date>2013/05/24</date> public void Delete(FilePath filePath) { var address = String.Format(SelectedServer.Connection.WebServerUri + "{0}/{1}?Directory={2}&FilePath={3}", "Services", "DeleteLogService", LogDirectory.PathToSerialize, filePath.Title); var response = WebClient.UploadString(address, string.Empty); if (response.Contains("Success")) { LogFiles.Remove(filePath); DebugOutput.Clear(); } else { ShowError(response); } }
private void ParseButton_OnClick(object sender, RoutedEventArgs e) { Output.Clear(); DebugOutput.Clear(); CleanUpMemory(); #if ZatvorkyPreFakty if (!CheckMemory()) { return; } #endif if (!ParseRules()) { return; } _worker.RunWorkerAsync(); }
private void warrantyVoiderMethodToolStripMenuItem_Click(object sender, EventArgs e) { CommonOpenFileDialog d = new CommonOpenFileDialog(); d.IsFolderPicker = true; d.EnsurePathExists = true; d.Title = "Select Folder to Output to"; if (d.ShowDialog() == CommonFileDialogResult.Ok) { string folder = d.FileName; string loc = Path.GetDirectoryName(Application.ExecutablePath); string template = File.ReadAllText(loc + "\\exec\\template.code"); DebugOutput.Clear(); DebugOutput.PrintLn("Generating SDK into folder: " + folder); foreach (ClassDef c in Classes) { if (c.props.Count > 1 && !c.name.StartsWith("Default_")) { string file = Path.Combine(folder, c.name + ".cs"); DebugOutput.PrintLn(".\\" + c.name + ".cs generated..."); FileStream fs = new FileStream(file, FileMode.Create, FileAccess.Write); string tmp = template; tmp = tmp.Replace("**CLASSNAME**", c.name); tmp = GenerateProps(tmp, c); tmp = GenerateLoadSwitch(tmp, c); tmp = GenerateTree(tmp, c); for (int i = 0; i < tmp.Length; i++) { fs.WriteByte((byte)tmp[i]); } fs.Close(); } } MessageBox.Show("Done."); } }
private void DebugClearButton_Click(object sender, EventArgs e) { DebugOutput.Clear(); }
private void Clear_Click(object sender, EventArgs e) { DebugOutput.Clear(); total = 1; }
private void startScanToolStripMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(ME3Directory.cookedPath)) { MessageBox.Show("This functionality requires ME3 to be installed. Set its path at:\n Options > Set Custom Path > Mass Effect 3"); return; } string path = ME3Directory.cookedPath; string[] files = Directory.GetFiles(path, "*.pcc"); pb1.Maximum = files.Length; DebugOutput.Clear(); Classes = new List <ClassDef>(); for (int i = 0; i < files.Length; i++) { string file = files[i]; DebugOutput.PrintLn(i.ToString("d4") + "\\" + (files.Length - 1) + " : Loading file \"" + file + "\""); try { using (ME3Package pcc = MEPackageHandler.OpenME3Package(file)) { IReadOnlyList <IExportEntry> Exports = pcc.Exports; pb2.Maximum = Exports.Count(); { pb1.Value = i; RefreshLists(); Application.DoEvents(); } for (int j = 0; j < Exports.Count(); j++) { if (j % 100 == 0)//refresh { pb1.Value = i; pb2.Value = j; Application.DoEvents(); } int f = -1; for (int k = 0; k < Classes.Count(); k++) { if (Classes[k].name == Exports[j].ClassName) { f = k; break; } } if (f == -1)//New Class found, add { ClassDef tmp = new ClassDef(); tmp.name = Exports[j].ClassName; tmp.props = new List <PropDef>(); Classes.Add(tmp); f = Classes.Count() - 1; UpdateStatus(); } List <PropertyReader.Property> props = PropertyReader.getPropList(Exports[j]); ClassDef res = Classes[f]; foreach (PropertyReader.Property p in props) { int f2 = -1; string name = pcc.getNameEntry(p.Name); for (int k = 0; k < res.props.Count(); k++) { if (res.props[k].name == name) { f2 = k; break; } } if (f2 == -1) //found new prop { PropDef ptmp = new PropDef(); ptmp.name = name; ptmp.type = (int)p.TypeVal; ptmp.ffpath = Path.GetFileName(file); ptmp.ffidx = j; res.props.Add(ptmp); //DebugOutput.PrintLn("\tin object #" // + j // + " class \"" // + pcc.Exports[j].ClassName // + "\" found property \"" // + name // + "\" type " // + PropertyTypeToString(ptmp.type)); } } } } } catch (Exception ex) { MessageBox.Show("Error:\n" + ex.Message); DebugOutput.PrintLn("Could not open file: " + file); } } Sort(); RefreshLists(); UpdateStatus(); MessageBox.Show("Done."); }
private void ExecuteCommand(string command) { if (string.IsNullOrWhiteSpace(command)) { command = _lastCommand; } string[] tokens = command.Trim().Split(' '); if (tokens.Length == 0) { // Nothing to do return; } switch (tokens[0].ToLowerInvariant()) { case ".": // redisplay status DisplayCurrentCode(); PrintIOPStatus(); PrintCPStatus(); break; case "i": // single step IOP StartExecution(true, false, false); StopExecution(); // wait for exec to finish DisplayCurrentCode(); PrintIOPStatus(); break; case "s": // single step CP _stepCount = 0; StartExecution(false, true, false); StopExecution(); // wait for exec to finish DisplayCurrentCode(); PrintCPStatus(); break; case "m": // single step Mesa macrocode StartExecution(false, false, true); StopExecution(); // wait for exec to finish DisplayCurrentCode(); PrintMesaStatus(); break; case "g": // run system StartExecution(false, false, false /* normal execution */); break; case "r": // reset system _system.Reset(); WriteLine("System reset."); break; case "tpc": // print TPC registers DisplayTPCRegisters(); break; case "task": // select Task to debug (skips over microcode execution for other tasks while single-stepping) switch (tokens.Length) { case 2: if (tokens[1].ToLowerInvariant() != "all") { // Step through a specific task only. _debugTask = (TaskType)Enum.Parse(typeof(TaskType), tokens[1], true); _debugSpecificTask = true; } else { // Step through all tasks _debugSpecificTask = false; } break; default: WriteLine("task <task type>"); break; } break; case "id": // dump IOP memory switch (tokens.Length) { case 2: DumpMemory(Convert.ToUInt16(tokens[1], 16), 1, null); break; case 3: DumpMemory(Convert.ToUInt16(tokens[1], 16), Convert.ToUInt16(tokens[2], 16), null); break; case 4: DumpMemory(Convert.ToUInt16(tokens[1], 16), Convert.ToUInt16(tokens[2], 16), tokens[3]); break; default: WriteLine("id <address> [count] [file]"); break; } break; case "cd": // dump CP memory switch (tokens.Length) { case 2: DumpCPMemory(Convert.ToUInt32(tokens[1], 16), 1, null); break; case 3: DumpCPMemory(Convert.ToUInt32(tokens[1], 16), Convert.ToUInt16(tokens[2], 16), null); break; case 4: DumpCPMemory(Convert.ToUInt32(tokens[1], 16), Convert.ToUInt16(tokens[2], 16), tokens[3]); break; default: WriteLine("cd <address> [count] [file]"); break; } break; case "fd": // dump floppy sector switch (tokens.Length) { case 4: DumpFloppySector(Convert.ToUInt16(tokens[1], 10), Convert.ToUInt16(tokens[2], 10), Convert.ToUInt16(tokens[3], 10), null); break; case 5: DumpFloppySector(Convert.ToUInt16(tokens[1], 10), Convert.ToUInt16(tokens[2], 10), Convert.ToUInt16(tokens[3], 10), tokens[4]); break; default: WriteLine("id <track> <head> <sector> [file]"); break; } break; case "u": // dump U register switch (tokens.Length) { case 2: DumpURegister(Convert.ToUInt16(tokens[1], 16)); break; default: WriteLine("u <register>"); break; } break; case "mapv": // Map virtual address to physical switch (tokens.Length) { case 2: TranslateVirtualAddress(Convert.ToInt32(tokens[1], 16)); break; default: WriteLine("mapv <vaddress>"); break; } break; case "mapp": // Map physical address to virtual switch (tokens.Length) { case 2: TranslatePhysicalAddress(Convert.ToInt32(tokens[1], 16)); break; default: WriteLine("mapp <paddress>"); break; } break; case "mapd": // Dump map entry switch (tokens.Length) { case 2: DumpMapEntry(Convert.ToInt32(tokens[1], 16)); break; default: WriteLine("mapd <map address>"); break; } break; case "mbs": // Set Mesa breakpoint switch (tokens.Length) { case 2: SetMesaBreakpoint(Convert.ToInt32(tokens[1], 16)); break; default: WriteLine("mbs <mesa instruction address>"); break; } break; case "mbc": // Clear Mesa breakpoint switch (tokens.Length) { case 2: ClearMesaBreakpoint(Convert.ToInt32(tokens[1], 16)); break; default: WriteLine("mbs <mesa instruction address>"); break; } break; case "da": // analyze disk AnalyzeDisk(); break; case "dt": // he can do stupid things switch (tokens.Length) { case 3: DumpTrack(Convert.ToInt32(tokens[1], 10), Convert.ToInt32(tokens[2], 10)); break; default: WriteLine("dt <cylinder> <head>"); break; } break; case "save": // commit source annotations _iopDebugger.Save(); _cpDebugger.Save(); WriteLine("Source annotations saved."); break; case "clear": DebugOutput.Clear(); break; case "?": case "help": DisplayHelp(); break; default: WriteLine("?"); // for DMR break; } _lastCommand = command; }
public void LetsDump2(string classname) { if (string.IsNullOrEmpty(ME3Directory.cookedPath)) { MessageBox.Show("This functionality requires ME3 to be installed. Set its path at:\n Options > Set Custom Path > Mass Effect 3"); return; } string path = ME3Directory.cookedPath; string[] files = Directory.GetFiles(path, "*.pcc"); pb1.Minimum = 0; rtb1.Text = ""; pauseToolStripMenuItem.Visible = true; pb2.Value = 0; pb2.Maximum = files.Length; List <string> Names = new List <string>(); List <string> Types = new List <string>(); List <string> First = new List <string>(); DebugOutput.Clear(); for (int i = 0; i < files.Length; i++) { try { while (pause) { Application.DoEvents(); } using (ME3Package pcc = MEPackageHandler.OpenME3Package(files[i])) { DebugOutput.PrintLn(i + "/" + files.Length + " Scanning file : " + Path.GetFileName(files[i])); IReadOnlyList <IExportEntry> Exports = pcc.Exports; pb1.Maximum = Exports.Count; pb2.Value = i; for (int j = 0; j < Exports.Count; j++) { IExportEntry ent = Exports[j]; if (ent.ClassName == classname) { List <PropertyReader.Property> p = PropertyReader.getPropList(ent); for (int k = 0; k < p.Count; k++) { PropertyReader.Property prop = p[k]; int found = -1; for (int l = 0; l < Names.Count(); l++) { if (pcc.getNameEntry(prop.Name) == Names[l]) { found = l; } } if (found == -1) { Names.Add(pcc.getNameEntry(prop.Name)); Types.Add(PropertyReader.TypeToString((int)prop.TypeVal)); First.Add(Path.GetFileName(files[i]) + " #" + j); } } } if (j % 500 == 0) { pb1.Value = j; Status.Text = "State : " + j + " / " + Exports.Count; string s = "Possible properties found so far for class \"" + classname + "\":\n"; for (int k = 0; k < Names.Count(); k++) { s += Types[k] + " : \"" + Names[k] + "\" first found: " + First[k] + "\n"; } Action action = () => rtb1.Text = s; rtb1.Invoke(action); action = () => rtb1.SelectionStart = s.Length; rtb1.Invoke(action); action = () => rtb1.ScrollToCaret(); rtb1.Invoke(action); Application.DoEvents(); } } } } catch (Exception ex) { MessageBox.Show("Error:\n" + ex.Message); DebugOutput.PrintLn("Could not open file : " + Path.GetFileName(files[i])); } } Status.Text = "State : Done"; string t = "Possible properties found for class \"" + classname + "\":\n"; for (int k = 0; k < Names.Count(); k++) { t += Types[k] + " : \"" + Names[k] + "\" first found: " + First[k] + "\n"; } rtb1.Text = t; rtb1.SelectionStart = rtb1.TextLength; rtb1.ScrollToCaret(); pb1.Value = 0; pauseToolStripMenuItem.Visible = false; }
public void DebugClear() { DebugOutput.Clear(); }
private void startScanToolStripMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(ME3Directory.cookedPath)) { MessageBox.Show("This functionality requires ME3 to be installed. Set its path at:\n Options > Set Custom Path > Mass Effect 3"); return; } string path = ME3Directory.cookedPath; string[] files = Directory.GetFiles(path, "*.pcc"); pb1.Maximum = files.Length; DebugOutput.Clear(); database = new List <DBEntry>(); int count = 0; foreach (string file in files) { pb1.Value = count++; DebugOutput.PrintLn("Scanning file : " + Path.GetFileName(file) + " ..."); try { using (ME3Package pcc = MEPackageHandler.OpenME3Package(file)) { DBEntry ent = new DBEntry(); ent.filename = Path.GetFileName(file); ent.Objects = new List <ObjInf>(); IReadOnlyList <IExportEntry> Exports = pcc.Exports; for (int i = 0; i < Exports.Count; i++) { IExportEntry ex = Exports[i]; ObjInf obj; switch (ex.ClassName) { case "StaticMesh": obj = new ObjInf(); obj.Index = i; obj.Type = 0; obj.name = ex.ObjectName; ent.Objects.Add(obj); break; case "SkeletalMesh": obj = new ObjInf(); obj.Index = i; obj.Type = 1; obj.name = ex.ObjectName; ent.Objects.Add(obj); break; } } if (ent.Objects.Count != 0) { DebugOutput.PrintLn("Found " + ent.Objects.Count + " Objects:", false); //foreach (ObjInf o in ent.Objects) // DebugOutput.PrintLn("\t" + o.Index + " : " + o.name + " (" + TypeToString(o.Type) + ")", false); //DebugOutput.Update(); database.Add(ent); } else { DebugOutput.PrintLn("Nothing...", false); } } } catch (Exception ex) { MessageBox.Show("Error:\n" + ex.Message); DebugOutput.PrintLn("Could not open file : " + Path.GetFileName(file)); } } RefreshLists(); pb1.Value = 0; }