public void Setup() { form = new Form(); form.Size = new Size(300, 200); memctl = new MemoryControl(); memctl.Dock = DockStyle.Fill; form.Controls.Add(memctl); }
public void Setup() { sc = new ServiceContainer(); form = new Form(); form.Size = new Size(300, 200); memctl = new MemoryControl(); memctl.Dock = DockStyle.Fill; form.Controls.Add(memctl); memctl.Services = sc; }
Control DumpBytes() { var mem = new MemoryControl(); mem.Services = services; mem.ProgramImage = new Reko.Core.LoadedImage(Address.Ptr32(0), resource.Bytes); mem.ImageMap = mem.ProgramImage.CreateImageMap(); mem.Architecture = program.Architecture; mem.Font = new Font("Lucida Console", 10F); //$TODO: use user preference return(mem); }
Control DumpBytes() { var mem = new Reko.Core.MemoryArea(Address.Ptr32(0), resource.Bytes); var memCtrl = new MemoryControl(); memCtrl.Services = services; memCtrl.SegmentMap = new SegmentMap( mem.BaseAddress, new ImageSegment("resource", mem, AccessMode.Read)); memCtrl.Architecture = program.Architecture; memCtrl.Font = new Font("Lucida Console", 10F); //$TODO: use user preference return(memCtrl); }
//private void WorkThreadFunction() //{ // while (station != null && station.Exec()) // System.Threading.Thread.Sleep(10); //} private void Awake() { GizmoSDK.GizmoBase.Platform.Initialize(); Message.OnMessage += Message_OnMessage; #if SHOW_MEMORY // Set to tru to enable memory tracing. Heavy load MemoryControl.DebugMem(true); // Enable trace of allocated memory #endif #if UNITY_ANDROID GizmoSDK.GizmoBase.Monitor.InstallMonitor("udp::45454?nic=${wlan0}"); #else GizmoSDK.GizmoBase.Monitor.InstallMonitor(); #endif //UNITY_ANDROID Message.SetMessageLevel(MessageLevel.PERF_DEBUG); // Initialize application ragistry KeyDatabase.SetDefaultRegistry($"/data/data/{Application.identifier}/files/gizmosdk.reg"); // Set local xml config KeyDatabase.SetLocalRegistry("config.xml"); // Enable multicast state listener EnableMulticastState(); #region -------- Test Related stuff in init -------------------- //SetupJavaBindings(); //test(); #endregion // Set up scene manager camera SceneManager scenemanager = GetComponent <SceneManager>(); CameraControl cameracontrol = GetComponent <CameraControl>(); scenemanager.SceneManagerCamera = cameracontrol; }
private void Update() { counter++; if (counter % 30 == 0) { //System.GC.Collect(); //System.GC.WaitForPendingFinalizers(); GizmoSDK.GizmoBase.Monitor.AddValue("mem", MemoryControl.GetAllocMem()); GizmoSDK.GizmoBase.Monitor.AddValue("internal", MemoryControl.GetAllocMem(0, 0, false, true)); GizmoSDK.GizmoBase.Monitor.AddValue("dyn", MemoryControl.GetAllocMem(66666)); } if (counter % 1000 == 0) { Performance.DumpPerformanceInfo(); } }
public static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += (sender, exceptionArgs) => { var errorText = "Program exited with message:\n " + exceptionArgs.ExceptionObject; File.AppendAllText("Error.log", $"{DateTime.Now.ToString("g")} {errorText}\r\n{new string('-', 30)}\r\n"); MessageBox.Show(errorText); Environment.Exit(1); }; #if !DEBUG MemoryControl.Start(); if (Scrambler.Scramble(args.Length > 0 ? args[0] : null)) { return; } #endif Offsets offs; int pid = FindPoeProcess(out offs); if (pid == 0) { MessageBox.Show("Path of Exile is not running!"); return; } Sounds.LoadSounds(); using (var memory = new Memory(offs, pid)) { offs.DoPatternScans(memory); var gameController = new GameController(memory); gameController.RefreshState(); var overlay = new ExternalOverlay(gameController, memory.IsInvalid); Application.Run(overlay); } }
public PreviewImagePage() { _folderViewModel = NavigateService.GetNavigationData <FolderViewModel>(); _previewImageViewModel = new PreviewImageViewModel(SdkService.MegaSdk, App.AppInformation, _folderViewModel); this.DataContext = _previewImageViewModel; InitializeComponent(); SetApplicationBar((_folderViewModel == null) ? false : true); if (AppService.IsLowMemoryDevice()) { SlideViewAndFilmStrip.ItemRealizationMode = SlideViewItemRealizationMode.ViewportItem; } if (!DebugService.DebugSettings.IsDebugMode || !DebugService.DebugSettings.ShowMemoryInformation) { return; } MemoryControl.Visibility = Visibility.Visible; MemoryControl.StartMemoryCounter(); }
public static void Main(string[] args) { AppDomain.CurrentDomain.UnhandledException += (sender, exceptionArgs) => { var errorText = "Program exited with message:\n " + exceptionArgs.ExceptionObject; File.AppendAllText("Error.log", $"{DateTime.Now.ToString("g")} {errorText}\r\n{new string('-', 30)}\r\n"); MessageBox.Show(errorText); Environment.Exit(1); }; #region DEBUG #if !DEBUG MemoryControl.Start(); if (Scrambler.Scramble(args.Length > 0 ? args[0] : null)) { return; } #endif #endregion Offsets offs; int pid = FindPoeProcess(out offs); if (pid == 0) { MessageBox.Show("Path of Exile is not running or you started x32 POE (DirectX9) with x64 PoeHUD or vice verse."); return; } Sounds.LoadSounds(); using (var memory = new Memory(offs, pid)) { offs.DoPatternScans(memory); var gameController = new GameController(memory); #region DEBUG #if DEBUG StringBuilder sb = new StringBuilder(); sb.Append("AddressOfProcess: " + memory.AddressOfProcess.ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("GameController: " + (offs.Base + memory.AddressOfProcess).ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("GameState: " + (offs.GameStateOffset + memory.AddressOfProcess).ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("TheGame: " + gameController.Game.Address.ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("IngameState: " + gameController.Game.IngameState.Address.ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("IngameData: " + gameController.Game.IngameState.Data.Address.ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("IngameUi: " + gameController.Game.IngameState.IngameUi.Address.ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("InventoryPanel: " + gameController.Game.IngameState.IngameUi.InventoryPanel.Address.ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("UIRoot: " + gameController.Game.IngameState.UIRoot.Address.ToString("X")); sb.Append(System.Environment.NewLine); sb.Append("ServerData: " + gameController.Game.IngameState.ServerData.Address.ToString("X")); sb.Append(System.Environment.NewLine); sb.Append(System.Environment.NewLine); sb.Append(memory.DebugStr); File.WriteAllText("__BaseOffsets.txt", sb.ToString()); #endif #endregion var overlay = new ExternalOverlay(gameController, memory.IsInvalid); Application.Run(overlay); } Process.GetCurrentProcess().Kill(); }
private void Update() { double time = GizmoSDK.GizmoBase.Time.SystemSeconds; if (_frameTime > 0) { _frameDurationTime = 0.999 * _frameDurationTime + 0.001 * (time - _frameTime); } _frameTime = time; try { Performance.Enter("Initializer.Update"); // Example of getting performance graphical output #if SHOW_TRACERS if (_counter == 10) { tracer = new PerformanceTracer(); tracer.AddAll(); tracer.Run(); } #endif // SHOW_TRACERS _counter++; // Exemple of getting allocate dmemory in native parts #if SHOW_MEMORY if (_counter % 30 == 0) { //System.GC.Collect(); //System.GC.WaitForPendingFinalizers(); GizmoSDK.GizmoBase.Monitor.AddValue("mem", MemoryControl.GetAllocMem()); GizmoSDK.GizmoBase.Monitor.AddValue("internal", MemoryControl.GetAllocMem(0, 0, false, true)); GizmoSDK.GizmoBase.Monitor.AddValue("dyn", MemoryControl.GetAllocMem(66666)); GizmoSDK.GizmoBase.Monitor.AddValue("tex", Image.GetRegisteredImageData()); } #endif //SHOW_MEMORY #if SHOW_FPS if (_counter % 30 == 0) { GizmoSDK.GizmoBase.Monitor.AddValue("fps", 1 / _frameDurationTime); } #endif //SHOW_FPS } finally { Performance.Leave(); } }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); MemoryControl.StopMemoryCounter(); }
private void Awake() { Instance = this; }
public static void Main(string[] args) { #if !DEBUG MemoryControl.Start(); #endif FileStream fs = new FileStream("csum", FileMode.OpenOrCreate); fs.Close(); string HUDLOC = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; string lastCsums = System.IO.File.ReadAllText("csum"); int lastCsum = string.IsNullOrEmpty(lastCsums) ? 0 : int.Parse(lastCsums); #if !DEBUG // impossible to Run in debugger with Namecheck and Stuff if (System.AppDomain.CurrentDomain.FriendlyName == "PoeHUD.exe" || System.AppDomain.CurrentDomain.FriendlyName == "ExileHUD.exe" || System.AppDomain.CurrentDomain.FriendlyName == "ExileBuddy.exe") { MessageBox.Show("Please rename the HUD for your safety."); return; } if (HashCheck.GetCSum(HUDLOC) == 0 | HashCheck.GetCSum(HUDLOC) == lastCsum) { MessageBox.Show("Running the Scrambler for your safety. LastCsum = " + lastCsums); System.IO.StreamWriter store = new System.IO.StreamWriter("csum"); store.WriteLine(HashCheck.GetCSum(HUDLOC)); store.Close(); if (!File.Exists("config/scrambler.txt") || (new FileInfo("config/scrambler.txt").Length == 0)) { FileStream Ccreator = new FileStream("config/scrambler.txt", FileMode.OpenOrCreate); Ccreator.Close(); } System.IO.StreamWriter Cwriter = new System.IO.StreamWriter("config/scrambler.txt"); Cwriter.WriteLine(System.AppDomain.CurrentDomain.FriendlyName); Cwriter.Close(); System.Diagnostics.Process.Start("Scrambler.exe", "fromHUD"); return; } else { System.IO.StreamWriter store = new System.IO.StreamWriter("csum"); store.WriteLine(HashCheck.GetCSum(HUDLOC)); store.Close(); } #endif Offsets offs; int pid = FindPoeProcess(out offs); if (pid == 0) { MessageBox.Show("Path of Exile is not running!"); return; } Sounds.LoadSounds(); AppDomain.CurrentDomain.UnhandledException += (sender, exceptionArgs) => { MessageBox.Show("Program exited with message:\n " + exceptionArgs.ExceptionObject.ToString()); Environment.Exit(1); }; using (Memory memory = new Memory(offs, pid)) { offs.DoPatternScans(memory); GameController gameController = new GameController(memory); gameController.RefreshState(); Func <bool> gameEnded = () => memory.IsInvalid(); var overlay = new ExternalOverlay(gameController, gameEnded); Application.Run(overlay); } }