├── .gitattributes ├── .gitignore ├── Documentation └── Squalr.png ├── README.md ├── Release.ps1 ├── Release.py ├── Settings.StyleCop ├── Squalr.Cli ├── CommandDispatcher.cs ├── CommandHandlers │ ├── Command.cs │ ├── Crash │ │ ├── CrashCommandHandler.cs │ │ └── CrashCommandOptions.cs │ ├── ICommandHandler.cs │ ├── Process │ │ ├── ProcessAttachOptions.cs │ │ ├── ProcessCloseOptions.cs │ │ ├── ProcessCommandHandler.cs │ │ ├── ProcessDetachOptions.cs │ │ ├── ProcessExitOptions.cs │ │ ├── ProcessListOptions.cs │ │ ├── ProcessOpenOptions.cs │ │ └── ProcessQuitOptions.cs │ ├── Project │ │ ├── ProjectAddOptions.cs │ │ ├── ProjectCommandHandler.cs │ │ ├── ProjectListOptions.cs │ │ ├── ProjectRemoveOptions.cs │ │ └── ProjectToggleOptions.cs │ ├── Projects │ │ ├── ProjectsCommandHandler.cs │ │ ├── ProjectsDeleteOptions.cs │ │ ├── ProjectsListOptions.cs │ │ ├── ProjectsNewOptions.cs │ │ └── ProjectsOpenOptions.cs │ ├── Results │ │ ├── ResultsCommandHandler.cs │ │ └── ResultsListOptions.cs │ └── Scan │ │ ├── NewScanOptions.cs │ │ ├── NextScanOptions.cs │ │ └── ScanCommandHandler.cs ├── LogListener.cs ├── PrefixedReader.cs ├── PrefixedWriter.cs ├── Program.cs ├── Properties │ └── PublishProfiles │ │ └── FolderProfile.pubxml ├── SessionManager.cs └── Squalr.Cli.csproj ├── Squalr.Engine.Architecture ├── Assembler │ ├── AssemblerFactory.cs │ ├── AssemblerResult.cs │ ├── FasmAssembler.cs │ ├── IAssembler.cs │ ├── MasmAssembler.cs │ └── NasmAssembler.cs ├── CpuArchitecture.cs ├── Disassembler │ ├── DisassemblerFactory.cs │ ├── IDisassembler.cs │ └── SharpDisassembler.cs ├── IArchitecture.cs ├── Instruction.cs ├── Library │ ├── .gitignore │ ├── fasm.exe │ ├── ml.exe │ ├── ml64.exe │ ├── nasm.exe │ └── test.asm └── Squalr.Engine.Architecture.csproj ├── Squalr.Engine.Debugger ├── CodeTraceInfo.cs ├── Debugger.cs ├── ExtensionMethods.cs ├── IDebugger.cs ├── Squalr.Engine.Debugger.csproj ├── Squalr.Engine.Debuggers.csproj └── Windows │ └── DebugEngine │ ├── DebugEngine.cs │ ├── EventCallBacks.cs │ ├── Internal │ ├── Enums.cs │ ├── IDebugAdvanced.cs │ ├── IDebugAdvanced2.cs │ ├── IDebugAdvanced3.cs │ ├── IDebugBreakpoint.cs │ ├── IDebugBreakpoint2.cs │ ├── IDebugBreakpoint3.cs │ ├── IDebugClient.cs │ ├── IDebugClient2.cs │ ├── IDebugClient3.cs │ ├── IDebugClient4.cs │ ├── IDebugClient5.cs │ ├── IDebugClient6.cs │ ├── IDebugControl.cs │ ├── IDebugControl2.cs │ ├── IDebugControl3.cs │ ├── IDebugControl4.cs │ ├── IDebugControl5.cs │ ├── IDebugControl6.cs │ ├── IDebugDataSpaces.cs │ ├── IDebugDataSpaces2.cs │ ├── IDebugDataSpaces3.cs │ ├── IDebugDataSpaces4.cs │ ├── IDebugEventCallbacks.cs │ ├── IDebugEventCallbacksWide.cs │ ├── IDebugEventContextCallbacks.cs │ ├── IDebugInputCallbacks.cs │ ├── IDebugOutputCallbacks.cs │ ├── IDebugOutputCallbacks2.cs │ ├── IDebugOutputCallbacksWide.cs │ ├── IDebugRegisters.cs │ ├── IDebugRegisters2.cs │ ├── IDebugSymbolGroup.cs │ ├── IDebugSymbolGroup2.cs │ ├── IDebugSymbols.cs │ ├── IDebugSymbols2.cs │ ├── IDebugSymbols3.cs │ ├── IDebugSymbols4.cs │ ├── IDebugSymbols5.cs │ ├── IDebugSystemObjects.cs │ ├── IDebugSystemObjects2.cs │ ├── IDebugSystemObjects3.cs │ └── Structs.cs │ └── OutputCallbacks.cs ├── Squalr.Engine.Input ├── Controller │ ├── ControllerCapture.cs │ ├── IControllerObserver.cs │ └── IControllerSubject.cs ├── Hotkeys │ ├── ControllerHotkey.cs │ ├── Hotkey.cs │ ├── HotkeyBuilder.cs │ ├── KeyboardHotkey.cs │ ├── KeyboardHotkeyBuilder.cs │ └── MouseHotkey.cs ├── IInputCapture.cs ├── IInputManager.cs ├── InputManager.cs ├── Keyboard │ ├── KeyState.cs │ └── KeyboardCapture.cs ├── Mouse │ ├── IMouseObserver.cs │ ├── IMouseSubject.cs │ └── MouseCapture.cs └── Squalr.Engine.Input.csproj ├── Squalr.Engine.Memory ├── Clr │ ├── AddressResolver.cs │ ├── DotNetObject.cs │ └── DotNetObjectCollector.cs ├── IMemoryAllocator.cs ├── IMemoryQueryer.cs ├── IMemoryReader.cs ├── IMemoryWriter.cs ├── MemoryAllocator.cs ├── MemoryQueryer.cs ├── MemoryReader.cs ├── MemoryWriter.cs ├── NormalizedFlags.cs ├── NormalizedModule.cs ├── NormalizedRegion.cs ├── Squalr.Engine.Memory.csproj └── Windows │ ├── Native │ ├── Enumerations.cs │ ├── NativeMethods.cs │ └── Structures.cs │ ├── PEB │ └── ManagedPeb.cs │ ├── WindowsMemoryAllocator.cs │ ├── WindowsMemoryQuery.cs │ ├── WindowsMemoryReader.cs │ └── WindowsMemoryWriter.cs ├── Squalr.Engine.Processes ├── DetachProcess.cs ├── OS │ ├── IProcessQueryer.cs │ └── Windows │ │ ├── Native │ │ └── NativeMethods.cs │ │ └── WindowsProcessInfo.cs ├── ProcessExtensionMethods.cs ├── ProcessQuery.cs ├── ProcessSession.cs └── Squalr.Engine.Processes.csproj ├── Squalr.Engine.Projects ├── Items │ ├── AddressItem.cs │ ├── DirectoryItem.cs │ ├── DotNetItem.cs │ ├── InstructionItem.cs │ ├── JavaItem.cs │ ├── PointerItem.cs │ ├── ProjectItem.cs │ ├── ProjectItemHotkey.cs │ └── ScriptItem.cs ├── Project.cs ├── ProjectQueryer.cs ├── ProjectSettings.cs ├── Properties │ ├── Settings.Designer.cs │ └── Settings.settings └── Squalr.Engine.Projects.csproj ├── Squalr.Engine.Scanning ├── App.config ├── ConcurrentScanElementRangeBag.cs ├── Properties │ ├── Settings.Designer.cs │ └── Settings.settings ├── ScanSettings.cs ├── Scanners │ ├── Comparers │ │ ├── ISnapshotRegionScanner.cs │ │ ├── SnapshotRegionRunLengthEncoder.cs │ │ ├── SnapshotRegionScannerBase.cs │ │ ├── SnapshotRegionScannerFactory.cs │ │ ├── Standard │ │ │ ├── SnapshotRegionIterativeScanner.cs │ │ │ ├── SnapshotRegionSingleElementScanner.cs │ │ │ └── SnapshotRegionStandardScannerBase.cs │ │ └── Vectorized │ │ │ ├── SnapshotRegionVectorArrayOfBytesScanner.cs │ │ │ ├── SnapshotRegionVectorFastScanner.cs │ │ │ ├── SnapshotRegionVectorScannerBase.cs │ │ │ ├── SnapshotRegionVectorSparseScanner.cs │ │ │ └── SnapshotRegionVectorStaggeredScanner.cs │ ├── Constraints │ │ ├── OperationConstraint.cs │ │ ├── ScanConstraint.cs │ │ ├── ScanConstraintBase.cs │ │ └── ScanConstraints.cs │ ├── EmulatorDetector.cs │ ├── ManualScanner.cs │ ├── Pointers │ │ ├── PointerFilter.cs │ │ ├── PointerRebase.cs │ │ ├── PointerRetargetScan.cs │ │ ├── PointerScan.cs │ │ ├── PointerSize.cs │ │ ├── SearchKernels │ │ │ ├── BinaryPointerSearchKernel.cs │ │ │ ├── EytzingerPointerSearchKernel.cs │ │ │ ├── IPointerSearchKernel.cs │ │ │ ├── IVectorPointerSearchKernel.cs │ │ │ ├── LinearPointerSearchKernel.cs │ │ │ ├── PointerSearchKernelFactory.cs │ │ │ └── SpanPointerSearchKernel.cs │ │ └── Structures │ │ │ ├── Level.cs │ │ │ ├── Pointer.cs │ │ │ └── PointerBag.cs │ └── ValueCollector.cs ├── Snapshots │ ├── ISnapshotObserver.cs │ ├── Snapshot.cs │ ├── SnapshotElementIndexer.cs │ ├── SnapshotElementRange.cs │ ├── SnapshotManager.cs │ ├── SnapshotQuery.cs │ └── SnapshotRegion.cs └── Squalr.Engine.Scanning.csproj ├── Squalr.Engine.Scripting ├── Compiler.cs ├── Memory │ ├── IMemoryCore.cs │ └── MemoryCore.cs ├── Script.cs ├── Squalr.Engine.Scripting.csproj └── Templates │ ├── CodeInjectionTemplate.cs │ ├── CodeInjectionTemplate.tt │ ├── GraphicsInjectionTemplate.cs │ ├── GraphicsInjectionTemplate.tt │ ├── ScriptTemplate.cs │ └── ScriptTemplate.tt ├── Squalr.Engine.Utils ├── Compression.cs ├── Conversions.cs ├── DataStructures │ ├── BiDictionary.cs │ ├── BinaryHeap.cs │ ├── ConcurrentHashSet.cs │ ├── FullyObservableCollection.cs │ ├── IIntervalTree.cs │ ├── IntervalTree.cs │ ├── IntervalTreeNode.cs │ ├── ObjectPool.cs │ ├── RangeValuePair.cs │ └── TtlCache.cs ├── EmulatorType.cs ├── Extensions │ ├── ArrayExtensions.cs │ ├── DictionaryExtensions.cs │ ├── DoubleExtensions.cs │ ├── EnumExtensions.cs │ ├── IDisposableExtensions.cs │ ├── IEnumerableExtensions.cs │ ├── IntPtrExtensions.cs │ ├── IntegerExtensions.cs │ ├── LinkedListExtensions.cs │ ├── ObjectExtensions.cs │ ├── PrimitiveExtensions.cs │ ├── RandomExtensions.cs │ ├── SingleExtensions.cs │ └── StringExtensions.cs ├── Hardware │ └── Vectors.cs ├── Logging │ ├── ILoggerObserver.cs │ ├── LogLevel.cs │ ├── Logger.cs │ └── LoggingMask.cs ├── MemoryAlignment.cs ├── OS │ └── OSUtils.cs ├── Observables │ ├── Unsubscriber.cs │ └── WeakObserver.cs ├── ParallelSettings.cs ├── ScannableType.cs ├── Squalr.Engine.Common.csproj ├── StaticRandom.cs ├── SyntaxChecker.cs ├── TaskConflictException.cs └── TrackableTask.cs ├── Squalr.Engine ├── Session.cs └── Squalr.Engine.csproj ├── Squalr.nuspec ├── Squalr.sln ├── Squalr ├── App.config ├── App.xaml ├── App.xaml.cs ├── AppIcon.ico ├── Application.manifest ├── Content │ ├── CSharp.xshd │ ├── ChangeLog.cs │ ├── ChangeLog.tt │ ├── DefaultLayout.xml │ ├── Images.cs │ └── Images │ │ ├── AppIcon.ico │ │ ├── BlueBlocks1.png │ │ ├── BlueBlocks2.png │ │ ├── BlueBlocks4.png │ │ ├── BlueBlocks8.png │ │ ├── BlueBlocksArray.png │ │ ├── Cancel.png │ │ ├── Changed.png │ │ ├── Cog.png │ │ ├── Coin.png │ │ ├── CollectValues.png │ │ ├── Connect.png │ │ ├── Connected.png │ │ ├── Cpu.png │ │ ├── Curse.png │ │ ├── Decreased.png │ │ ├── Disconnected.png │ │ ├── DolphinEmulator.png │ │ ├── DownArrows.png │ │ ├── ENotation.png │ │ ├── Edit.png │ │ ├── Equal.png │ │ ├── Glitch.png │ │ ├── GreaterThan.png │ │ ├── GreaterThanOrEqual.png │ │ ├── Heart.png │ │ ├── Home.png │ │ ├── Increased.png │ │ ├── Intersection.png │ │ ├── Invert.png │ │ ├── LeftArrow.png │ │ ├── LeftArrows.png │ │ ├── LessThan.png │ │ ├── LessThanOrEqual.png │ │ ├── LetterP.png │ │ ├── LetterS.png │ │ ├── LogicalAND.png │ │ ├── LogicalOR.png │ │ ├── Maximize.png │ │ ├── Merge.png │ │ ├── MinusX.png │ │ ├── MoveDown.png │ │ ├── MoveLeft.png │ │ ├── MoveRight.png │ │ ├── MoveUp.png │ │ ├── Negation.png │ │ ├── New.png │ │ ├── Next.png │ │ ├── NextScan.png │ │ ├── NotEqual.png │ │ ├── Open.png │ │ ├── OrangeBlocks1.png │ │ ├── OrangeBlocks2.png │ │ ├── OrangeBlocks4.png │ │ ├── OrangeBlocks8.png │ │ ├── PlusX.png │ │ ├── Previous.png │ │ ├── Properties.png │ │ ├── PurpleBlocks1.png │ │ ├── PurpleBlocks2.png │ │ ├── PurpleBlocks4.png │ │ ├── PurpleBlocks8.png │ │ ├── Redo.png │ │ ├── RightArrow.png │ │ ├── RightArrows.png │ │ ├── Save.png │ │ ├── Script.png │ │ ├── Search.png │ │ ├── SelectProcess.png │ │ ├── Squalr.png │ │ ├── SqualrDev.png │ │ ├── Stop.png │ │ ├── Unchanged.png │ │ ├── Undo.png │ │ ├── Union.png │ │ ├── UnknownValue.png │ │ └── X.png ├── Properties │ ├── Resources.Designer.cs │ ├── Settings.Designer.cs │ ├── Settings.settings │ └── SqualrSettings.cs ├── Source │ ├── ChangeLog │ │ └── ChangeLogViewModel.cs │ ├── Controls │ │ ├── ControlThreadingHelper.cs │ │ ├── DarkBrushes.cs │ │ ├── HexDecBoxViewModel.cs │ │ ├── RichTextBoxHelper.cs │ │ ├── SortedCategory.cs │ │ ├── TreeViewItemViewModel.cs │ │ └── WinformsHostingHelper.cs │ ├── Debugger │ │ ├── CodeTraceResult.cs │ │ ├── CodeTracerViewModel.cs │ │ ├── DebuggerViewModel.cs │ │ └── DisassemblyViewModel.cs │ ├── Docking │ │ ├── DockingViewModel.cs │ │ ├── PaneViewModel.cs │ │ ├── PanesStyleSelector.cs │ │ ├── ToolViewModel.cs │ │ └── WindowHostViewModel.cs │ ├── DotNetExplorer │ │ ├── DotNetExplorerViewModel.cs │ │ └── DotNetObjectViewModel.cs │ ├── Editors │ │ ├── DataTypeEditor │ │ │ ├── DataTypeEditorModel.cs │ │ │ └── DataTypeEditorViewModel.cs │ │ ├── HotkeyEditor │ │ │ ├── HotkeyEditorModel.cs │ │ │ └── HotkeyEditorViewModel.cs │ │ ├── OffsetEditor │ │ │ ├── OffsetEditorModel.cs │ │ │ └── OffsetEditorViewModel.cs │ │ ├── ScriptEditor │ │ │ ├── ScriptEditorModel.cs │ │ │ └── ScriptEditorViewModel.cs │ │ ├── TextEditor │ │ │ ├── TextEditorModel.cs │ │ │ └── TextEditorViewModel.cs │ │ └── ValueEditor │ │ │ ├── ValueEditorModel.cs │ │ │ └── ValueEditorViewModel.cs │ ├── Main │ │ └── MainViewModel.cs │ ├── MemoryViewer │ │ └── MemoryViewerViewModel.cs │ ├── Mvvm │ │ ├── AttachedBehaviors │ │ │ ├── MouseDoubleClickBehavior.cs │ │ │ ├── ScrollToCenterBehavior.cs │ │ │ └── ScrollToTopBehavior.cs │ │ ├── Converters │ │ │ ├── BooleanConverter.cs │ │ │ ├── BooleanToVisibilityConverter.cs │ │ │ ├── BorderGapMaskConverter.cs │ │ │ ├── ConstraintToIconConverter.cs │ │ │ ├── DataGridIndexConverter.cs │ │ │ ├── DataTypeToIconConverter.cs │ │ │ ├── HexDecBoxColorConverter.cs │ │ │ ├── HotkeyToStringConverter.cs │ │ │ ├── IconConverter.cs │ │ │ ├── IntToHexConverter.cs │ │ │ ├── IsDirectoryItemConverter.cs │ │ │ ├── IsPointerItemConverter.cs │ │ │ ├── ListViewIndexConverter.cs │ │ │ ├── OffsetsToStringConverter.cs │ │ │ ├── ProcessNameConverter.cs │ │ │ ├── ProjectItemDirectoryConverter.cs │ │ │ ├── ProjectItemToIconConverter.cs │ │ │ ├── UInt64ToAddressConverter.cs │ │ │ ├── ValueConverterGroup.cs │ │ │ └── ValueToMetricSize.cs │ │ └── PrimitiveBinding.cs │ ├── Output │ │ └── OutputViewModel.cs │ ├── PacketEditor │ │ └── PacketEditorViewModel.cs │ ├── ProcessSelector │ │ └── ProcessSelectorViewModel.cs │ ├── ProjectExplorer │ │ ├── Dialogs │ │ │ ├── CreateProjectDialogViewModel.cs │ │ │ ├── DeleteProjectDialogViewModel.cs │ │ │ ├── RenameProjectDialogViewModel.cs │ │ │ ├── RenameProjectItemDialogViewModel.cs │ │ │ ├── SelectProjectDialogViewModel.cs │ │ │ └── TwoChoiceDialogViewModel.cs │ │ ├── ProjectExplorerViewModel.cs │ │ └── ProjectItems │ │ │ ├── DirectoryItemView.cs │ │ │ ├── DotNetItemView.cs │ │ │ ├── InstructionItemView.cs │ │ │ ├── JavaItemView.cs │ │ │ ├── PointerItemView.cs │ │ │ ├── ProjectItemView.cs │ │ │ └── ScriptItemView.cs │ ├── PropertyViewer │ │ ├── IPropertyViewerObserver.cs │ │ └── PropertyViewerViewModel.cs │ ├── ScanResults │ │ ├── PointerScanResultsViewModel.cs │ │ ├── ScanResult.cs │ │ └── ScanResultsViewModel.cs │ ├── Scanners │ │ ├── ChangeCounterViewModel.cs │ │ ├── ManualScannerViewModel.cs │ │ ├── PointerScannerViewModel.cs │ │ └── ValueCollectorViewModel.cs │ ├── SessionManager.cs │ ├── Settings │ │ └── SettingsViewModel.cs │ ├── Snapshots │ │ └── SnapshotManagerViewModel.cs │ ├── Tasks │ │ └── TaskTrackerViewModel.cs │ ├── Updater │ │ └── ApplicationUpdater.cs │ └── Utils │ │ ├── Extensions │ │ └── DependencyObjectExtensions.cs │ │ ├── ImageUtils.cs │ │ ├── Observables │ │ ├── Unsubscriber.cs │ │ └── WeakObserver.cs │ │ └── TypeConverters │ │ ├── AddressConverter.cs │ │ ├── DataTypeConverter.cs │ │ ├── DynamicConverter.cs │ │ ├── HotKeyConverter.cs │ │ ├── OffsetConverter.cs │ │ ├── ScriptConverter.cs │ │ └── TextConverter.cs ├── Squalr.csproj └── View │ ├── ChangeCounter.xaml │ ├── ChangeLog.xaml │ ├── CodeTracer.xaml │ ├── Controls │ ├── HexDecBox.xaml │ └── HexDecBox.xaml.cs │ ├── DataTemplateError.xaml │ ├── Dialogs │ ├── CreateProjectDialog.xaml │ ├── CreateProjectDialog.xaml.cs │ ├── DeleteProjectDialog.xaml │ ├── DeleteProjectDialog.xaml.cs │ ├── RenameProjectDialog.xaml │ ├── RenameProjectDialog.xaml.cs │ ├── RenameProjectItemDialog.cs │ ├── RenameProjectItemDialog.xaml │ ├── SelectProjectDialog.xaml │ ├── SelectProjectDialog.xaml.cs │ ├── TwoChoiceDialog.xaml │ └── TwoChoiceDialog.xaml.cs │ ├── Disassembly.xaml │ ├── DotNetExplorer.xaml │ ├── Editors │ ├── DataTypeEditor.xaml │ ├── DataTypeEditor.xaml.cs │ ├── HotkeyEditor.xaml │ ├── HotkeyEditor.xaml.cs │ ├── OffsetEditor.xaml │ ├── OffsetEditor.xaml.cs │ ├── ScriptEditor.xaml │ ├── ScriptEditor.xaml.cs │ ├── TextEditor.xaml │ ├── TextEditor.xaml.cs │ ├── ValueEditor.xaml │ └── ValueEditor.xaml.cs │ ├── LayoutInitializer.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── MemoryViewer.xaml │ ├── MemoryViewer.xaml.cs │ ├── Output.xaml │ ├── Output.xaml.cs │ ├── PointerScanResults.xaml │ ├── PointerScanner.xaml │ ├── PointerScanner.xaml.cs │ ├── ProcessSelector.xaml │ ├── ProjectExplorer.xaml │ ├── ProjectExplorer.xaml.cs │ ├── PropertyViewer.xaml │ ├── ScanResults.xaml │ ├── Settings.xaml │ ├── Settings.xaml.cs │ ├── SnapshotManager.xaml │ ├── Styles │ ├── AvalonDockOverrides │ │ ├── AnchorablePaneControl.xaml │ │ └── AnchorablePaneTitle.xaml │ ├── Button.xaml │ ├── CheckBox.xaml │ ├── ComboBox.xaml │ ├── ContextMenu.xaml │ ├── DarkBrushes.xaml │ ├── GroupBox.xaml │ ├── MenuItem.xaml │ ├── ScrollViewer.xaml │ ├── Separator.xaml │ ├── Submenu.xaml │ └── TextBoxPlaceHolder.xaml │ ├── ViewModelLocator.cs │ └── ViewTemplateSelector.cs ├── SqualrStream ├── App.config ├── App.xaml ├── App.xaml.cs ├── Content │ ├── ChangeLog.cs │ ├── ChangeLog.tt │ ├── DefaultLayout.xml │ └── Images │ │ └── AppIcon.ico ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ ├── Settings.settings │ └── SettingsViewModel.cs ├── Source │ ├── Api │ │ ├── Exceptions │ │ │ ├── NotFoundException.cs │ │ │ ├── ResponseStatusException.cs │ │ │ └── StatusException.cs │ │ ├── Models │ │ │ ├── AccessTokens.cs │ │ │ ├── Cheat.cs │ │ │ ├── CheatVotes.cs │ │ │ ├── Game.cs │ │ │ ├── Library.cs │ │ │ ├── LibraryCheats.cs │ │ │ ├── OverlayMeta.cs │ │ │ ├── StoreCheats.cs │ │ │ ├── StreamIcon.cs │ │ │ ├── UnlockedCheat.cs │ │ │ ├── User.cs │ │ │ └── Vote.cs │ │ ├── PingClient.cs │ │ └── SqualrApi.cs │ ├── Editors │ │ └── StreamIconEditor │ │ │ ├── IStreamIconsLoadedObserver.cs │ │ │ ├── StreamIconEditorModel.cs │ │ │ └── StreamIconEditorViewModel.cs │ ├── Library │ │ ├── CheatUpdateTask.cs │ │ └── LibraryViewModel.cs │ ├── Main │ │ └── MainViewModel.cs │ ├── Mvvm │ │ └── Converters │ │ │ ├── BrowsePageToInvisibilityConverter.cs │ │ │ └── BrowsePageToVisibilityConverter.cs │ ├── Navigation │ │ ├── BrowseViewModel.cs │ │ ├── INavigable.cs │ │ └── NavigationPage.cs │ ├── Store │ │ ├── RefreshCoinsTask.cs │ │ └── StoreViewModel.cs │ ├── Stream │ │ ├── StreamConfigViewModel.cs │ │ └── StreamVotePollTask.cs │ └── TwitchLogin │ │ └── TwitchLoginViewModel.cs ├── SqualrStream.csproj ├── View │ ├── BrowseHome.xaml │ ├── Editors │ │ ├── StreamIconEditor.xaml │ │ └── StreamIconEditor.xaml.cs │ ├── Library │ │ ├── GamesPage.xaml │ │ ├── LibrariesPage.xaml │ │ ├── LibraryHome.xaml │ │ └── LibraryPage.xaml │ ├── Login │ │ ├── LoginHome.xaml │ │ ├── TwitchLoginPage.xaml │ │ └── TwitchLoginPage.xaml.cs │ ├── MainWindow.xaml │ ├── Store │ │ ├── CheatsPage.xaml │ │ └── StoreHome.xaml │ ├── Streaming │ │ └── StreamConfigurationHome.xaml │ ├── ViewModelLocator.cs │ └── ViewTemplateSelector.cs └── packages.config └── Tests └── SqualrTests ├── PrimitiveTests.cs ├── Properties └── AssemblyInfo.cs ├── SnapshotTests.cs ├── SqualrTests.csproj └── app.config /Documentation/Squalr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Documentation/Squalr.png -------------------------------------------------------------------------------- /Release.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | #################################################################################### 4 | # This script will generate all cpp/h files from data in the Data directory. # 5 | # Run this script every time data files are updated in the Squally/Data directory. # 6 | ###################################################################################$ 7 | 8 | from os import listdir 9 | from os import path 10 | from os.path import isfile, join, splitext, abspath, realpath, basename, relpath 11 | import json 12 | import os 13 | import re 14 | import sys 15 | 16 | import importlib.util 17 | 18 | def main(): 19 | currentPath = os.path.dirname(__file__) 20 | 21 | for root, dirnames, filenames in os.walk(currentPath): 22 | for filename in filenames: 23 | if filename.lower().endswith(".csproj"): 24 | replaceVersionInFile(join(root, filename), "3.0.2") 25 | continue 26 | 27 | def replaceVersionInFile(filename, newVersion): 28 | fin = open(filename, "r") 29 | 30 | lines = [] 31 | 32 | for line in fin: 33 | line = re.sub(".+", "" + newVersion + "", line) 34 | line = re.sub(".+", "" + newVersion + "", line) 35 | line = re.sub(".+", "" + newVersion + "", line) 36 | lines.append(line) 37 | 38 | fin.close() 39 | 40 | fout = open(filename, "w") 41 | for line in lines: 42 | fout.write(line) 43 | fout.close() 44 | 45 | if __name__ == '__main__': 46 | main() 47 | -------------------------------------------------------------------------------- /Settings.StyleCop: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | False 8 | 9 | 10 | 11 | 12 | False 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | False 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | False 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Command.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers 2 | { 3 | using System; 4 | using System.Linq; 5 | 6 | public class Command 7 | { 8 | public Command(String command) 9 | { 10 | String[] args = command.Split(" ", StringSplitOptions.RemoveEmptyEntries); 11 | 12 | this.Name = (args?.Length ?? 0) <= 0 ? String.Empty : args[0]; 13 | this.Args = (args?.Length ?? 0) <= 0 ? new String[] { } : args.Skip(1).ToArray(); 14 | this.Handled = false; 15 | } 16 | 17 | public String Name { get; private set; } 18 | 19 | public String[] Args { get; private set; } 20 | 21 | public Boolean Handled { get; set; } 22 | } 23 | //// End class 24 | } 25 | //// End namespace 26 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Crash/CrashCommandHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Crash 2 | { 3 | using CommandLine; 4 | using Squalr.Cli.CommandHandlers.Scan; 5 | using Squalr.Engine; 6 | using System; 7 | using System.Collections.Generic; 8 | 9 | public class CrashCommandHandler : ICommandHandler 10 | { 11 | public String GetCommandName() 12 | { 13 | return "crash"; 14 | } 15 | 16 | public void TryHandle(ref Session session, Command command) 17 | { 18 | command.Handled = true; 19 | 20 | Parser.Default.ParseArguments(command.Args) 21 | .MapResult( 22 | (CrashCommandOptions options) => options.Handle(), 23 | errs => 1 24 | ); 25 | 26 | Console.WriteLine(); 27 | } 28 | 29 | public IEnumerable GetCommandAndAliases() 30 | { 31 | return new List() 32 | { 33 | }; 34 | } 35 | } 36 | //// End class 37 | } 38 | //// End namespace 39 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/ICommandHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers 2 | { 3 | using Squalr.Engine; 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | public interface ICommandHandler 8 | { 9 | String GetCommandName(); 10 | 11 | void TryHandle(ref Session session, Command command); 12 | 13 | IEnumerable GetCommandAndAliases(); 14 | } 15 | //// End class 16 | } 17 | //// End namespace 18 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Process/ProcessAttachOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Process 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("attach", HelpText = "Opens a running process. Alias for open.")] 7 | public class ProcessAttachOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | ProcessOpenOptions Options = new ProcessOpenOptions(); 12 | 13 | Options.NonInvasive = NonInvasive; 14 | Options.ProcessTerm = ProcessTerm; 15 | 16 | return Options.Handle(); 17 | } 18 | 19 | [Option('n', "non-invasive", Required = false, HelpText = "Non-invasive attach")] 20 | public Boolean NonInvasive { get; set; } 21 | 22 | [Value(0, MetaName = "process term", HelpText = "A term to identify the process. This can be a pid, or a string in the process name.")] 23 | public String ProcessTerm { get; set; } 24 | } 25 | //// End class 26 | } 27 | //// End namespace 28 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Process/ProcessCloseOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Process 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("close", HelpText = "Detaches from a running process.")] 7 | public class ProcessCloseOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | if (SessionManager.Session == null) 12 | { 13 | Console.WriteLine("[Warn] - Not attached to any process."); 14 | 15 | return -1; 16 | } 17 | 18 | SessionManager.Session = null; 19 | 20 | Console.WriteLine("Detached from process."); 21 | 22 | return 0; 23 | } 24 | } 25 | //// End class 26 | } 27 | //// End namespace 28 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Process/ProcessCommandHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Process 2 | { 3 | using CommandLine; 4 | using Squalr.Engine; 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | public class ProcessCommandHandler : ICommandHandler 9 | { 10 | public String GetCommandName() 11 | { 12 | return "process"; 13 | } 14 | 15 | public void TryHandle(ref Session session, Command command) 16 | { 17 | Parser.Default.ParseArguments(command.Args) 18 | .MapResult( 19 | (ProcessOpenOptions options) => options.Handle(), 20 | (ProcessAttachOptions options) => options.Handle(), 21 | (ProcessListOptions options) => options.Handle(), 22 | (ProcessCloseOptions options) => options.Handle(), 23 | (ProcessExitOptions options) => options.Handle(), 24 | (ProcessQuitOptions options) => options.Handle(), 25 | (ProcessDetachOptions options) => options.Handle(), 26 | errs => 1 27 | ); 28 | 29 | command.Handled = true; 30 | } 31 | 32 | public IEnumerable GetCommandAndAliases() 33 | { 34 | return new List() 35 | { 36 | "proc", 37 | "processes" 38 | }; 39 | } 40 | } 41 | //// End class 42 | } 43 | //// End namespace 44 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Process/ProcessDetachOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Process 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("exit", HelpText = "Detaches from a running process. Alias for close.")] 7 | public class ProcessExitOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | return new ProcessCloseOptions().Handle(); 12 | } 13 | } 14 | //// End class 15 | } 16 | //// End namespace 17 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Process/ProcessExitOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Process 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("detach", HelpText = "Detaches from a running process. Alias for close.")] 7 | public class ProcessDetachOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | return new ProcessCloseOptions().Handle(); 12 | } 13 | } 14 | //// End class 15 | } 16 | //// End namespace 17 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Process/ProcessQuitOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Process 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("quit", HelpText = "Detaches from a running process. Alias for close.")] 7 | public class ProcessQuitOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | return new ProcessCloseOptions().Handle(); 12 | } 13 | } 14 | //// End class 15 | } 16 | //// End namespace 17 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Project/ProjectAddOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Project 2 | { 3 | using CommandLine; 4 | using Squalr.Engine.Projects; 5 | using System; 6 | 7 | [Verb("add", HelpText = "Adds a new project item to the project. This item can come from scan results, or be a new item.")] 8 | public class ProjectAddOptions 9 | { 10 | public Int32 Handle() 11 | { 12 | if (SessionManager.Project == null) 13 | { 14 | Console.WriteLine("[Warn] - No project open."); 15 | 16 | return -1; 17 | } 18 | 19 | return 0; 20 | } 21 | } 22 | //// End class 23 | } 24 | //// End namespace 25 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Project/ProjectCommandHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Project 2 | { 3 | using CommandLine; 4 | using Squalr.Engine; 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | public class ProjectCommandHandler : ICommandHandler 9 | { 10 | public String GetCommandName() 11 | { 12 | return "Project"; 13 | } 14 | 15 | public void TryHandle(ref Session session, Command command) 16 | { 17 | Parser.Default.ParseArguments(command.Args) 18 | .MapResult( 19 | (ProjectAddOptions options) => options.Handle(), 20 | (ProjectRemoveOptions options) => options.Handle(), 21 | (ProjectListOptions options) => options.Handle(), 22 | (ProjectToggleOptions options) => options.Handle(), 23 | errs => 1 24 | ); 25 | 26 | command.Handled = true; 27 | } 28 | 29 | public IEnumerable GetCommandAndAliases() 30 | { 31 | return new List() 32 | { 33 | "proj" 34 | }; 35 | } 36 | } 37 | //// End class 38 | } 39 | //// End namespace 40 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Project/ProjectListOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Project 2 | { 3 | using CommandLine; 4 | using Squalr.Engine.Projects; 5 | using Squalr.Engine.Projects.Items; 6 | using System; 7 | using System.Collections.Generic; 8 | 9 | [Verb("list", HelpText = "List current project items.")] 10 | public class ProjectListOptions 11 | { 12 | public Int32 Handle() 13 | { 14 | if (SessionManager.Project == null) 15 | { 16 | Console.WriteLine("[Warn] - No project open."); 17 | 18 | return -1; 19 | } 20 | 21 | Console.WriteLine(); 22 | 23 | Console.WriteLine("------------------------------------------------------------------"); 24 | Console.WriteLine("Enabled " + "\t|\t" + "Name" + "\t|\t" + "Address" + "\t|\t" + "Value" + "\t|\t" + "Description"); 25 | Console.WriteLine("------------------------------------------------------------------"); 26 | 27 | foreach (KeyValuePair next in SessionManager.Project.ChildItems) 28 | { 29 | Console.WriteLine((next.Value.IsEnabled ? "X" : "") + "\t|\t" + next.Value.Name + "\t|\t" + "TODO" + "\t|\t" + "TODO" + "\t|\t" + next.Value.Description); 30 | } 31 | 32 | Console.WriteLine(); 33 | 34 | return 0; 35 | } 36 | 37 | [Option('a', "addresses", Required = false, HelpText = "Flag indicating that only addresses should be listed.")] 38 | public Boolean OnlyAddressess { get; private set; } 39 | 40 | [Option('i', "instructions", Required = false, HelpText = "Flag indicating that only instructions should be listed.")] 41 | public Boolean OnlyInstructions { get; private set; } 42 | } 43 | //// End class 44 | } 45 | //// End namespace 46 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Project/ProjectRemoveOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Project 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("remove", HelpText = "Removes a project item from the project.")] 7 | public class ProjectRemoveOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | if (SessionManager.Project == null) 12 | { 13 | Console.WriteLine("[Warn] - No project open."); 14 | 15 | return -1; 16 | } 17 | 18 | return 0; 19 | } 20 | } 21 | //// End class 22 | } 23 | //// End namespace 24 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Project/ProjectToggleOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Project 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("toggle", HelpText = "Toggles the specified project item")] 7 | public class ProjectToggleOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | if (SessionManager.Project == null) 12 | { 13 | Console.WriteLine("[Warn] - No project open."); 14 | 15 | return -1; 16 | } 17 | 18 | return 0; 19 | } 20 | } 21 | //// End class 22 | } 23 | //// End namespace 24 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Projects/ProjectsCommandHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Projects 2 | { 3 | using CommandLine; 4 | using Squalr.Engine; 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | public class ProjectsCommandHandler : ICommandHandler 9 | { 10 | public String GetCommandName() 11 | { 12 | return "projects"; 13 | } 14 | 15 | public void TryHandle(ref Session session, Command command) 16 | { 17 | Parser.Default.ParseArguments(command.Args) 18 | .MapResult( 19 | (ProjectsNewOptions options) => options.Handle(), 20 | (ProjectsDeleteOptions options) => options.Handle(), 21 | (ProjectsListOptions options) => options.Handle(), 22 | (ProjectsOpenOptions options) => options.Handle(), 23 | errs => 1 24 | ); 25 | 26 | command.Handled = true; 27 | } 28 | 29 | public IEnumerable GetCommandAndAliases() 30 | { 31 | return new List() 32 | { 33 | "projs", 34 | "projects" 35 | }; 36 | } 37 | } 38 | //// End class 39 | } 40 | //// End namespace 41 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Projects/ProjectsDeleteOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Projects 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("delete", HelpText = "Deletes a project, pending confirmation.")] 7 | public class ProjectsDeleteOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | 12 | return 0; 13 | } 14 | } 15 | //// End class 16 | } 17 | //// End namespace 18 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Projects/ProjectsListOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Projects 2 | { 3 | using CommandLine; 4 | using Squalr.Engine.Projects; 5 | using System; 6 | 7 | [Verb("list", HelpText = "List current project items.")] 8 | public class ProjectsListOptions 9 | { 10 | public Int32 Handle() 11 | { 12 | Console.WriteLine(); 13 | 14 | Console.WriteLine("----------------------------------------------"); 15 | Console.WriteLine("# " + "\t|\t" + "Name"); 16 | Console.WriteLine("----------------------------------------------"); 17 | 18 | Int32 index = 0; 19 | 20 | foreach (String next in ProjectQueryer.GetProjectNames()) 21 | { 22 | Console.WriteLine((index++) + "\t|\t" + next); 23 | } 24 | 25 | Console.WriteLine(); 26 | 27 | return 0; 28 | } 29 | } 30 | //// End class 31 | } 32 | //// End namespace 33 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Projects/ProjectsNewOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Projects 2 | { 3 | using CommandLine; 4 | using System; 5 | 6 | [Verb("new", HelpText = "Creates a new project.")] 7 | public class ProjectsNewOptions 8 | { 9 | public Int32 Handle() 10 | { 11 | 12 | return 0; 13 | } 14 | } 15 | //// End class 16 | } 17 | //// End namespace 18 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Results/ResultsCommandHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Results 2 | { 3 | using CommandLine; 4 | using Squalr.Engine; 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | public class ResultsCommandHandler : ICommandHandler 9 | { 10 | public String GetCommandName() 11 | { 12 | return "results"; 13 | } 14 | 15 | public void TryHandle(ref Session session, Command command) 16 | { 17 | if (SessionManager.Session == null) 18 | { 19 | Console.WriteLine("[Error] No active session from which results can be listed."); 20 | 21 | return; 22 | } 23 | 24 | Parser.Default.ParseArguments(command.Args) 25 | .MapResult( 26 | (ResultsListOptions options) => options.Handle(), 27 | errs => 1 28 | ); 29 | 30 | command.Handled = true; 31 | } 32 | 33 | public IEnumerable GetCommandAndAliases() 34 | { 35 | return new List() 36 | { 37 | "res", 38 | "result" 39 | }; 40 | } 41 | } 42 | //// End class 43 | } 44 | //// End namespace 45 | -------------------------------------------------------------------------------- /Squalr.Cli/CommandHandlers/Scan/ScanCommandHandler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli.CommandHandlers.Scan 2 | { 3 | using CommandLine; 4 | using Squalr.Engine; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | 9 | public class ScanCommandHandler : ICommandHandler 10 | { 11 | public String GetCommandName() 12 | { 13 | return "scans"; 14 | } 15 | 16 | public void TryHandle(ref Session session, Command command) 17 | { 18 | if (SessionManager.Session == null) 19 | { 20 | Console.WriteLine("[Error] No active session to scan."); 21 | 22 | return; 23 | } 24 | 25 | Parser.Default.ParseArguments(command.Args) 26 | .MapResult( 27 | (NewScanOptions options) => options.Handle(), 28 | (NextScanOptions options) => options.Handle(), 29 | errs => 1 30 | ); 31 | 32 | command.Handled = true; 33 | } 34 | 35 | public IEnumerable GetCommandAndAliases() 36 | { 37 | return new List() 38 | { 39 | "scan" 40 | }; 41 | } 42 | } 43 | //// End class 44 | } 45 | //// End namespace 46 | -------------------------------------------------------------------------------- /Squalr.Cli/LogListener.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli 2 | { 3 | using Squalr.Engine.Common.Logging; 4 | using System; 5 | 6 | public class LogListener : ILoggerObserver 7 | { 8 | public void OnLogEvent(LogLevel logLevel, String message, String innerMessage) 9 | { 10 | Console.WriteLine(message); 11 | } 12 | } 13 | //// End class 14 | } 15 | //// End namespace 16 | -------------------------------------------------------------------------------- /Squalr.Cli/PrefixedReader.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli 2 | { 3 | using System; 4 | using System.IO; 5 | 6 | class PrefixedReader : TextReader 7 | { 8 | private TextReader originalIn; 9 | 10 | public PrefixedReader(PrefixedWriter prefixedWriter) 11 | { 12 | this.PrefixedWriter = prefixedWriter; 13 | originalIn = Console.In; 14 | } 15 | 16 | private PrefixedWriter PrefixedWriter { get; set; } 17 | 18 | public override String ReadLine() 19 | { 20 | String input = originalIn.ReadLine(); 21 | 22 | this.PrefixedWriter.ClearHasPrefix(); 23 | 24 | return input; 25 | } 26 | } 27 | //// End class 28 | } 29 | //// End namespace 30 | -------------------------------------------------------------------------------- /Squalr.Cli/Program.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli 2 | { 3 | using Squalr.Engine.Common.Logging; 4 | using System; 5 | 6 | /// 7 | /// Squalr.Cli is a command line version of Squalr. This project is useful for ensuring that engine code is decoupled from view code. 8 | /// 9 | public class Program 10 | { 11 | /// 12 | /// Squalr.Cli entry point. 13 | /// 14 | /// Unused args. 15 | static void Main(String[] args) 16 | { 17 | PrefixedWriter prefixedWriter = new PrefixedWriter(); 18 | Console.SetOut(prefixedWriter); 19 | Console.SetIn(new PrefixedReader(prefixedWriter)); 20 | 21 | CommandDispatcher commandDispatcher = new CommandDispatcher(); 22 | LogListener logListener = new LogListener(); 23 | 24 | Logger.Subscribe(logListener); 25 | 26 | while (true) 27 | { 28 | Console.Write(""); 29 | String input = Console.ReadLine(); 30 | 31 | if (input.Equals("exit", StringComparison.OrdinalIgnoreCase) || 32 | input.Equals("close", StringComparison.OrdinalIgnoreCase) || 33 | input.Equals("quit", StringComparison.OrdinalIgnoreCase)) 34 | { 35 | break; 36 | } 37 | 38 | commandDispatcher.Dispatch(input); 39 | } 40 | } 41 | } 42 | //// End class 43 | } 44 | //// End namespace 45 | -------------------------------------------------------------------------------- /Squalr.Cli/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | Debug 9 | Any CPU 10 | netcoreapp3.1 11 | bin\Release\netcoreapp3.1\publish\ 12 | false 13 | 14 | -------------------------------------------------------------------------------- /Squalr.Cli/SessionManager.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Cli 2 | { 3 | using Squalr.Engine; 4 | using Squalr.Engine.Projects; 5 | 6 | public static class SessionManager 7 | { 8 | public static Session Session { get; set; } 9 | 10 | public static Project Project { get; set; } 11 | } 12 | //// End class 13 | } 14 | //// End namespace 15 | -------------------------------------------------------------------------------- /Squalr.Cli/Squalr.Cli.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net7.0 6 | latest 7 | 8 | 9 | 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Assembler/AssemblerFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture.Assemblers 2 | { 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | /// 7 | /// A factory that returns an assembler based on the system architecture. 8 | /// 9 | internal class AssemblerFactory 10 | { 11 | /// 12 | /// Gets an assembler based on the system architecture. 13 | /// 14 | /// The system architecture. 15 | /// An object implementing IAssembler based on the system architecture. 16 | public static IAssembler GetAssembler(Architecture architecture) 17 | { 18 | switch (architecture) 19 | { 20 | case Architecture.X86: 21 | case Architecture.X64: 22 | return new NasmAssembler(); 23 | default: 24 | throw new Exception("Assembler not supported for specified architecture"); 25 | } 26 | } 27 | } 28 | //// End class 29 | } 30 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Assembler/AssemblerResult.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture.Assemblers 2 | { 3 | using System; 4 | 5 | /// 6 | /// A class containing the results of an assembler operation. 7 | /// 8 | public class AssemblerResult 9 | { 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | /// The compiled assembly. 14 | /// The message of the compilation result. 15 | /// The inner message of the compilation result. 16 | public AssemblerResult(Byte[] bytes, String message, String innerMessage) 17 | { 18 | this.Bytes = bytes; 19 | this.Message = message; 20 | this.InnerMessage = innerMessage; 21 | } 22 | 23 | /// 24 | /// Gets the bytes from the compiled assembly. 25 | /// 26 | public Byte[] Bytes { get; private set; } 27 | 28 | /// 29 | /// Gets the message of the compilation result. 30 | /// 31 | public String Message { get; private set; } 32 | 33 | /// 34 | /// Gets the inner message of the compilation result. Usually contains error data. 35 | /// 36 | public String InnerMessage { get; private set; } 37 | } 38 | //// End class 39 | } 40 | -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Assembler/FasmAssembler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture.Assemblers 2 | { 3 | using System; 4 | 5 | /// 6 | /// The Fasm assembler for x86/64. 7 | /// 8 | internal class FasmAssembler : IAssembler 9 | { 10 | /// 11 | /// Assemble the specified assembly code. 12 | /// 13 | /// The assembly code. 14 | /// Whether or not the assembly is in the context of a 32 bit program. 15 | /// An array of bytes containing the assembly code. 16 | public AssemblerResult Assemble(String assembly, Boolean isProcess32Bit) 17 | { 18 | // Assemble and return the code 19 | return this.Assemble(assembly, isProcess32Bit, 0); 20 | } 21 | 22 | /// 23 | /// Assemble the specified assembly code at a base address. 24 | /// 25 | /// The assembly code. 26 | /// Whether or not the assembly is in the context of a 32 bit program. 27 | /// The address where the code is rebased. 28 | /// An array of bytes containing the assembly code. 29 | public AssemblerResult Assemble(String assembly, Boolean isProcess32Bit, UInt64 baseAddress) 30 | { 31 | AssemblerResult result = null; 32 | 33 | return result; 34 | } 35 | } 36 | //// End class 37 | } 38 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Assembler/IAssembler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture.Assemblers 2 | { 3 | using System; 4 | 5 | /// 6 | /// Interface defining an assembler. 7 | /// 8 | public interface IAssembler 9 | { 10 | /// 11 | /// Assemble the specified assembly code. 12 | /// 13 | /// The assembly code. 14 | /// Whether or not the assembly is in the context of a 32 bit program. 15 | /// An array of bytes containing the assembly code. 16 | AssemblerResult Assemble(String assembly, Boolean isProcess32Bit); 17 | 18 | /// 19 | /// Assemble the specified assembly code at a base address. 20 | /// 21 | /// The assembly code. 22 | /// Whether or not the assembly is in the context of a 32 bit program. 23 | /// The address where the code is rebased. 24 | /// An array of bytes containing the assembly code. 25 | AssemblerResult Assemble(String assembly, Boolean isProcess32Bit, UInt64 baseAddress); 26 | } 27 | //// End interface 28 | } 29 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Assembler/MasmAssembler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture.Assemblers 2 | { 3 | using System; 4 | 5 | /// 6 | /// The Masm assembler for x86/64. 7 | /// 8 | internal class MasmAssembler : IAssembler 9 | { 10 | /// 11 | /// Assemble the specified assembly code. 12 | /// 13 | /// The assembly code. 14 | /// Whether or not the assembly is in the context of a 32 bit program. 15 | /// An array of bytes containing the assembly code. 16 | public AssemblerResult Assemble(String assembly, Boolean isProcess32Bit) 17 | { 18 | // Assemble and return the code 19 | return this.Assemble(assembly, isProcess32Bit, 0); 20 | } 21 | 22 | /// 23 | /// Assemble the specified assembly code at a base address. 24 | /// 25 | /// The assembly code. 26 | /// Whether or not the assembly is in the context of a 32 bit program. 27 | /// The address where the code is rebased. 28 | /// An array of bytes containing the assembly code. 29 | public AssemblerResult Assemble(String assembly, Boolean isProcess32Bit, UInt64 baseAddress) 30 | { 31 | AssemblerResult result = null; 32 | 33 | return result; 34 | } 35 | } 36 | //// End class 37 | } 38 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Disassembler/DisassemblerFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture.Disassemblers 2 | { 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | /// 7 | /// A factory that returns a disassembler based on the system architecture. 8 | /// 9 | internal class DisassemblerFactory 10 | { 11 | /// 12 | /// Gets a disassembler based on the system architecture. 13 | /// 14 | /// The system architecture. 15 | /// An object implementing IDisassembler based on the system architecture. 16 | public static IDisassembler GetDisassembler(Architecture architecture) 17 | { 18 | switch (architecture) 19 | { 20 | case Architecture.X86: 21 | case Architecture.X64: 22 | return new SharpDisassembler(); 23 | default: 24 | throw new Exception("Assembler not supported for specified architecture"); 25 | } 26 | } 27 | } 28 | //// End class 29 | } 30 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Disassembler/IDisassembler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture.Disassemblers 2 | { 3 | using System; 4 | 5 | /// 6 | /// Interface defining a disassembler. 7 | /// 8 | public interface IDisassembler 9 | { 10 | /// 11 | /// Disassemble the specified assembly code. 12 | /// 13 | /// The raw bytes. 14 | /// Whether or not the assembly is in the context of a 32 bit program. 15 | /// The address where the code is rebased. 16 | /// A string containing the assembly. 17 | Instruction[] Disassemble(Byte[] bytes, Boolean isProcess32Bit, UInt64 baseAddress); 18 | } 19 | //// End class 20 | } 21 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Disassembler/SharpDisassembler.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture.Disassemblers 2 | { 3 | using SharpDisasm; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | 8 | /// 9 | /// An implementation of the udis disassembler. 10 | /// 11 | internal class SharpDisassembler : IDisassembler 12 | { 13 | /// 14 | /// An instruction disassembler. 15 | /// 16 | private Disassembler disassembler; 17 | 18 | /// 19 | /// Disassemble the specified bytes. 20 | /// 21 | /// The bytes to be disassembled. 22 | /// Whether or not the assembly is in the context of a 32 bit program. 23 | /// The address where the code is rebased. 24 | /// An array of bytes containing the assembly code. 25 | public Architecture.Instruction[] Disassemble(Byte[] bytes, Boolean isProcess32Bit, UInt64 baseAddress) 26 | { 27 | this.disassembler = new Disassembler( 28 | code: bytes, 29 | architecture: isProcess32Bit ? ArchitectureMode.x86_32 : ArchitectureMode.x86_64, 30 | address: baseAddress, 31 | copyBinaryToInstruction: true); 32 | 33 | IEnumerable instructions = this.disassembler.Disassemble(); 34 | 35 | return instructions.Select(instruction => 36 | new Architecture.Instruction( 37 | instruction.Offset, 38 | instruction.ToString(), 39 | instruction.Bytes, 40 | instruction.Bytes.Length)).ToArray(); 41 | } 42 | } 43 | //// End class 44 | } 45 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/IArchitecture.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Architecture 2 | { 3 | using Assemblers; 4 | using Disassemblers; 5 | using System.Runtime.InteropServices; 6 | 7 | /// 8 | /// An interface defining an object that can assemble and disassemble instructions. 9 | /// 10 | public interface IArchitecture 11 | { 12 | /// 13 | /// Gets the architecture of the CPU running Squalr. 14 | /// 15 | /// The architecture of the CPU running Squalr. 16 | Architecture GetCpuArchitecture(); 17 | 18 | /// 19 | /// Gets an instruction assembler for the current CPU architecture. 20 | /// 21 | /// An instruction assembler for the current CPU architecture. 22 | IAssembler GetAssembler(); 23 | 24 | /// 25 | /// Gets an instruction assembler of the specified architecture. 26 | /// 27 | /// The cpu architexture for the assembler. 28 | /// An instruction assembler of the specified architecture. 29 | IAssembler GetAssembler(Architecture architecture); 30 | 31 | /// 32 | /// Gets an instruction disassembler for the current CPU architecture. 33 | /// 34 | /// An instruction disassembler for the current CPU architecture. 35 | IDisassembler GetDisassembler(); 36 | 37 | /// 38 | /// Gets an instruction disassembler of the specified architecture. 39 | /// 40 | /// The cpu architexture for the disassembler. 41 | /// An instruction disassembler of the specified architecture. 42 | IDisassembler GetDisassembler(Architecture architecture); 43 | } 44 | //// End architecture 45 | } 46 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Library/.gitignore: -------------------------------------------------------------------------------- 1 | !*.exe -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Library/fasm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr.Engine.Architecture/Library/fasm.exe -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Library/ml.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr.Engine.Architecture/Library/ml.exe -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Library/ml64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr.Engine.Architecture/Library/ml64.exe -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Library/nasm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr.Engine.Architecture/Library/nasm.exe -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Library/test.asm: -------------------------------------------------------------------------------- 1 | org 0x100 2 | [BITS 64] 3 | 4 | push rax 5 | push rax 6 | push rax 7 | push rax 8 | push rax 9 | push rax 10 | push rax 11 | push rax 12 | push rax 13 | push rax 14 | push rax 15 | push rax 16 | push rax 17 | push rax 18 | push rax 19 | push rax 20 | push rax 21 | push rax 22 | push rax 23 | push rax 24 | push rax 25 | push rax 26 | push rax 27 | push rax 28 | push rax 29 | push rax 30 | push rax 31 | push rax 32 | push rax 33 | push rax 34 | push rax 35 | push rax 36 | push rax 37 | push rax 38 | push rax 39 | push rax 40 | -------------------------------------------------------------------------------- /Squalr.Engine.Architecture/Squalr.Engine.Architecture.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | latest 6 | true 7 | 3.0.2 8 | Squalr engine component for assemblers and disassemblers. Currently, this supports x86 and x64 processors. 9 | 10 | 11 | 12 | true 13 | true 14 | 3.0.2 15 | 3.0.2 16 | 17 | 18 | 19 | 20 | PreserveNewest 21 | 22 | 23 | PreserveNewest 24 | 25 | 26 | PreserveNewest 27 | 28 | 29 | PreserveNewest 30 | 31 | 32 | 33 | 34 | 35 | 36 | all 37 | runtime; build; native; contentfiles; analyzers; buildtransitive 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/CodeTraceInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Debuggers 2 | { 3 | using Squalr.Engine.Architecture; 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | public class CodeTraceInfo 8 | { 9 | public CodeTraceInfo() 10 | { 11 | this.IntRegisters = new Dictionary(); 12 | } 13 | 14 | public Instruction Instruction { get; set; } 15 | 16 | public Dictionary IntRegisters { get; set; } 17 | } 18 | //// End interface 19 | } 20 | //// End namespace 21 | -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/ExtensionMethods.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Debuggers 2 | { 3 | using System; 4 | 5 | public static class ExtensionMethods 6 | { 7 | public static UInt32 ToUInt32(this BreakpointSize breakPointSize) 8 | { 9 | switch (breakPointSize) 10 | { 11 | case BreakpointSize.B1: 12 | return 1; 13 | case BreakpointSize.B2: 14 | return 2; 15 | case BreakpointSize.B4: 16 | return 4; 17 | case BreakpointSize.B8: 18 | return 8; 19 | default: 20 | throw new ArgumentException("Invalid breakpoint size enumeration value"); 21 | } 22 | } 23 | 24 | public static BreakpointSize SizeToBreakpointSize(this IDebugger debugger, UInt32 variableSize) 25 | { 26 | if (variableSize <= 0) 27 | { 28 | return BreakpointSize.B1; 29 | } 30 | else if (variableSize <= 2) 31 | { 32 | return BreakpointSize.B2; 33 | } 34 | else if (variableSize <= 4) 35 | { 36 | return BreakpointSize.B4; 37 | } 38 | else 39 | { 40 | return BreakpointSize.B8; 41 | } 42 | } 43 | } 44 | //// End class 45 | } 46 | //// End namespace 47 | -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/IDebugger.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Debuggers 2 | { 3 | using System; 4 | using System.Diagnostics; 5 | using System.Threading; 6 | 7 | public delegate void MemoryAccessCallback(CodeTraceInfo codeTraceInfo); 8 | 9 | public delegate Boolean DebugRequestCallback(); 10 | 11 | public enum BreakpointSize 12 | { 13 | B1 = 1, 14 | B2 = 2, 15 | B4 = 4, 16 | B8 = 8, 17 | } 18 | 19 | public interface IDebugger 20 | { 21 | void SetTargetProcess(Process process); 22 | 23 | CancellationTokenSource FindWhatReads(UInt64 address, BreakpointSize size, MemoryAccessCallback callback); 24 | 25 | CancellationTokenSource FindWhatWrites(UInt64 address, BreakpointSize size, MemoryAccessCallback callback); 26 | 27 | CancellationTokenSource FindWhatAccesses(UInt64 address, BreakpointSize size, MemoryAccessCallback callback); 28 | 29 | void PauseExecution(); 30 | 31 | void ResumeExecution(); 32 | 33 | void WriteRegister(UInt32 registerId, UInt64 value); 34 | 35 | UInt64 ReadRegister(UInt32 registerId); 36 | 37 | void WriteInstructionPointer(UInt64 value); 38 | 39 | UInt64 ReadInstructionPointer(); 40 | 41 | Boolean IsAttached { get; } 42 | 43 | /// 44 | /// Gets or sets the debug request callback. If this is set, this callback will be called before the debugger is attached. 45 | /// The debugger will only perform the attach if the result of the callback is true. 46 | /// 47 | DebugRequestCallback DebugRequestCallback { get; set; } 48 | } 49 | //// End interface 50 | } 51 | //// End namespace 52 | -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/Squalr.Engine.Debugger.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/Squalr.Engine.Debuggers.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | latest 6 | true 7 | 3.0.2 8 | Squalr engine component for attachable debuggers. 9 | 10 | 11 | 12 | true 13 | 14 | 15 | 16 | true 17 | 18 | 19 | 20 | true 21 | true 22 | 3.0.2 23 | 3.0.2 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | all 39 | runtime; build; native; contentfiles; analyzers; buildtransitive 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/Windows/DebugEngine/Internal/IDebugAdvanced.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Text; 6 | using System.Runtime.InteropServices; 7 | 8 | #pragma warning disable 1591 9 | 10 | namespace Microsoft.Diagnostics.Runtime.Interop 11 | { 12 | [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("f2df5f53-071f-47bd-9de6-5734c3fed689")] 13 | public interface IDebugAdvanced 14 | { 15 | [PreserveSig] 16 | int GetThreadContext( 17 | [In] IntPtr Context, 18 | [In] UInt32 ContextSize); 19 | 20 | [PreserveSig] 21 | int SetThreadContext( 22 | [In] IntPtr Context, 23 | [In] UInt32 ContextSize); 24 | } 25 | } -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/Windows/DebugEngine/Internal/IDebugInputCallbacks.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Runtime.InteropServices; 6 | 7 | #pragma warning disable 1591 8 | 9 | namespace Microsoft.Diagnostics.Runtime.Interop 10 | { 11 | [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("9f50e42c-f136-499e-9a97-73036c94ed2d")] 12 | public interface IDebugInputCallbacks 13 | { 14 | [PreserveSig] 15 | int StartInput( 16 | [In] UInt32 BufferSize); 17 | 18 | [PreserveSig] 19 | int EndInput(); 20 | } 21 | } -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/Windows/DebugEngine/Internal/IDebugOutputCallbacks.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Runtime.InteropServices; 6 | 7 | #pragma warning disable 1591 8 | 9 | namespace Microsoft.Diagnostics.Runtime.Interop 10 | { 11 | [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("4bf58045-d654-4c40-b0af-683090f356dc")] 12 | public interface IDebugOutputCallbacks 13 | { 14 | [PreserveSig] 15 | int Output( 16 | [In] DEBUG_OUTPUT Mask, 17 | [In, MarshalAs(UnmanagedType.LPStr)] string Text); 18 | } 19 | } -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/Windows/DebugEngine/Internal/IDebugOutputCallbacks2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Runtime.InteropServices; 6 | 7 | #pragma warning disable 1591 8 | 9 | namespace Microsoft.Diagnostics.Runtime.Interop 10 | { 11 | [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("67721fe9-56d2-4a44-a325-2b65513ce6eb")] 12 | public interface IDebugOutputCallbacks2 : IDebugOutputCallbacks 13 | { 14 | /* IDebugOutputCallbacks */ 15 | 16 | /// 17 | /// This method is not used. 18 | /// 19 | [PreserveSig] 20 | new int Output( 21 | [In] DEBUG_OUTPUT Mask, 22 | [In, MarshalAs(UnmanagedType.LPStr)] string Text); 23 | 24 | /* IDebugOutputCallbacks2 */ 25 | 26 | [PreserveSig] 27 | int GetInterestMask( 28 | [Out] out DEBUG_OUTCBI Mask); 29 | 30 | [PreserveSig] 31 | int Output2( 32 | [In] DEBUG_OUTCB Which, 33 | [In] DEBUG_OUTCBF Flags, 34 | [In] UInt64 Arg, 35 | [In, MarshalAs(UnmanagedType.LPWStr)] string Text); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/Windows/DebugEngine/Internal/IDebugOutputCallbacksWide.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. 3 | 4 | using System; 5 | using System.Runtime.InteropServices; 6 | 7 | #pragma warning disable 1591 8 | 9 | namespace Microsoft.Diagnostics.Runtime.Interop 10 | { 11 | [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("4c7fd663-c394-4e26-8ef1-34ad5ed3764c")] 12 | public interface IDebugOutputCallbacksWide 13 | { 14 | [PreserveSig] 15 | int Output( 16 | [In] DEBUG_OUTPUT Mask, 17 | [In, MarshalAs(UnmanagedType.LPWStr)] string Text); 18 | } 19 | } -------------------------------------------------------------------------------- /Squalr.Engine.Debugger/Windows/DebugEngine/OutputCallbacks.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Debuggers.Windows.DebugEngine 2 | { 3 | using Microsoft.Diagnostics.Runtime.Interop; 4 | using Squalr.Engine.Common.Logging; 5 | using System; 6 | using System.Runtime.InteropServices; 7 | 8 | internal class OutputCallBacks : IDebugOutputCallbacksWide 9 | { 10 | public Int32 Output([In] DEBUG_OUTPUT Mask, [In, MarshalAs(UnmanagedType.LPWStr)] String text) 11 | { 12 | // Disabled because this was causing Squalr to hang on Thread.Join() in the output text view model somehow. 13 | // Logger.Log(LogLevel.Debug, text?.Trim()); 14 | 15 | return 0; 16 | } 17 | } 18 | //// End class 19 | } 20 | //// End namespace 21 | -------------------------------------------------------------------------------- /Squalr.Engine.Input/Controller/IControllerObserver.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Input.Controller 2 | { 3 | /// 4 | /// Interface for an object which will observe changes in controller input 5 | /// 6 | public interface IControllerObserver 7 | { 8 | } 9 | //// End interface 10 | } 11 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Input/Controller/IControllerSubject.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Input.Controller 2 | { 3 | /// 4 | /// Interface for an object which will capture controller input 5 | /// 6 | public interface IControllerSubject : IInputCapture 7 | { 8 | /// 9 | /// Subscribes to controller capture events 10 | /// 11 | /// The observer to subscribe 12 | void Subscribe(IControllerObserver subject); 13 | 14 | /// 15 | /// Unsubscribes from controller capture events 16 | /// 17 | /// The observer to unsubscribe 18 | void Unsubscribe(IControllerObserver subject); 19 | } 20 | //// End interface 21 | } 22 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Input/Hotkeys/HotkeyBuilder.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Input.HotKeys 2 | { 3 | using System; 4 | 5 | /// 6 | /// An interface defining a hotkey, which is activated by a given set of input. 7 | /// 8 | public abstract class HotkeyBuilder 9 | { 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | /// The callback function for this hotkey. 14 | public HotkeyBuilder(Action callBackFunction = null) 15 | { 16 | this.CallBackFunction = callBackFunction; 17 | } 18 | 19 | /// 20 | /// Gets or sets the callback function of this hotkey. 21 | /// 22 | protected Action CallBackFunction { get; set; } 23 | 24 | /// 25 | /// Creates a hotkey from this hotkey builder. 26 | /// 27 | /// The hotkey to build. 28 | /// The built hotkey. 29 | public abstract Hotkey Build(Hotkey targetHotkey); 30 | 31 | /// 32 | /// Event triggered when the hotkeys are updated for this keyboard hotkey. 33 | /// 34 | protected void OnHotkeysUpdated() 35 | { 36 | this.CallBackFunction?.Invoke(); 37 | } 38 | } 39 | //// End interface 40 | } 41 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Input/IInputCapture.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Input 2 | { 3 | /// 4 | /// An interface defining an object responsable for capturing input for a specific device 5 | /// 6 | public interface IInputCapture 7 | { 8 | /// 9 | /// Updates the input capture device, polling the system for changes on that device 10 | /// 11 | void Update(); 12 | } 13 | //// End class 14 | } 15 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Input/IInputManager.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Input 2 | { 3 | using Controller; 4 | using Keyboard; 5 | using Mouse; 6 | 7 | /// 8 | /// An interface defining an object which is responsable for managing all input devices 9 | /// 10 | public interface IInputManager 11 | { 12 | /// 13 | /// Gets the keyboard capture interface 14 | /// 15 | /// The keyboard capture interface 16 | KeyboardCapture GetKeyboardCapture(); 17 | 18 | /// 19 | /// Gets the mouse capture interface 20 | /// 21 | /// The mouse capture interface 22 | IMouseSubject GetMouseCapture(); 23 | 24 | /// 25 | /// Gets the controller capture interface 26 | /// 27 | /// The controller capture interface 28 | IControllerSubject GetControllerCapture(); 29 | } 30 | //// End class 31 | } 32 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Input/Keyboard/KeyState.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Input.Keyboard 2 | { 3 | using SharpDX.DirectInput; 4 | using System.Collections.Generic; 5 | 6 | /// 7 | /// An object that tracks the state of pressed, released, down, and held keys. 8 | /// 9 | public class KeyStates 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The set of currently pressed keys. 15 | /// The set of currently released keys. 16 | /// The set of currently down keys. 17 | /// The set of currently held keys. 18 | public KeyStates(HashSet pressedKeys, HashSet releasedKeys, HashSet downKeys, HashSet heldKeys) 19 | { 20 | this.PressedKeys = pressedKeys; 21 | this.ReleasedKeys = releasedKeys; 22 | this.DownKeys = downKeys; 23 | this.HeldKeys = heldKeys; 24 | } 25 | 26 | /// 27 | /// Gets the set of currently pressed keys. 28 | /// 29 | public HashSet PressedKeys { get; private set; } 30 | 31 | /// 32 | /// Gets the set of currently released keys. 33 | /// 34 | public HashSet ReleasedKeys { get; private set; } 35 | 36 | /// 37 | /// Gets the set of currently down keys. 38 | /// 39 | public HashSet DownKeys { get; private set; } 40 | 41 | /// 42 | /// Gets the set of currently held keys. 43 | /// 44 | public HashSet HeldKeys { get; private set; } 45 | } 46 | //// End class 47 | } 48 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Input/Mouse/IMouseObserver.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Input.Mouse 2 | { 3 | /// 4 | /// Interface for an object which will observe changes in mouse input 5 | /// 6 | public interface IMouseObserver 7 | { 8 | } 9 | //// End interface 10 | } 11 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Input/Mouse/IMouseSubject.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Input.Mouse 2 | { 3 | /// 4 | /// Interface for an object which will capture mouse input 5 | /// 6 | public interface IMouseSubject : IInputCapture 7 | { 8 | /// 9 | /// Subscribes to mouse capture events 10 | /// 11 | /// The observer to subscribe 12 | void Subscribe(IMouseObserver subject); 13 | 14 | /// 15 | /// Unsubscribes from mouse capture events 16 | /// 17 | /// The observer to unsubscribe 18 | void Unsubscribe(IMouseObserver subject); 19 | } 20 | //// End interface 21 | } 22 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Input/Squalr.Engine.Input.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | latest 6 | true 7 | 3.0.2 8 | Squalr engine component for input management. 9 | 10 | 11 | 12 | true 13 | true 14 | 3.0.2 15 | 3.0.2 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | all 24 | runtime; build; native; contentfiles; analyzers; buildtransitive 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Squalr.Engine.Memory/IMemoryAllocator.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Memory 2 | { 3 | using System; 4 | using System.Diagnostics; 5 | 6 | /// 7 | /// An interface for querying virtual memory. 8 | /// 9 | public interface IMemoryAllocator 10 | { 11 | /// 12 | /// Allocates memory in the specified process. 13 | /// 14 | /// The process in which to allocate the memory. 15 | /// The size of the memory allocation. 16 | /// A pointer to the location of the allocated memory. 17 | UInt64 AllocateMemory(Process process, Int32 size); 18 | 19 | /// 20 | /// Allocates memory in the specified process. 21 | /// 22 | /// The process in which to allocate the memory. 23 | /// The size of the memory allocation. 24 | /// The rough address of where the allocation should take place. 25 | /// A pointer to the location of the allocated memory. 26 | UInt64 AllocateMemory(Process process, Int32 size, UInt64 allocAddress); 27 | 28 | /// 29 | /// Deallocates memory in the specified process. 30 | /// 31 | /// The process in which to deallocate the memory. 32 | /// The address to perform the region wide deallocation. 33 | void DeallocateMemory(Process process, UInt64 address); 34 | } 35 | //// End interface 36 | } 37 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Memory/IMemoryWriter.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Memory 2 | { 3 | using Squalr.Engine.Common; 4 | using System; 5 | using System.Diagnostics; 6 | 7 | /// 8 | /// An interface for writing virtual memory. 9 | /// 10 | public interface IMemoryWriter 11 | { 12 | /// 13 | /// Writes a value to memory in the opened process. 14 | /// 15 | /// The data type to write. 16 | /// The address to write to. 17 | /// The value to write. 18 | void Write(Process process, ScannableType elementType, UInt64 address, Object value); 19 | 20 | /// 21 | /// Writes a value to memory in the opened process. 22 | /// 23 | /// The data type to write. 24 | /// The address to write to. 25 | /// The value to write. 26 | void Write(Process process, UInt64 address, T value); 27 | 28 | /// 29 | /// Writes a value to memory in the opened process. 30 | /// 31 | /// The address to write to. 32 | /// The value to write. 33 | void WriteBytes(Process process, UInt64 address, Byte[] values); 34 | } 35 | //// End interface 36 | } 37 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Memory/NormalizedFlags.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Memory 2 | { 3 | using System; 4 | 5 | /// 6 | /// Flags that indicate the memory protection for a region of memory. 7 | /// 8 | [Flags] 9 | public enum MemoryProtectionEnum 10 | { 11 | /// 12 | /// Writable memory. 13 | /// 14 | Write = 0x1, 15 | 16 | /// 17 | /// Executable memory. 18 | /// 19 | Execute = 0x2, 20 | 21 | /// 22 | /// Memory marked as copy on write. 23 | /// 24 | CopyOnWrite = 0x4 25 | } 26 | 27 | /// 28 | /// Flags that indicate the memory type for a region of memory. 29 | /// 30 | [Flags] 31 | public enum MemoryTypeEnum 32 | { 33 | /// 34 | /// No other flags specified. 35 | /// 36 | None = 0x1, 37 | 38 | /// 39 | /// Indicates that the memory pages within the region are private (that is, not shared by other processes). 40 | /// 41 | Private = 0x2, 42 | 43 | /// 44 | /// Indicates that the memory pages within the region are mapped into the view of an image section. 45 | /// 46 | Image = 0x4, 47 | 48 | /// 49 | /// Indicates that the memory pages within the region are mapped into the view of a section. 50 | /// 51 | Mapped = 0x8 52 | } 53 | //// End enum 54 | } 55 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Memory/NormalizedModule.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Memory 2 | { 3 | using System; 4 | using System.IO; 5 | 6 | /// 7 | /// Defines an OS independent module region and attributes. 8 | /// 9 | public class NormalizedModule : NormalizedRegion 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The path of the module. 15 | /// The base address of the module. 16 | /// The total size of the module. 17 | public NormalizedModule(String fullPath, UInt64 baseAddress, Int32 size) : base(baseAddress, size) 18 | { 19 | this.Name = Path.GetFileName(fullPath); 20 | this.FullPath = fullPath; 21 | } 22 | 23 | /// 24 | /// Gets the name of the module. 25 | /// 26 | public String Name { get; private set; } 27 | 28 | /// 29 | /// Gets the full path of the module. 30 | /// 31 | public String FullPath { get; private set; } 32 | } 33 | //// End interface 34 | } 35 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Memory/Squalr.Engine.Memory.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | latest 6 | 3.0.2 7 | Squalr engine component for memory APIs. This includes, reading, writing, and querying memory for 32 and 64 bit processes. 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | all 19 | runtime; build; native; contentfiles; analyzers; buildtransitive 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | true 30 | true 31 | 3.0.2 32 | 3.0.2 33 | 34 | 35 | 36 | true 37 | 38 | 39 | 40 | true 41 | true 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Squalr.Engine.Processes/DetachProcess.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Processes 2 | { 3 | using System.Diagnostics; 4 | 5 | /// 6 | /// Defines an instance of an empty process. This can be displayed in GUIs. 7 | /// Attempting to attach to this process actually will cause a detach from the current target process. 8 | /// 9 | public class DetachProcess : Process 10 | { 11 | /// 12 | /// A special static instance of an empty process used to display a "detach" option in user interfaces. 13 | /// 14 | private static DetachProcess instance = new DetachProcess(); 15 | 16 | /// 17 | /// Gets an instance of the detach process. Attempting to attach to this will actually cause a process detach. 18 | /// 19 | public static DetachProcess Instance 20 | { 21 | get 22 | { 23 | return instance; 24 | } 25 | } 26 | } 27 | //// End class 28 | } 29 | //// End namespace 30 | -------------------------------------------------------------------------------- /Squalr.Engine.Processes/Squalr.Engine.Processes.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | latest 6 | 3.0.2 7 | 3.0.2 8 | 3.0.2 9 | 10 | 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Squalr.Engine.Projects/Items/JavaItem.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Projects.Items 2 | { 3 | using Squalr.Engine.Processes; 4 | using System; 5 | using System.Runtime.Serialization; 6 | 7 | /// 8 | /// A project item that specifies a resolvable address in a Java application. 9 | /// 10 | [DataContract] 11 | public class JavaItem : AddressItem 12 | { 13 | /// 14 | /// The extension for this project item type. 15 | /// 16 | public new const String Extension = ".jvm"; 17 | 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | /// A process session reference for accessing the current opened process. 22 | public JavaItem(ProcessSession processSession) : base(processSession) 23 | { 24 | } 25 | 26 | /// 27 | /// Gets the extension for this project item. 28 | /// 29 | /// The extension for this project item. 30 | public override String GetExtension() 31 | { 32 | return JavaItem.Extension; 33 | } 34 | 35 | /// 36 | /// Resolves the raw address of this Java address item. 37 | /// 38 | /// The resolved raw address of this Java address item. 39 | protected override UInt64 ResolveAddress() 40 | { 41 | return 0; 42 | } 43 | } 44 | //// End class 45 | } 46 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Projects/Project.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Projects 2 | { 3 | using Squalr.Engine.Processes; 4 | using Squalr.Engine.Projects.Items; 5 | using System; 6 | using System.IO; 7 | 8 | /// 9 | /// Defines a Squalr project. This is the root directory that contains all other project items. 10 | /// 11 | public class Project : DirectoryItem 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// A process session reference for accessing the current opened process. 17 | /// The project path, or the project name. 18 | public Project(ProcessSession processSession, String projectFilePathOrName) : base(processSession, Project.ToDirectory(projectFilePathOrName), null) 19 | { 20 | } 21 | 22 | /// 23 | /// Converts a project name into a project path, if necessary. 24 | /// 25 | /// The project path, or the project name. 26 | /// The full path for this project file name. 27 | private static String ToDirectory(String projectFilePathOrName) 28 | { 29 | if (!Path.IsPathRooted(projectFilePathOrName)) 30 | { 31 | projectFilePathOrName = Path.Combine(ProjectSettings.ProjectRoot, projectFilePathOrName); 32 | } 33 | 34 | return projectFilePathOrName; 35 | } 36 | } 37 | //// End class 38 | } 39 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Projects/ProjectSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Projects 2 | { 3 | using Squalr.Engine.Common.Extensions; 4 | using Squalr.Engine.Projects.Properties; 5 | using System; 6 | using System.IO; 7 | 8 | /// 9 | /// A class for interfacing with saved project settings. 10 | /// 11 | public static class ProjectSettings 12 | { 13 | /// 14 | /// Gets or sets the project root from which all projects are saved and read. 15 | /// 16 | public static String ProjectRoot 17 | { 18 | get 19 | { 20 | if (Settings.Default.ProjectRoot.IsNullOrEmpty()) 21 | { 22 | ProjectSettings.ProjectRoot = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Squalr"); 23 | } 24 | 25 | return Settings.Default.ProjectRoot; 26 | } 27 | 28 | set 29 | { 30 | Settings.Default.ProjectRoot = value; 31 | } 32 | } 33 | } 34 | //// End class 35 | } 36 | //// End namespace 37 | -------------------------------------------------------------------------------- /Squalr.Engine.Projects/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Squalr.Engine.Projects.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.5.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("")] 29 | public string ProjectRoot { 30 | get { 31 | return ((string)(this["ProjectRoot"])); 32 | } 33 | set { 34 | this["ProjectRoot"] = value; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Squalr.Engine.Projects/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Squalr.Engine.Projects/Squalr.Engine.Projects.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | latest 6 | 3.0.2 7 | 3.0.2 8 | 3.0.2 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Settings.settings 27 | True 28 | True 29 | 30 | 31 | 32 | 33 | 34 | Settings.Designer.cs 35 | SettingsSingleFileGenerator 36 | 37 | 38 | 39 | 40 | 41 | 42 | all 43 | runtime; build; native; contentfiles; analyzers; buildtransitive 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/ConcurrentScanElementRangeBag.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning 2 | { 3 | using Squalr.Engine.Scanning.Snapshots; 4 | using System.Collections.Concurrent; 5 | using System.Collections.Generic; 6 | 7 | public class ConcurrentScanElementRangeBag : ConcurrentBag>, IEnumerable 8 | { 9 | IEnumerator IEnumerable.GetEnumerator() 10 | { 11 | foreach (IList list in this) 12 | { 13 | foreach (SnapshotElementRange item in list) 14 | { 15 | yield return item; 16 | } 17 | } 18 | } 19 | } 20 | //// End class 21 | } 22 | //// End namespace 23 | -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Scanners/Comparers/ISnapshotRegionScanner.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Scanners.Comparers 2 | { 3 | using Squalr.Engine.Scanning.Scanners.Constraints; 4 | using Squalr.Engine.Scanning.Snapshots; 5 | using System; 6 | using System.Collections.Generic; 7 | 8 | /// 9 | /// An interface that defines the implementation for snapshot scans. 10 | /// 11 | internal unsafe interface ISnapshotRegionScanner : IDisposable 12 | { 13 | /// 14 | /// Performs a scan over the given element range, returning the elements that match the scan. 15 | /// 16 | /// The element range to scan. 17 | /// The scan constraints. 18 | /// The resulting elements, if any. 19 | public IList ScanRegion(SnapshotElementRange elementRange, ScanConstraints constraints); 20 | 21 | /// 22 | /// Sets the action to perform when the scanner is disposed. Note that a disposed scanner is not necessarily destroyed, as these objects may be recycled for future scans. 23 | /// 24 | /// The dispose function callback. 25 | public void SetDisposeCallback(Action onDispose); 26 | } 27 | //// End interface 28 | } 29 | //// End namespace 30 | -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Scanners/Constraints/ScanConstraintBase.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Scanners.Constraints 2 | { 3 | using Squalr.Engine.Common; 4 | using System; 5 | 6 | public interface IScanConstraint 7 | { 8 | /// 9 | /// Sets the element type to which all constraints apply. 10 | /// 11 | /// The new element type. 12 | public abstract void SetElementType(ScannableType elementType); 13 | 14 | public abstract Boolean IsValid(); 15 | 16 | /// 17 | /// Clones this scan constraint. 18 | /// 19 | /// The cloned scan constraint. 20 | public abstract IScanConstraint Clone(); 21 | } 22 | //// End interface 23 | } 24 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Scanners/Pointers/PointerSize.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Scanners.Pointers.Structures 2 | { 3 | using Squalr.Engine.Common; 4 | using System; 5 | 6 | /// 7 | /// An enum for possible pointer sizes. 8 | /// 9 | public enum PointerSize 10 | { 11 | Byte4, 12 | Byte8, 13 | } 14 | 15 | public static class PointerSizeExtensions 16 | { 17 | public static Int32 ToSize(this PointerSize pointerSize) 18 | { 19 | switch (pointerSize) 20 | { 21 | case PointerSize.Byte4: 22 | return 4; 23 | case PointerSize.Byte8: 24 | return 8; 25 | default: 26 | throw new ArgumentException("Unknown pointer size"); 27 | } 28 | } 29 | 30 | public static ScannableType ToDataType(this PointerSize pointerSize) 31 | { 32 | switch (pointerSize) 33 | { 34 | case PointerSize.Byte4: 35 | return ScannableType.UInt32; 36 | case PointerSize.Byte8: 37 | return ScannableType.UInt64; 38 | default: 39 | throw new ArgumentException("Unknown pointer size"); 40 | } 41 | } 42 | } 43 | //// End class 44 | } 45 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Scanners/Pointers/SearchKernels/IPointerSearchKernel.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Scanners.Pointers.SearchKernels 2 | { 3 | using Squalr.Engine.Scanning.Scanners.Comparers; 4 | using System; 5 | using System.Numerics; 6 | 7 | /// 8 | /// Defines an interface for an object that can search for pointers that point within a specified offset of a given set of snapshot regions. 9 | /// 10 | internal interface IPointerSearchKernel 11 | { 12 | Func> GetSearchKernel(ISnapshotRegionScanner snapshotRegionScanner); 13 | } 14 | //// End interface 15 | } 16 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Scanners/Pointers/SearchKernels/IVectorPointerSearchKernel.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Scanners.Pointers.SearchKernels 2 | { 3 | using Squalr.Engine.Scanning.Scanners.Comparers.Vectorized; 4 | using System; 5 | using System.Numerics; 6 | 7 | /// 8 | /// Defines an interface for an object that can search for pointers that point within a specified offset of a given set of snapshot regions. 9 | /// 10 | internal interface IVectorPointerSearchKernel 11 | { 12 | Func> GetSearchKernel(SnapshotRegionVectorScannerBase snapshotRegionScanner); 13 | } 14 | //// End interface 15 | } 16 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Scanners/Pointers/SearchKernels/PointerSearchKernelFactory.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Scanners.Pointers.SearchKernels 2 | { 3 | using Squalr.Engine.Scanning.Scanners.Pointers.Structures; 4 | using Squalr.Engine.Scanning.Snapshots; 5 | using System; 6 | 7 | internal class PointerSearchKernelFactory 8 | { 9 | public static IVectorPointerSearchKernel GetSearchKernel(Snapshot boundsSnapshot, UInt32 maxOffset, PointerSize pointerSize) 10 | { 11 | if (boundsSnapshot.ByteCount < 64) 12 | { 13 | // Linear is fast for small region sizes 14 | return new LinearPointerSearchKernel(boundsSnapshot, maxOffset, pointerSize); 15 | } 16 | else 17 | { 18 | return new SpanPointerSearchKernel(boundsSnapshot, maxOffset, pointerSize); 19 | } 20 | } 21 | } 22 | //// End class 23 | } 24 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Scanners/Pointers/Structures/Level.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Scanners.Pointers.Structures 2 | { 3 | using Squalr.Engine.Scanning.Snapshots; 4 | using System; 5 | 6 | public class Level 7 | { 8 | internal Level() 9 | { 10 | } 11 | 12 | internal Level(Snapshot heapPointers) 13 | { 14 | this.HeapPointers = heapPointers; 15 | } 16 | 17 | internal Level(Snapshot heapPointers, Snapshot staticPointers) 18 | { 19 | this.HeapPointers = heapPointers; 20 | this.StaticPointers = staticPointers; 21 | } 22 | 23 | public UInt64 BaseCount 24 | { 25 | get 26 | { 27 | return this.StaticPointers?.ElementCount ?? 0; 28 | } 29 | } 30 | 31 | public UInt64 PointerCount 32 | { 33 | get 34 | { 35 | return this.HeapPointers?.ElementCount ?? 0; 36 | } 37 | } 38 | 39 | internal Snapshot HeapPointers { get; set; } 40 | 41 | internal Snapshot StaticPointers { get; set; } 42 | } 43 | //// End class 44 | } 45 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Scanners/Pointers/Structures/Pointer.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Scanners.Pointers.Structures 2 | { 3 | using System; 4 | 5 | public class Pointer 6 | { 7 | public Pointer(String moduleName, UInt64 moduleOffset, PointerSize pointerSize, Int32[] offsets = null) 8 | { 9 | this.ModuleName = moduleName; 10 | this.ModuleOffset = moduleOffset; 11 | this.PointerSize = pointerSize; 12 | this.Offsets = offsets; 13 | } 14 | 15 | public String ModuleName { get; private set; } 16 | 17 | public UInt64 ModuleOffset { get; private set; } 18 | 19 | public Int32[] Offsets { get; private set; } 20 | 21 | public PointerSize PointerSize { get; private set; } 22 | } 23 | //// End class 24 | } 25 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Scanning/Snapshots/ISnapshotObserver.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Scanning.Snapshots 2 | { 3 | /// 4 | /// Interface for a class which listens for changes in the active snapshot. 5 | /// 6 | public interface ISnapshotObserver 7 | { 8 | /// 9 | /// Recieves an update of the active snapshot. 10 | /// 11 | /// The active snapshot. 12 | void Update(Snapshot snapshot); 13 | } 14 | //// End interface 15 | } 16 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Scripting/Templates/CodeInjectionTemplate.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#" #> 2 | <#@ assembly name="System.Core" #> 3 | <#@ import namespace="System.Linq" #> 4 | <#@ import namespace="System.Text" #> 5 | <#@ import namespace="System.Collections.Generic" #> 6 | <#@ import namespace="Squalr" #> 7 | <#@ import namespace="Squalr.Engine" #> 8 | using System; 9 | using Squalr.Engine.Scripting; 10 | using Squalr.Engine.Scripting.Graphics; 11 | using Squalr.Engine.Scripting.Input; 12 | using Squalr.Engine.Scripting.Memory; 13 | public void OnActivate() 14 | { 15 | var moduleBase = Memory.GetModuleAddress("moduleName"); 16 | var entry = moduleBase + 0x1234; 17 | 18 | var code = @" 19 | nop 20 | "; 21 | 22 | Memory.CreateCodeCave(entry, code); 23 | } 24 | 25 | public void OnUpdate(float elapsedTimeMs) 26 | { 27 | } 28 | 29 | public void OnDeactivate() 30 | { 31 | Memory.ClearAllKeywords(); 32 | Memory.RemoveAllCodeCaves(); 33 | } 34 | -------------------------------------------------------------------------------- /Squalr.Engine.Scripting/Templates/GraphicsInjectionTemplate.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#" #> 2 | <#@ assembly name="System.Core" #> 3 | <#@ import namespace="System.Linq" #> 4 | <#@ import namespace="System.Text" #> 5 | <#@ import namespace="System.Collections.Generic" #> 6 | <#@ import namespace="Squalr" #> 7 | <#@ import namespace="Squalr.Engine" #> 8 | using System; 9 | using Squalr.Engine.Scripting; 10 | using Squalr.Engine.Scripting.Graphics; 11 | using Squalr.Engine.Scripting.Input; 12 | using Squalr.Engine.Scripting.Memory; 13 | public void OnActivate() 14 | { 15 | var moduleBase = Memory.GetModuleAddress("moduleName"); 16 | var entry = moduleBase + 0x1234; 17 | 18 | var code = @" 19 | nop 20 | "; 21 | 22 | Memory.CreateCodeCave(entry, code); 23 | } 24 | 25 | public void OnUpdate(float elapsedTimeMs) 26 | { 27 | } 28 | 29 | public void OnDeactivate() 30 | { 31 | Memory.ClearAllKeywords(); 32 | Memory.RemoveAllCodeCaves(); 33 | } 34 | -------------------------------------------------------------------------------- /Squalr.Engine.Scripting/Templates/ScriptTemplate.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#" #> 2 | <#@ assembly name="System.Core" #> 3 | <#@ import namespace="System.Linq" #> 4 | <#@ import namespace="System.Text" #> 5 | <#@ import namespace="System.Collections.Generic" #> 6 | <#@ import namespace="Squalr" #> 7 | <#@ import namespace="Squalr.Engine" #> 8 | using System; 9 | using Squalr.Engine.Scripting; 10 | using Squalr.Engine.Scripting.Graphics; 11 | using Squalr.Engine.Scripting.Input; 12 | using Squalr.Engine.Scripting.Memory; 13 | 14 | public void OnActivate() 15 | { 16 | // WIP 17 | } 18 | 19 | public void OnUpdate(float elapsedTimeMs) 20 | { 21 | // WIP 22 | } 23 | 24 | public void OnDeactivate() 25 | { 26 | // WIP 27 | } 28 | -------------------------------------------------------------------------------- /Squalr.Engine.Utils/EmulatorType.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common 2 | { 3 | using System.Runtime.Serialization; 4 | 5 | /// 6 | /// An enum representing an emulator target. 7 | /// 8 | [DataContract] 9 | public enum EmulatorType 10 | { 11 | /// 12 | /// A value used to request that Squalr automatically detect if the target process is running a console emulator. 13 | /// 14 | AutoDetect, 15 | 16 | /// 17 | /// A value indicating that a process is normal, and not a console emulator. 18 | /// 19 | None, 20 | 21 | /// 22 | /// A value indicating that a process is the Dolphin Game Cube emulator. 23 | /// 24 | Dolphin, 25 | } 26 | //// End enum 27 | } 28 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Extensions/DictionaryExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Extensions 2 | { 3 | using System.Collections.Generic; 4 | 5 | /// 6 | /// Extension methods for Dictionaries. 7 | /// 8 | public static class DictionaryExtensions 9 | { 10 | /// 11 | /// Adds the specified elements to the dictionary. 12 | /// 13 | /// The key type. 14 | /// The value type. 15 | /// The source dictionary. 16 | /// The elements to add. 17 | public static void AddRange(this Dictionary source, params KeyValuePair[] newItems) 18 | { 19 | foreach (KeyValuePair element in newItems) 20 | { 21 | source.Add(element.Key, element.Value); 22 | } 23 | } 24 | } 25 | //// End class 26 | } 27 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Extensions/DoubleExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Extensions 2 | { 3 | using System; 4 | 5 | /// 6 | /// Contains extension methods for doubles. 7 | /// 8 | public static class DoubleExtensions 9 | { 10 | /// 11 | /// Determines if two doubles are almost equal in value via https://en.wikipedia.org/wiki/Unit_in_the_last_place distance. 12 | /// Note that, ULP tests do not work well for small numbers, so this will fall back on a delta test if the ULP fails. 13 | /// 14 | /// The first double. 15 | /// The second double. 16 | /// Returns true if the doubles are almost equal. 17 | public static unsafe Boolean AlmostEquals(this Double double1, Double double2) 18 | { 19 | const Int32 MaxDeltaBits = 32; 20 | const Single MaxDelta = 0.001f; 21 | 22 | // Step 1: Try a ULP distance test 23 | Int64 int1 = *((Int64*)&double1); 24 | if (int1 < 0) 25 | { 26 | int1 = Int64.MinValue - int1; 27 | } 28 | 29 | Int64 int2 = *((Int64*)&double2); 30 | if (int2 < 0) 31 | { 32 | int2 = Int64.MinValue - int2; 33 | } 34 | 35 | Int64 intDiff = int1 - int2; 36 | Int64 absoluteValueIntDiff = intDiff > 0 ? intDiff : -intDiff; 37 | 38 | if (absoluteValueIntDiff <= (1L << MaxDeltaBits)) 39 | { 40 | return true; 41 | } 42 | 43 | // Step 2: Try a delta test 44 | Double delta = double1 - double2; 45 | Double absoluteDelta = delta > 0 ? delta : -delta; 46 | 47 | return absoluteDelta < MaxDelta; 48 | } 49 | } 50 | //// End class 51 | } 52 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Extensions/IDisposableExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Extensions 2 | { 3 | using Observables; 4 | using System; 5 | 6 | /// 7 | /// Extension methods for the IDisposable interface. 8 | /// 9 | public static class IDisposableExtensions 10 | { 11 | public static IDisposable WeakSubscribe(this IObservable observable, IObserver observer) 12 | { 13 | return new WeakObserver(observable, observer); 14 | } 15 | } 16 | //// End class 17 | } 18 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Extensions/LinkedListExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Extensions 2 | { 3 | using System.Collections.Generic; 4 | 5 | /// 6 | /// A class that enables circular linked list functions, over a normal linked list. 7 | /// 8 | public static class LinkedListExtensions 9 | { 10 | /// 11 | /// Gets the next node in the linked list. If none is present, this will return the first. 12 | /// 13 | /// The data type contained in the linked list. 14 | /// The node of which we are taking the next. 15 | /// The next node in the circular linked list. 16 | public static LinkedListNode NextOrFirst(this LinkedListNode current) 17 | { 18 | return current.Next ?? current.List?.First; 19 | } 20 | 21 | /// 22 | /// Gets the previous node in the linked list. If none is present, this will return the first. 23 | /// 24 | /// The data type contained in the linked list. 25 | /// The node of which we are taking the previous. 26 | /// The previous node in the circular linked list. 27 | public static LinkedListNode PreviousOrLast(this LinkedListNode current) 28 | { 29 | return current.Previous ?? current.List?.Last; 30 | } 31 | } 32 | //// End class 33 | } 34 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Extensions/ObjectExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Extensions 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Runtime.CompilerServices; 6 | 7 | /// 8 | /// Extension methods for all objects. 9 | /// 10 | public static class ObjectExtensions 11 | { 12 | /// 13 | /// Prints the method that called this function, as well as any provided parameters. 14 | /// 15 | /// The object for which to print the debug tag. 16 | /// The function from which this method was invoked. 17 | /// Any aditional parameters to print. 18 | /// Returns the same object being operated on, allowing for lock(Object.PrintDebugTag()) for lock debugging. 19 | public static Object PrintDebugTag(this Object self, [CallerMemberName] String callerName = "", params String[] parameters) 20 | { 21 | // Write calling class and method name 22 | String tag = "[" + self.GetType().Name + "] - " + callerName; 23 | 24 | // Write parameters 25 | if (parameters.Length > 0) 26 | { 27 | (new List(parameters)).ForEach(x => tag += " " + x); 28 | } 29 | 30 | Console.WriteLine(tag); 31 | 32 | return self; 33 | } 34 | } 35 | //// End calss 36 | } 37 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Extensions/PrimitiveExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Extensions 2 | { 3 | using System; 4 | 5 | /// 6 | /// Extension methods for primitive data types. 7 | /// 8 | public static class PrimitiveExtensions 9 | { 10 | /// 11 | /// Bounds the value between the min and the maximum values provided. 12 | /// 13 | /// Type data type of the value. 14 | /// The value in consideration. 15 | /// The minimum value allowed. 16 | /// The maximum value allowed. 17 | /// The value clamped between the minimum and maximum values. 18 | public static T Clamp(this T self, T min, T max) where T : IComparable 19 | { 20 | if (self.CompareTo(min) < 0) 21 | { 22 | return min; 23 | } 24 | else if (self.CompareTo(max) > 0) 25 | { 26 | return max; 27 | } 28 | else 29 | { 30 | return self; 31 | } 32 | } 33 | } 34 | //// End calss 35 | } 36 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Extensions/SingleExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Extensions 2 | { 3 | using System; 4 | 5 | /// 6 | /// Contains extension methods for singles. 7 | /// 8 | public static class SingleExtensions 9 | { 10 | /// 11 | /// Determines if two doubles are almost equal in value via https://en.wikipedia.org/wiki/Unit_in_the_last_place distance. 12 | /// Note that, ULP tests do not work well for small numbers, so this will fall back on a delta test if the ULP fails. 13 | /// 14 | /// The first float. 15 | /// The second float. 16 | /// Returns true if the floats are almost equal. 17 | public static unsafe Boolean AlmostEquals(this Single float1, Single float2) 18 | { 19 | const Int32 MaxDeltaBits = 16; 20 | const Single MaxDelta = 0.001f; 21 | 22 | // Step 1: Try a ULP distance test 23 | Int32 int1 = *((Int32*)&float1); 24 | if (int1 < 0) 25 | { 26 | int1 = Int32.MinValue - int1; 27 | } 28 | 29 | Int32 int2 = *((Int32*)&float2); 30 | if (int2 < 0) 31 | { 32 | int2 = Int32.MinValue - int2; 33 | } 34 | 35 | Int32 intDiff = int1 - int2; 36 | Int32 absoluteValueIntDiff = intDiff > 0 ? intDiff : -intDiff; 37 | 38 | if (absoluteValueIntDiff <= (1 << MaxDeltaBits)) 39 | { 40 | return true; 41 | } 42 | 43 | // Step 2: Try a delta test 44 | Single delta = float1 - float2; 45 | Single absoluteDelta = delta > 0 ? delta : -delta; 46 | 47 | return absoluteDelta < MaxDelta; 48 | } 49 | } 50 | //// End class 51 | } 52 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Hardware/Vectors.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Hardware 2 | { 3 | using System; 4 | using System.Numerics; 5 | 6 | /// 7 | /// A class containing convenience methods and properties for hardware vectors. 8 | /// 9 | public static class Vectors 10 | { 11 | /// 12 | /// A vector with all bits set to 1. TODO: If C# ever adds support for extension properties, this would be great to offload onto all Vector{T} types. 13 | /// 14 | public static readonly Vector AllBits = Vector.OnesComplement(Vector.Zero); 15 | 16 | /// 17 | /// Initializes static members of the class. 18 | /// 19 | static Vectors() 20 | { 21 | Vectors.HasVectorSupport = Vector.IsHardwareAccelerated; 22 | Vectors.VectorSize = Vector.Count; 23 | } 24 | 25 | /// 26 | /// Gets a value indicating whether the archiecture has vector instruction support. 27 | /// 28 | public static Boolean HasVectorSupport { get; private set; } 29 | 30 | /// 31 | /// Gets the vector size supported by the current architecture. 32 | /// If vectors are not supported, returns the lowest common denominator vector size for the architecture. 33 | /// 34 | public static Int32 VectorSize { get; private set; } 35 | } 36 | //// End class 37 | } 38 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Logging/ILoggerObserver.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Logging 2 | { 3 | using System; 4 | 5 | /// 6 | /// Defines the interface for an object that observes output log events. 7 | /// 8 | public interface ILoggerObserver 9 | { 10 | /// 11 | /// Logs a message to output. 12 | /// 13 | /// The log level. 14 | /// The log message. 15 | /// The log inner message. 16 | void OnLogEvent(LogLevel logLevel, String message, String innerMessage); 17 | } 18 | //// End interface 19 | } 20 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Logging/LogLevel.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Logging 2 | { 3 | /// 4 | /// The possible channels to which we can log messages. 5 | /// 6 | public enum LogLevel 7 | { 8 | /// 9 | /// Debugging information. 10 | /// 11 | Debug, 12 | 13 | /// 14 | /// Standard information. 15 | /// 16 | Info, 17 | 18 | /// 19 | /// Warning messages. 20 | /// 21 | Warn, 22 | 23 | /// 24 | /// Error messages. 25 | /// 26 | Error, 27 | 28 | /// 29 | /// Severe error messages. 30 | /// 31 | Fatal, 32 | } 33 | //// End enum 34 | } 35 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Logging/LoggingMask.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Logging 2 | { 3 | using System; 4 | using System.Text.RegularExpressions; 5 | 6 | /// 7 | /// Masks sensitive data from appearing in the output. 8 | /// 9 | public class LoggingMask 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The regular expression used to filter output text. 15 | /// The text that replaces the redacted text. 16 | public LoggingMask(String filterRegex, String replacementText = "{{REDACTED}}") 17 | { 18 | this.ReplacementText = replacementText; 19 | 20 | this.FilterRegex = new Regex(filterRegex); 21 | } 22 | 23 | /// 24 | /// Gets or sets the text that replaces redacted text. 25 | /// 26 | private String ReplacementText { get; set; } 27 | 28 | /// 29 | /// Gets or sets the regular expression used to filter output text. 30 | /// 31 | private Regex FilterRegex { get; set; } 32 | 33 | /// 34 | /// Applies the regular expression filter to the given message. 35 | /// 36 | /// The message to filter. 37 | /// The filtered message. 38 | public String ApplyFilter(String message) 39 | { 40 | return message == null ? null : this.FilterRegex.Replace(message, this.ReplacementText); 41 | } 42 | } 43 | //// End class 44 | } 45 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/MemoryAlignment.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common 2 | { 3 | using System.Runtime.Serialization; 4 | 5 | /// 6 | /// An enum for configuring memory alignment. 7 | /// 8 | [DataContract] 9 | public enum MemoryAlignment 10 | { 11 | Auto = 0, 12 | Alignment1 = 1, 13 | Alignment2 = 2, 14 | Alignment4 = 4, 15 | Alignment8 = 8, 16 | } 17 | //// End enum 18 | } 19 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Observables/Unsubscriber.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common.Observables 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | public class Unsubscriber : IDisposable 7 | { 8 | public Unsubscriber(HashSet> observers, IObserver observer) 9 | { 10 | this.Observers = observers; 11 | this.Observer = observer; 12 | } 13 | 14 | private HashSet> Observers { get; set; } 15 | 16 | private IObserver Observer { get; set; } 17 | 18 | public void Dispose() 19 | { 20 | if (this.Observers.Contains(this.Observer)) 21 | { 22 | this.Observers.Remove(this.Observer); 23 | } 24 | } 25 | } 26 | //// End class 27 | } 28 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/Squalr.Engine.Common.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | latest 6 | 3.0.2 7 | 3.0.2 8 | 3.0.2 9 | 10 | 11 | 12 | true 13 | 14 | 15 | 16 | true 17 | 18 | 19 | 20 | 21 | 22 | all 23 | runtime; build; native; contentfiles; analyzers; buildtransitive 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Squalr.Engine.Utils/StaticRandom.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common 2 | { 3 | using System; 4 | using System.Threading; 5 | 6 | /// 7 | /// A thread safe static random class. 8 | /// 9 | public static class StaticRandom 10 | { 11 | /// 12 | /// The thread safe random class instance. 13 | /// 14 | private static readonly ThreadLocal Random = new ThreadLocal(() => new Random(Interlocked.Increment(ref seed))); 15 | 16 | /// 17 | /// The random seed. 18 | /// 19 | private static Int32 seed = Environment.TickCount; 20 | 21 | /// 22 | /// Returns a thread safe random integer. 23 | /// 24 | /// A random integer. 25 | public static Int32 Next() 26 | { 27 | return Random.Value.Next(); 28 | } 29 | 30 | /// 31 | /// Returns a thread safe random integer. 32 | /// 33 | /// The inclusive lower bound of the number returned. 34 | /// The exclusive upper bound of the number returned. 35 | /// A random integer. 36 | public static Int32 Next(Int32 min, Int32 max) 37 | { 38 | return Random.Value.Next(min, max); 39 | } 40 | } 41 | //// End class 42 | } 43 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine.Utils/TaskConflictException.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine.Common 2 | { 3 | using System; 4 | 5 | /// 6 | /// A class defining a scheduling conflict for a . 7 | /// 8 | public class TaskConflictException : Exception 9 | { 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | public TaskConflictException() : base() 14 | { 15 | } 16 | 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | /// The error message for this exception. 21 | public TaskConflictException(String message) : base(message) 22 | { 23 | } 24 | 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | /// The error message for this exception. 29 | /// The inner exception that this exception wraps. 30 | public TaskConflictException(String message, Exception inner) : base(message, inner) 31 | { 32 | } 33 | } 34 | //// End class 35 | } 36 | //// End namespace -------------------------------------------------------------------------------- /Squalr.Engine/Session.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Engine 2 | { 3 | using Squalr.Engine.Processes; 4 | using Squalr.Engine.Scanning.Snapshots; 5 | using System.Diagnostics; 6 | 7 | /// 8 | /// Contains session information, including the target process in addition to snapshot history. 9 | /// 10 | public class Session : ProcessSession 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | /// The process to open for this session. 16 | public Session(Process processToOpen) : base(processToOpen) 17 | { 18 | this.SnapshotManager = new SnapshotManager(); 19 | } 20 | 21 | /// 22 | /// Gets a snapshot manager for managing scan history. 23 | /// 24 | public SnapshotManager SnapshotManager { get; private set; } 25 | } 26 | //// End class 27 | } 28 | //// End namespace 29 | -------------------------------------------------------------------------------- /Squalr.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $id$ 5 | $title$ 6 | $version$ 7 | Zachary Canann 8 | Zachary Canann 9 | false 10 | $description$ 11 | n/a 12 | Copyright 2021 Squalr Inc. 13 | Squalr memory editor game hacking 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Squalr/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | True 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Squalr/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.UI 2 | { 3 | using System.Windows; 4 | 5 | /// 6 | /// Interaction logic for App.xaml 7 | /// 8 | public partial class App : Application 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Squalr/AppIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/AppIcon.ico -------------------------------------------------------------------------------- /Squalr/Content/ChangeLog.cs: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /Squalr/Content/ChangeLog.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#" #> 2 | <#@ assembly name="System.Core" #> 3 | <#@ import namespace="System.Linq" #> 4 | <#@ import namespace="System.Text" #> 5 | <#@ import namespace="System.Text" #> 6 | <#@ import namespace="System.Collections.Generic" #> -------------------------------------------------------------------------------- /Squalr/Content/Images/AppIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/AppIcon.ico -------------------------------------------------------------------------------- /Squalr/Content/Images/BlueBlocks1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/BlueBlocks1.png -------------------------------------------------------------------------------- /Squalr/Content/Images/BlueBlocks2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/BlueBlocks2.png -------------------------------------------------------------------------------- /Squalr/Content/Images/BlueBlocks4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/BlueBlocks4.png -------------------------------------------------------------------------------- /Squalr/Content/Images/BlueBlocks8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/BlueBlocks8.png -------------------------------------------------------------------------------- /Squalr/Content/Images/BlueBlocksArray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/BlueBlocksArray.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Cancel.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Changed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Changed.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Cog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Cog.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Coin.png -------------------------------------------------------------------------------- /Squalr/Content/Images/CollectValues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/CollectValues.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Connect.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Connected.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Cpu.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Curse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Curse.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Decreased.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Decreased.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Disconnected.png -------------------------------------------------------------------------------- /Squalr/Content/Images/DolphinEmulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/DolphinEmulator.png -------------------------------------------------------------------------------- /Squalr/Content/Images/DownArrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/DownArrows.png -------------------------------------------------------------------------------- /Squalr/Content/Images/ENotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/ENotation.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Edit.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Equal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Equal.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Glitch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Glitch.png -------------------------------------------------------------------------------- /Squalr/Content/Images/GreaterThan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/GreaterThan.png -------------------------------------------------------------------------------- /Squalr/Content/Images/GreaterThanOrEqual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/GreaterThanOrEqual.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Heart.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Home.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Increased.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Increased.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Intersection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Intersection.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Invert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Invert.png -------------------------------------------------------------------------------- /Squalr/Content/Images/LeftArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/LeftArrow.png -------------------------------------------------------------------------------- /Squalr/Content/Images/LeftArrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/LeftArrows.png -------------------------------------------------------------------------------- /Squalr/Content/Images/LessThan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/LessThan.png -------------------------------------------------------------------------------- /Squalr/Content/Images/LessThanOrEqual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/LessThanOrEqual.png -------------------------------------------------------------------------------- /Squalr/Content/Images/LetterP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/LetterP.png -------------------------------------------------------------------------------- /Squalr/Content/Images/LetterS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/LetterS.png -------------------------------------------------------------------------------- /Squalr/Content/Images/LogicalAND.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/LogicalAND.png -------------------------------------------------------------------------------- /Squalr/Content/Images/LogicalOR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/LogicalOR.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Maximize.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Merge.png -------------------------------------------------------------------------------- /Squalr/Content/Images/MinusX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/MinusX.png -------------------------------------------------------------------------------- /Squalr/Content/Images/MoveDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/MoveDown.png -------------------------------------------------------------------------------- /Squalr/Content/Images/MoveLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/MoveLeft.png -------------------------------------------------------------------------------- /Squalr/Content/Images/MoveRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/MoveRight.png -------------------------------------------------------------------------------- /Squalr/Content/Images/MoveUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/MoveUp.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Negation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Negation.png -------------------------------------------------------------------------------- /Squalr/Content/Images/New.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/New.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Next.png -------------------------------------------------------------------------------- /Squalr/Content/Images/NextScan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/NextScan.png -------------------------------------------------------------------------------- /Squalr/Content/Images/NotEqual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/NotEqual.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Open.png -------------------------------------------------------------------------------- /Squalr/Content/Images/OrangeBlocks1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/OrangeBlocks1.png -------------------------------------------------------------------------------- /Squalr/Content/Images/OrangeBlocks2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/OrangeBlocks2.png -------------------------------------------------------------------------------- /Squalr/Content/Images/OrangeBlocks4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/OrangeBlocks4.png -------------------------------------------------------------------------------- /Squalr/Content/Images/OrangeBlocks8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/OrangeBlocks8.png -------------------------------------------------------------------------------- /Squalr/Content/Images/PlusX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/PlusX.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Previous.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Properties.png -------------------------------------------------------------------------------- /Squalr/Content/Images/PurpleBlocks1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/PurpleBlocks1.png -------------------------------------------------------------------------------- /Squalr/Content/Images/PurpleBlocks2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/PurpleBlocks2.png -------------------------------------------------------------------------------- /Squalr/Content/Images/PurpleBlocks4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/PurpleBlocks4.png -------------------------------------------------------------------------------- /Squalr/Content/Images/PurpleBlocks8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/PurpleBlocks8.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Redo.png -------------------------------------------------------------------------------- /Squalr/Content/Images/RightArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/RightArrow.png -------------------------------------------------------------------------------- /Squalr/Content/Images/RightArrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/RightArrows.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Save.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Script.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Search.png -------------------------------------------------------------------------------- /Squalr/Content/Images/SelectProcess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/SelectProcess.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Squalr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Squalr.png -------------------------------------------------------------------------------- /Squalr/Content/Images/SqualrDev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/SqualrDev.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Stop.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Unchanged.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Unchanged.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Undo.png -------------------------------------------------------------------------------- /Squalr/Content/Images/Union.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/Union.png -------------------------------------------------------------------------------- /Squalr/Content/Images/UnknownValue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/UnknownValue.png -------------------------------------------------------------------------------- /Squalr/Content/Images/X.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/Squalr/Content/Images/X.png -------------------------------------------------------------------------------- /Squalr/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Squalr.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 29 | public bool AutomaticUpdates { 30 | get { 31 | return ((bool)(this["AutomaticUpdates"])); 32 | } 33 | set { 34 | this["AutomaticUpdates"] = value; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Squalr/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | -------------------------------------------------------------------------------- /Squalr/Properties/SqualrSettings.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr 2 | { 3 | using System; 4 | 5 | /// 6 | /// A static class for interfacing with Squalr non-engine settings. 7 | /// 8 | public static class SqualrSettings 9 | { 10 | /// 11 | /// Gets or sets a value indicating whether Squalr should check for automatic updates. 12 | /// 13 | public static Boolean AutomaticUpdates 14 | { 15 | get 16 | { 17 | return Properties.Settings.Default.AutomaticUpdates; 18 | } 19 | 20 | set 21 | { 22 | Properties.Settings.Default.AutomaticUpdates = value; 23 | } 24 | } 25 | } 26 | //// End class 27 | } 28 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Controls/ControlThreadingHelper.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Controls 2 | { 3 | using System; 4 | using System.Windows.Forms; 5 | 6 | /// 7 | /// Class that allows threads outside of a windows form to update controls in the windows form. 8 | /// 9 | public static class ControlThreadingHelper 10 | { 11 | /// 12 | /// Allow for any thread to update a windows form control by passing in the control and an action to perform on the control. 13 | /// 14 | /// The control type. 15 | /// The control. 16 | /// The action to perform. 17 | public static void InvokeControlAction(T control, Action action) where T : Control 18 | { 19 | if (control.InvokeRequired) 20 | { 21 | control.Invoke(new Action(InvokeControlAction), new Object[] { control, action }); 22 | } 23 | else 24 | { 25 | action(); 26 | } 27 | } 28 | } 29 | //// End class 30 | } 31 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Controls/SortedCategory.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Controls 2 | { 3 | using Squalr.Engine.Common.Extensions; 4 | using System; 5 | using System.ComponentModel; 6 | 7 | /// 8 | /// An attribute for property viewer visible properties that should be sorted into specific categories. 9 | /// 10 | public class SortedCategory : CategoryAttribute 11 | { 12 | /// 13 | /// A non printable character used to force a string sort that causes this category to appear sorted. 14 | /// 15 | private const Char NonPrintableChar = '\t'; 16 | 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | /// The category type used to sort the property. 21 | public SortedCategory(CategoryType category) 22 | : base(category.GetDescription().PadLeft(category.GetDescription().Length + Enum.GetNames(typeof(CategoryType)).Length - (Int32)category, SortedCategory.NonPrintableChar)) 23 | { 24 | } 25 | 26 | /// 27 | /// Defines category types for items displayed in the property viewer. 28 | /// 29 | public enum CategoryType 30 | { 31 | /// 32 | /// Defines the common category type, used for properties commonly changed by users. 33 | /// 34 | [Description("Common")] 35 | Common = 1, 36 | 37 | /// 38 | /// Defines the advanced category type, used for properties changed by advanced users. 39 | /// 40 | [Description("Advanced")] 41 | Advanced = 2, 42 | } 43 | } 44 | //// End class 45 | } 46 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Controls/WinformsHostingHelper.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Controls 2 | { 3 | // using System.Windows.Forms; 4 | // using System.Windows.Forms.Integration; 5 | 6 | /// 7 | /// Helper class for embedded windows forms controls in WPF. 8 | /// 9 | public static class WinformsHostingHelper 10 | { 11 | /* 12 | /// 13 | /// Creates a windows form hosting object for a winforms control. 14 | /// 15 | /// The control to host. 16 | /// The windows forms hosting object. 17 | public static WindowsFormsHost CreateHostedControl(Control control) 18 | { 19 | WindowsFormsHost host = new WindowsFormsHost(); 20 | host.Child = control; 21 | return host; 22 | } 23 | */ 24 | } 25 | //// End class 26 | } 27 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Debugger/DebuggerViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Debugger 2 | { 3 | using Squalr.Source.Docking; 4 | using System; 5 | using System.Threading; 6 | using System.Windows.Input; 7 | 8 | /// 9 | /// View model for the Debugger. 10 | /// 11 | public class DebuggerViewModel : ToolViewModel 12 | { 13 | /// 14 | /// Singleton instance of the class. 15 | /// 16 | private static Lazy debuggerViewModelInstance = new Lazy( 17 | () => { return new DebuggerViewModel(); }, 18 | LazyThreadSafetyMode.ExecutionAndPublication); 19 | 20 | /// 21 | /// Prevents a default instance of the class from being created. 22 | /// 23 | private DebuggerViewModel() : base("Debugger") 24 | { 25 | DockingViewModel.GetInstance().RegisterViewModel(this); 26 | } 27 | 28 | /// 29 | /// Gets a command to resume execution. 30 | /// 31 | public ICommand Resume { get; private set; } 32 | 33 | /// 34 | /// Gets a singleton instance of the class. 35 | /// 36 | /// A singleton instance of the class. 37 | public static DebuggerViewModel GetInstance() 38 | { 39 | return debuggerViewModelInstance.Value; 40 | } 41 | } 42 | //// End class 43 | } 44 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Docking/PanesStyleSelector.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Docking 2 | { 3 | using System; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | 7 | /// 8 | /// Provides the style required to view a pane. 9 | /// 10 | public class PanesStyleSelector : StyleSelector 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public PanesStyleSelector() 16 | { 17 | } 18 | 19 | /// 20 | /// Gets or sets the style for generic tools. 21 | /// 22 | public Style ToolStyle { get; set; } 23 | 24 | /// 25 | /// Returns the required style to display the given view model. 26 | /// 27 | /// The view model. 28 | /// The dependency object. 29 | /// The style associated with the provided view model. 30 | public override Style SelectStyle(Object item, DependencyObject container) 31 | { 32 | if (item is ToolViewModel) 33 | { 34 | return this.ToolStyle; 35 | } 36 | 37 | return base.SelectStyle(item, container); 38 | } 39 | } 40 | //// End class 41 | } 42 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Editors/ScriptEditor/ScriptEditorModel.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Editors.ScriptEditor 2 | { 3 | using System; 4 | using System.ComponentModel; 5 | using System.Drawing.Design; 6 | using System.Windows; 7 | 8 | /// 9 | /// Type editor for scripts. 10 | /// 11 | public class ScriptEditorModel : UITypeEditor 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | public ScriptEditorModel() 17 | { 18 | } 19 | 20 | /// 21 | /// Gets the editor style. This will be Modal, as it launches a custom editor. 22 | /// 23 | /// Type descriptor context. 24 | /// Modal type editor. 25 | public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 26 | { 27 | return UITypeEditorEditStyle.Modal; 28 | } 29 | 30 | /// 31 | /// Launches the editor for this type. 32 | /// 33 | /// Type descriptor context. 34 | /// Service provider. 35 | /// The current value. 36 | /// The updated values. 37 | public override Object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value) 38 | { 39 | View.Editors.ScriptEditor scriptEditor = new View.Editors.ScriptEditor(value as String) { Owner = Application.Current.MainWindow }; 40 | 41 | if (scriptEditor.ShowDialog() == true) 42 | { 43 | return scriptEditor.ScriptEditorViewModel.Script ?? String.Empty; 44 | } 45 | 46 | return value; 47 | } 48 | } 49 | //// End class 50 | } 51 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Editors/TextEditor/TextEditorModel.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Editors.TextEditor 2 | { 3 | using System; 4 | using System.ComponentModel; 5 | using System.Drawing.Design; 6 | using System.Windows; 7 | 8 | /// 9 | /// Type editor for text. 10 | /// 11 | public class TextEditorModel : UITypeEditor 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | public TextEditorModel() 17 | { 18 | } 19 | 20 | /// 21 | /// Gets the editor style. This will be Modal, as it launches a custom editor. 22 | /// 23 | /// Type descriptor context. 24 | /// Modal type editor. 25 | public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 26 | { 27 | return UITypeEditorEditStyle.Modal; 28 | } 29 | 30 | /// 31 | /// Launches the editor for this type. 32 | /// 33 | /// Type descriptor context. 34 | /// Service provider. 35 | /// The current value. 36 | /// The updated values. 37 | public override Object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value) 38 | { 39 | View.Editors.TextEditor textEditor = new View.Editors.TextEditor(value as String) { Owner = Application.Current.MainWindow }; 40 | 41 | if (textEditor.ShowDialog() == true) 42 | { 43 | return textEditor.TextEditorViewModel.Text ?? String.Empty; 44 | } 45 | 46 | return value; 47 | } 48 | } 49 | //// End class 50 | } 51 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Mvvm/Converters/BooleanToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Mvvm.Converters 2 | { 3 | using System; 4 | using System.Windows; 5 | using System.Windows.Data; 6 | 7 | /// 8 | /// Converter class to convert a boolean to a value. 9 | /// 10 | [ValueConversion(typeof(Boolean), typeof(Visibility))] 11 | public class BooleanToVisibilityConverter : BooleanConverter 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | public BooleanToVisibilityConverter() : base(Visibility.Visible, Visibility.Collapsed) 17 | { 18 | } 19 | } 20 | //// End class 21 | } 22 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Mvvm/Converters/IsDirectoryItemConverter.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Mvvm.Converters 2 | { 3 | using Squalr.Source.ProjectExplorer.ProjectItems; 4 | using System; 5 | using System.Globalization; 6 | using System.Windows.Data; 7 | 8 | /// 9 | /// Determines if a project item is a directoryItem 10 | /// 11 | public class IsDirectoryItemConverter : IValueConverter 12 | { 13 | /// 14 | /// Converts an Icon to a BitmapSource. 15 | /// 16 | /// Value to be converted. 17 | /// Type to convert to. 18 | /// Optional conversion parameter. 19 | /// Globalization info. 20 | /// Object with type of BitmapSource. If conversion cannot take place, returns null. 21 | public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) 22 | { 23 | if (value is DirectoryItemView) 24 | { 25 | return true; 26 | } 27 | 28 | return false; 29 | } 30 | 31 | /// 32 | /// Not used or implemented. 33 | /// 34 | /// Value to be converted. 35 | /// Type to convert to. 36 | /// Optional conversion parameter. 37 | /// Globalization info. 38 | /// Throws see . 39 | public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | } 44 | //// End class 45 | } 46 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Mvvm/Converters/ValueConverterGroup.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Mvvm.Converters 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Globalization; 6 | using System.Linq; 7 | using System.Windows.Data; 8 | 9 | internal class ValueConverterGroup : List, IValueConverter 10 | { 11 | public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) 12 | { 13 | return this.Aggregate(value, (current, converter) => converter.Convert(current, targetType, parameter, culture)); 14 | } 15 | 16 | public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | } 21 | //// End class 22 | } 23 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/Mvvm/Converters/ValueToMetricSize.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Mvvm.Converters 2 | { 3 | using Squalr.Engine.Common; 4 | using System; 5 | using System.Globalization; 6 | using System.Windows.Data; 7 | 8 | /// 9 | /// Converts a size in bytes to the metric size (B, KB, MB, GB, TB, PB, EB). 10 | /// 11 | public class ValueToMetricSize : IValueConverter 12 | { 13 | /// 14 | /// Converts an Icon to a BitmapSource. 15 | /// 16 | /// Value to be converted. 17 | /// Type to convert to. 18 | /// Optional conversion parameter. 19 | /// Globalization info. 20 | /// Object with type of BitmapSource. If conversion cannot take place, returns null. 21 | public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture) 22 | { 23 | if (value == null) 24 | { 25 | return null; 26 | } 27 | 28 | return Conversions.ValueToMetricSize((UInt64)System.Convert.ChangeType(value, ScannableType.UInt64)); 29 | } 30 | 31 | /// 32 | /// Not used or implemented. 33 | /// 34 | /// Value to be converted. 35 | /// Type to convert to. 36 | /// Optional conversion parameter. 37 | /// Globalization info. 38 | /// Throws see . 39 | public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) 40 | { 41 | throw new NotImplementedException(); 42 | } 43 | } 44 | //// End class 45 | } 46 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/PacketEditor/PacketEditorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.PacketEditor 2 | { 3 | using Squalr.Source.Docking; 4 | using System; 5 | using System.Threading; 6 | 7 | /// 8 | /// View model for the Packet Editor. 9 | /// 10 | public class PacketEditorViewModel : ToolViewModel 11 | { 12 | /// 13 | /// Singleton instance of the class. 14 | /// 15 | private static Lazy packetEditorViewModelInstance = new Lazy( 16 | () => { return new PacketEditorViewModel(); }, 17 | LazyThreadSafetyMode.ExecutionAndPublication); 18 | 19 | /// 20 | /// Prevents a default instance of the class from being created. 21 | /// 22 | private PacketEditorViewModel() : base("Packet Editor") 23 | { 24 | DockingViewModel.GetInstance().RegisterViewModel(this); 25 | } 26 | 27 | /// 28 | /// Gets a singleton instance of the class. 29 | /// 30 | /// A singleton instance of the class. 31 | public static PacketEditorViewModel GetInstance() 32 | { 33 | return PacketEditorViewModel.packetEditorViewModelInstance.Value; 34 | } 35 | } 36 | //// End class 37 | } 38 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/PropertyViewer/IPropertyViewerObserver.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.PropertyViewer 2 | { 3 | using System; 4 | 5 | /// 6 | /// Interface for a class which listens for changes in the selected properties. 7 | /// 8 | public interface IPropertyViewerObserver 9 | { 10 | /// 11 | /// Recieves an update of the selected objects. 12 | /// 13 | /// The target objects being viewed. 14 | void Update(Object[] targetObjects); 15 | } 16 | //// End interface 17 | } 18 | //// End namespace -------------------------------------------------------------------------------- /Squalr/Source/SessionManager.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source 2 | { 3 | using Squalr.Engine; 4 | using Squalr.Engine.Projects; 5 | 6 | public static class SessionManager 7 | { 8 | private static Session session = new Session(null); 9 | 10 | public static Session Session 11 | { 12 | get 13 | { 14 | return SessionManager.session; 15 | } 16 | 17 | private set 18 | { 19 | SessionManager.session = value; 20 | } 21 | } 22 | 23 | public static Project Project { get; set; } 24 | } 25 | //// End class 26 | } 27 | //// End namespace 28 | -------------------------------------------------------------------------------- /Squalr/Source/Utils/Observables/Unsubscriber.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.Source.Utils.Observables 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | public class Unsubscriber : IDisposable 7 | { 8 | internal Unsubscriber(HashSet> observers, IObserver observer) 9 | { 10 | this.Observers = observers; 11 | this.Observer = observer; 12 | } 13 | 14 | private HashSet> Observers { get; set; } 15 | 16 | private IObserver Observer { get; set; } 17 | 18 | public void Dispose() 19 | { 20 | if (this.Observers.Contains(this.Observer)) 21 | { 22 | this.Observers.Remove(this.Observer); 23 | } 24 | } 25 | } 26 | //// End class 27 | } 28 | //// End namespace -------------------------------------------------------------------------------- /Squalr/View/Controls/HexDecBox.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.View.Controls 2 | { 3 | using System.Windows.Controls; 4 | 5 | /// 6 | /// Interaction logic for HexDecBox.xaml 7 | /// 8 | public partial class HexDecBox : UserControl 9 | { 10 | /// 11 | /// Initializes a new instance of the class. 12 | /// 13 | public HexDecBox() 14 | { 15 | this.InitializeComponent(); 16 | } 17 | } 18 | //// End class 19 | } 20 | //// End namespace -------------------------------------------------------------------------------- /Squalr/View/DataTemplateError.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 19 | Error loading data template! 20 | To display a new panel, be sure to update the following files in Squalr: 21 | Create a new ViewModel class that extends ToolViewModel 22 | Register the ViewModel in the constructor with DockingViewModel.GetInstance().RegisterViewModel(this); 23 | Update ViewModelLocator.cs to return the singleton instance of the class 24 | Update ViewTemplateSelector.cs to bind the viewmodel to a data template 25 | Update MainWindow.xaml and add the view template under <view:ViewTemplateSelector> 26 | 27 | -------------------------------------------------------------------------------- /Squalr/View/Dialogs/CreateProjectDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.View.Dialogs 2 | { 3 | using System; 4 | using System.Windows; 5 | 6 | /// 7 | /// Interaction logic for CreateProjectDialog.xaml. 8 | /// 9 | public partial class CreateProjectDialog : Window 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | public CreateProjectDialog() 15 | { 16 | this.InitializeComponent(); 17 | } 18 | 19 | /// 20 | /// Invoked when the added offsets are canceled. Closes the view. 21 | /// 22 | /// Sending object. 23 | /// Event args. 24 | private void CancelButtonClick(Object sender, RoutedEventArgs e) 25 | { 26 | this.DialogResult = false; 27 | this.Close(); 28 | } 29 | 30 | /// 31 | /// Invoked when the added offsets are accepted. Closes the view. 32 | /// 33 | /// Sending object. 34 | /// Event args. 35 | private void AcceptButtonClick(Object sender, RoutedEventArgs e) 36 | { 37 | this.DialogResult = true; 38 | this.Close(); 39 | } 40 | } 41 | //// End class 42 | } 43 | //// End namespace -------------------------------------------------------------------------------- /Squalr/View/Dialogs/DeleteProjectDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.View.Dialogs 2 | { 3 | using System; 4 | using System.Windows; 5 | 6 | /// 7 | /// Interaction logic for DeleteProjectDialog.xaml. 8 | /// 9 | public partial class DeleteProjectDialog : Window 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | public DeleteProjectDialog() 15 | { 16 | this.InitializeComponent(); 17 | } 18 | 19 | /// 20 | /// Invoked when the added offsets are canceled. Closes the view. 21 | /// 22 | /// Sending object. 23 | /// Event args. 24 | private void CancelButtonClick(Object sender, RoutedEventArgs e) 25 | { 26 | this.DialogResult = false; 27 | this.Close(); 28 | } 29 | 30 | /// 31 | /// Invoked when the added offsets are accepted. Closes the view. 32 | /// 33 | /// Sending object. 34 | /// Event args. 35 | private void AcceptButtonClick(Object sender, RoutedEventArgs e) 36 | { 37 | this.DialogResult = true; 38 | this.Close(); 39 | } 40 | } 41 | //// End class 42 | } 43 | //// End namespace -------------------------------------------------------------------------------- /Squalr/View/Dialogs/RenameProjectDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.View.Dialogs 2 | { 3 | using System; 4 | using System.Windows; 5 | 6 | /// 7 | /// Interaction logic for RenameProjectDialog.xaml. 8 | /// 9 | public partial class RenameProjectDialog : Window 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | public RenameProjectDialog() 15 | { 16 | this.InitializeComponent(); 17 | } 18 | 19 | /// 20 | /// Invoked when the added offsets are canceled. Closes the view. 21 | /// 22 | /// Sending object. 23 | /// Event args. 24 | private void CancelButtonClick(Object sender, RoutedEventArgs e) 25 | { 26 | this.DialogResult = false; 27 | this.Close(); 28 | } 29 | 30 | /// 31 | /// Invoked when the added offsets are accepted. Closes the view. 32 | /// 33 | /// Sending object. 34 | /// Event args. 35 | private void AcceptButtonClick(Object sender, RoutedEventArgs e) 36 | { 37 | this.DialogResult = true; 38 | this.Close(); 39 | } 40 | } 41 | //// End class 42 | } 43 | //// End namespace -------------------------------------------------------------------------------- /Squalr/View/Dialogs/TwoChoiceDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.View.Dialogs 2 | { 3 | using System; 4 | using System.Windows; 5 | 6 | /// 7 | /// Interaction logic for TwoChoiceDialog.xaml. 8 | /// 9 | public partial class TwoChoiceDialog : Window 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | public TwoChoiceDialog() 15 | { 16 | this.InitializeComponent(); 17 | } 18 | 19 | /// 20 | /// Invoked when the added offsets are canceled. Closes the view. 21 | /// 22 | /// Sending object. 23 | /// Event args. 24 | private void CancelButtonClick(Object sender, RoutedEventArgs e) 25 | { 26 | this.DialogResult = false; 27 | this.Close(); 28 | } 29 | 30 | /// 31 | /// Invoked when the added offsets are accepted. Closes the view. 32 | /// 33 | /// Sending object. 34 | /// Event args. 35 | private void AcceptButtonClick(Object sender, RoutedEventArgs e) 36 | { 37 | this.DialogResult = true; 38 | this.Close(); 39 | } 40 | } 41 | //// End class 42 | } 43 | //// End namespace -------------------------------------------------------------------------------- /Squalr/View/LayoutInitializer.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.View 2 | { 3 | using AvalonDock.Layout; 4 | using System; 5 | using System.Linq; 6 | 7 | public class LayoutInitializer : ILayoutUpdateStrategy 8 | { 9 | public Boolean BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer) 10 | { 11 | // AD wants to add the anchorable into destinationContainer just for test provide a new anchorablepane if the pane is floating let the manager go ahead 12 | LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane; 13 | if (destinationContainer != null && destinationContainer.FindParent() != null) 14 | { 15 | return false; 16 | } 17 | 18 | LayoutAnchorablePane toolsPane = layout.Descendents().OfType().FirstOrDefault(d => d.Name == "ToolsPane"); 19 | 20 | if (toolsPane != null) 21 | { 22 | toolsPane.Children.Add(anchorableToShow); 23 | 24 | return true; 25 | } 26 | 27 | return false; 28 | } 29 | 30 | public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown) 31 | { 32 | } 33 | 34 | public Boolean BeforeInsertDocument(LayoutRoot layout, LayoutDocument anchorableToShow, ILayoutContainer destinationContainer) 35 | { 36 | return false; 37 | } 38 | 39 | public void AfterInsertDocument(LayoutRoot layout, LayoutDocument anchorableShown) 40 | { 41 | } 42 | } 43 | //// End class 44 | } 45 | //// End namespace -------------------------------------------------------------------------------- /Squalr/View/MemoryViewer.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace Squalr.View 2 | { 3 | using System; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | 7 | /// 8 | /// A memory viewer user control. 9 | /// 10 | public partial class MemoryViewer : UserControl 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public MemoryViewer() 16 | { 17 | this.InitializeComponent(); 18 | } 19 | 20 | private void HexEditorSizeChanged(Object sender, SizeChangedEventArgs e) 21 | { 22 | const Double AddressColumnSize = 64.0; // True for 8 byte addresses 23 | const Double SeperationBufferSize = 30.0; 24 | const Double HexColumnSize = 168.0; 25 | const Double AsciiColumnSize = 86.0; 26 | 27 | Double width = e.NewSize.Width - AddressColumnSize - SeperationBufferSize; 28 | Double sections = width / (HexColumnSize + AsciiColumnSize); 29 | Int32 sectionsRounded = Math.Clamp((Int32)sections, 1, 8); 30 | 31 | this.hexEditor.BytePerLine = sectionsRounded * 8; 32 | } 33 | } 34 | //// End class 35 | } 36 | //// End namespace -------------------------------------------------------------------------------- /Squalr/View/PropertyViewer.xaml: -------------------------------------------------------------------------------- 1 |  13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Squalr/View/Styles/Button.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 35 | -------------------------------------------------------------------------------- /Squalr/View/Styles/ContextMenu.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 25 | -------------------------------------------------------------------------------- /Squalr/View/Styles/Separator.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 12 | 13 | 26 | 27 | 40 | 41 | -------------------------------------------------------------------------------- /SqualrStream/App.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SqualrStream/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace SqualrStream 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SqualrStream/Content/ChangeLog.tt: -------------------------------------------------------------------------------- 1 | <#@ template language="C#" #> 2 | <#@ assembly name="System.Core" #> 3 | <#@ import namespace="System.Linq" #> 4 | <#@ import namespace="System.Text" #> 5 | <#@ import namespace="System.Text" #> 6 | <#@ import namespace="System.Collections.Generic" #> 7 | <#@ import namespace="SqualrStream" #> 8 | - Changelog updates (ironically) -------------------------------------------------------------------------------- /SqualrStream/Content/Images/AppIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Squalr/Squalr-Sharp/4584da620c6a0b2e1d537969a0a87d6fb6d6a648/SqualrStream/Content/Images/AppIcon.ico -------------------------------------------------------------------------------- /SqualrStream/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SqualrStream.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("{}")] 29 | public string AccessTokens { 30 | get { 31 | return ((string)(this["AccessTokens"])); 32 | } 33 | set { 34 | this["AccessTokens"] = value; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SqualrStream/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | {} 7 | 8 | 9 | -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Exceptions/NotFoundException.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Exceptions 2 | { 3 | using System; 4 | 5 | internal class NotFoundException : Exception 6 | { 7 | public NotFoundException(String uri) : base("Requested Resource not Found: " + uri) 8 | { 9 | } 10 | } 11 | //// End class 12 | } 13 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Exceptions/ResponseStatusException.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Exceptions 2 | { 3 | using RestSharp; 4 | using System; 5 | 6 | internal class ResponseStatusException : Exception 7 | { 8 | public ResponseStatusException(IRestResponse response) : base( 9 | "Status: " + response.ResponseStatus.ToString() + 10 | response.ErrorException != null ? (Environment.NewLine + "Exception: " + response.ErrorException) : String.Empty + 11 | response.ErrorMessage != null ? (Environment.NewLine + "Message: " + response.ErrorMessage) : String.Empty) 12 | { 13 | } 14 | } 15 | //// End class 16 | } 17 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Exceptions/StatusException.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Exceptions 2 | { 3 | using System; 4 | using System.Net; 5 | 6 | internal class StatusException : Exception 7 | { 8 | public StatusException(Uri uri, HttpStatusCode statusCode) : base( 9 | "URL: " + uri?.ToString() + Environment.NewLine + 10 | "Status: " + statusCode.ToString()) 11 | { 12 | } 13 | } 14 | //// End class 15 | } 16 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/AccessTokens.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [DataContract] 7 | public class AccessTokens 8 | { 9 | public AccessTokens() 10 | { 11 | } 12 | 13 | [DataMember(Name = "access_token")] 14 | public String AccessToken { get; set; } 15 | 16 | [DataMember(Name = "refresh_token")] 17 | public String RefreshToken { get; set; } 18 | } 19 | //// End class 20 | } 21 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/CheatVotes.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [DataContract] 7 | public class CheatVotes 8 | { 9 | public CheatVotes() 10 | { 11 | } 12 | 13 | [DataMember(Name = "cheat_id")] 14 | public Int32 CheatId { get; set; } 15 | 16 | [DataMember(Name = "vote_count")] 17 | public Int32 VoteCount { get; set; } 18 | } 19 | //// End class 20 | } 21 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/Game.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [DataContract] 7 | public class Game 8 | { 9 | public Game() 10 | { 11 | } 12 | 13 | [DataMember(Name = "id")] 14 | public Int32 GameId { get; set; } 15 | 16 | [DataMember(Name = "game_name")] 17 | public String GameName { get; set; } 18 | 19 | [DataMember(Name = "game_mode")] 20 | public Int32 GameMode { get; set; } 21 | } 22 | //// End class 23 | } 24 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/LibraryCheats.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System.Runtime.Serialization; 4 | 5 | [DataContract] 6 | [KnownType(typeof(Cheat))] 7 | public class LibraryCheats 8 | { 9 | public LibraryCheats() 10 | { 11 | } 12 | 13 | [DataMember(Name = "cheats_in_library")] 14 | public Cheat[] CheatsInLibrary { get; set; } 15 | 16 | [DataMember(Name = "cheats_available")] 17 | public Cheat[] CheatsAvailable { get; set; } 18 | } 19 | //// End class 20 | } 21 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/OverlayMeta.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [DataContract] 7 | public class OverlayMeta 8 | { 9 | public OverlayMeta() 10 | { 11 | } 12 | 13 | public OverlayMeta(Int32 cheatId, Single cooldown, Single duration) 14 | { 15 | this.CheatId = cheatId; 16 | this.Cooldown = cooldown; 17 | this.Duration = duration; 18 | } 19 | 20 | [DataMember(Name = "cheat_id")] 21 | public Int32 CheatId { get; set; } 22 | 23 | [DataMember(Name = "cooldown")] 24 | public Single Cooldown { get; set; } 25 | 26 | [DataMember(Name = "duration")] 27 | public Single Duration { get; set; } 28 | } 29 | //// End class 30 | } 31 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/StoreCheats.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System.Runtime.Serialization; 4 | 5 | [DataContract] 6 | [KnownType(typeof(Cheat))] 7 | public class StoreCheats 8 | { 9 | public StoreCheats() 10 | { 11 | } 12 | 13 | [DataMember(Name = "locked_cheats")] 14 | public Cheat[] LockedCheats { get; set; } 15 | 16 | [DataMember(Name = "unlocked_cheats")] 17 | public Cheat[] UnlockedCheats { get; set; } 18 | } 19 | //// End class 20 | } 21 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/StreamIcon.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using SqualrCore.Source.Utils; 4 | using System; 5 | using System.Drawing; 6 | using System.Runtime.Serialization; 7 | using System.Windows.Media.Imaging; 8 | 9 | [DataContract] 10 | public class StreamIcon 11 | { 12 | /// 13 | /// 14 | /// 15 | public StreamIcon() 16 | { 17 | } 18 | 19 | /// 20 | /// Gets the icon associated with this process. 21 | /// 22 | public BitmapImage Icon { get; private set; } 23 | 24 | /// 25 | /// Gets the icon associated with this process. 26 | /// 27 | [DataMember(Name = "icon_name")] 28 | public String IconName { get; private set; } 29 | 30 | /// 31 | /// Gets the keywords for this icon. 32 | /// 33 | [DataMember(Name = "keywords")] 34 | public String[] Keywords { get; private set; } 35 | 36 | /// 37 | /// Gets or sets the base 64 of the icon. 38 | /// 39 | [DataMember(Name = "icon_base_64")] 40 | private String IconBase64 { get; set; } 41 | 42 | /// 43 | /// Invoked when this object is deserialized. 44 | /// 45 | /// Streaming context. 46 | [OnDeserialized] 47 | public void OnDeserialized(StreamingContext streamingContext) 48 | { 49 | this.Icon = ImageUtils.BitmapToBitmapImage(ImageUtils.LoadSvg(this.IconBase64, 64, 64, Color.White)); 50 | } 51 | } 52 | //// End class 53 | } 54 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/UnlockedCheat.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [DataContract] 7 | [KnownType(typeof(Cheat))] 8 | public class UnlockedCheat 9 | { 10 | public UnlockedCheat() 11 | { 12 | } 13 | 14 | [DataMember(Name = "cheat")] 15 | public Cheat Cheat { get; set; } 16 | 17 | [DataMember(Name = "remaining_coins")] 18 | public Int32 RemainingCoins { get; set; } 19 | } 20 | //// End class 21 | } 22 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/User.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [DataContract] 7 | public class User 8 | { 9 | public User() 10 | { 11 | } 12 | 13 | [DataMember(Name = "coins")] 14 | public Int32 Coins { get; set; } 15 | 16 | [DataMember(Name = "name")] 17 | public String Name { get; set; } 18 | 19 | [DataMember(Name = "displayName")] 20 | public String DisplayName { get; set; } 21 | 22 | [DataMember(Name = "email")] 23 | public String Email { get; set; } 24 | } 25 | //// End class 26 | } 27 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/Models/Vote.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api.Models 2 | { 3 | using System; 4 | using System.Runtime.Serialization; 5 | 6 | [DataContract] 7 | public class Vote 8 | { 9 | public Vote() 10 | { 11 | } 12 | 13 | [DataMember(Name = "coins")] 14 | public Int32 Coins { get; set; } 15 | 16 | [DataMember(Name = "name")] 17 | public String Name { get; set; } 18 | 19 | [DataMember(Name = "displayName")] 20 | public String DisplayName { get; set; } 21 | 22 | [DataMember(Name = "email")] 23 | public String Email { get; set; } 24 | } 25 | //// End class 26 | } 27 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Api/PingClient.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Api 2 | { 3 | using System; 4 | using System.Net; 5 | 6 | /// 7 | /// Class for pinging a url to check if it exists. 8 | /// 9 | internal class PingClient : WebClient 10 | { 11 | /// 12 | /// Pings the given endpoint. 13 | /// 14 | /// The endpoint to ping. 15 | public void Ping(String endpoint) 16 | { 17 | this.DownloadString(endpoint); 18 | } 19 | 20 | /// 21 | /// Override of to replace the request method with HEAD. 22 | /// 23 | /// The uri endpoint. 24 | /// The web request. 25 | protected override WebRequest GetWebRequest(Uri address) 26 | { 27 | WebRequest request = base.GetWebRequest(address); 28 | 29 | request.Method = "HEAD"; 30 | 31 | return request; 32 | } 33 | } 34 | //// End class 35 | } 36 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Editors/StreamIconEditor/IStreamIconsLoadedObserver.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Editors.StreamIconEditor 2 | { 3 | using SqualrStream.Source.Api.Models; 4 | using System.Collections.Generic; 5 | 6 | /// 7 | /// Interface for a class which listens for changes in the loading of the stream icons. 8 | /// 9 | public interface IStreamIconsLoadedObserver 10 | { 11 | /// 12 | /// Recieves a notification of the loaded stream icons. 13 | /// 14 | /// The loaded stream icons. 15 | void Update(IEnumerable streamIcons); 16 | } 17 | //// End interface 18 | } 19 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Library/CheatUpdateTask.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Stream 2 | { 3 | using SqualrCore.Source.ActionScheduler; 4 | using System; 5 | using System.Threading; 6 | 7 | /// 8 | /// Task to update cheats. 9 | /// 10 | internal class CheatUpdateTask : ScheduledTask 11 | { 12 | /// 13 | /// The interval in milliseconds between refreshes. 14 | /// 15 | private const Int32 RefreshInterval = 50; 16 | 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | public CheatUpdateTask(Action updateAction) : base(taskName: "Cheat Updater", isRepeated: true, trackProgress: false) 21 | { 22 | this.UpdateAction = updateAction; 23 | this.UpdateInterval = CheatUpdateTask.RefreshInterval; 24 | 25 | this.Start(); 26 | } 27 | 28 | /// 29 | /// Gets or sets the refresh action. 30 | /// 31 | private Action UpdateAction { get; set; } 32 | 33 | /// 34 | /// Called when the scheduled task starts. 35 | /// 36 | protected override void OnBegin() 37 | { 38 | } 39 | 40 | /// 41 | /// Called when the scheduled task is updated. 42 | /// 43 | /// The cancellation token for handling canceled tasks. 44 | protected override void OnUpdate(CancellationToken cancellationToken) 45 | { 46 | this.UpdateAction(); 47 | } 48 | 49 | /// 50 | /// Called when the repeated task completes. 51 | /// 52 | protected override void OnEnd() 53 | { 54 | } 55 | } 56 | //// End class 57 | } 58 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Navigation/INavigable.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Navigation 2 | { 3 | internal interface INavigable 4 | { 5 | void OnNavigate(NavigationPage browsePage); 6 | } 7 | //// End interface 8 | } 9 | //// End namespace 10 | -------------------------------------------------------------------------------- /SqualrStream/Source/Navigation/NavigationPage.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Navigation 2 | { 3 | /// 4 | /// An enum of the possible views for the Browse view. 5 | /// 6 | public enum NavigationPage 7 | { 8 | /// 9 | /// No page 10 | /// 11 | None, 12 | 13 | /// 14 | /// The login view. 15 | /// 16 | Login, 17 | 18 | /// 19 | /// The game select view. 20 | /// 21 | GameSelect, 22 | 23 | /// 24 | /// The library select view. 25 | /// 26 | LibrarySelect, 27 | 28 | /// 29 | /// The library select view. 30 | /// 31 | LibraryEdit, 32 | } 33 | //// End enum 34 | } 35 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/Source/Stream/StreamVotePollTask.cs: -------------------------------------------------------------------------------- 1 | namespace SqualrStream.Source.Stream 2 | { 3 | using SqualrCore.Source.ActionScheduler; 4 | using System; 5 | using System.Threading; 6 | 7 | /// 8 | /// Task to poll for the current cheat votes. 9 | /// 10 | internal class StreamVotePollTask : ScheduledTask 11 | { 12 | /// 13 | /// The interval between refreshes. 14 | /// 15 | private const Int32 RefreshInterval = 5000; 16 | 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | public StreamVotePollTask(Action updateAction) : base(taskName: "Stream Vote Poll", isRepeated: true, trackProgress: false) 21 | { 22 | this.UpdateAction = updateAction; 23 | this.UpdateInterval = StreamVotePollTask.RefreshInterval; 24 | 25 | this.Start(); 26 | } 27 | 28 | /// 29 | /// Gets or sets the refresh action. 30 | /// 31 | private Action UpdateAction { get; set; } 32 | 33 | /// 34 | /// Called when the scheduled task starts. 35 | /// 36 | protected override void OnBegin() 37 | { 38 | } 39 | 40 | /// 41 | /// Called when the scheduled task is updated. 42 | /// 43 | /// The cancellation token for handling canceled tasks. 44 | protected override void OnUpdate(CancellationToken cancellationToken) 45 | { 46 | this.UpdateAction(); 47 | } 48 | 49 | /// 50 | /// Called when the repeated task completes. 51 | /// 52 | protected override void OnEnd() 53 | { 54 | } 55 | } 56 | //// End class 57 | } 58 | //// End namespace -------------------------------------------------------------------------------- /SqualrStream/View/Login/LoginHome.xaml: -------------------------------------------------------------------------------- 1 |  14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /SqualrStream/View/Login/TwitchLoginPage.xaml: -------------------------------------------------------------------------------- 1 |  21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /SqualrStream/View/Store/StoreHome.xaml: -------------------------------------------------------------------------------- 1 |  17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /SqualrStream/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Tests/SqualrTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("SqualrTests")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("SqualrTests")] 12 | [assembly: AssemblyCopyright("Copyright © 2016")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("38366488-8632-48e5-9519-af2e1f0808b9")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | --------------------------------------------------------------------------------