From d60d5b98d4a290ad64cdb97c293dbabe019043df Mon Sep 17 00:00:00 2001 From: retr0volkov Date: Sat, 19 Sep 2026 16:13:20 +0300 Subject: [PATCH] Initial commit --- .gitignore | 365 ++++++++++++++++++ App.xaml | 17 + App.xaml.cs | 69 ++++ Assets/LockScreenLogo.scale-200.png | Bin 0 -> 432 bytes Assets/SplashScreen.scale-200.png | Bin 0 -> 5372 bytes Assets/Square150x150Logo.scale-200.png | Bin 0 -> 1755 bytes Assets/Square44x44Logo.scale-200.png | Bin 0 -> 637 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 283 bytes Assets/StoreLogo.png | Bin 0 -> 456 bytes Assets/Wide310x150Logo.scale-200.png | Bin 0 -> 2097 bytes Converters/MemoryAddressConverter.cs | 61 +++ Hack/Hack.xaml | 157 ++++++++ Hack/Hack.xaml.cs | 52 +++ IPClab3.csproj | 73 ++++ IPClab3.slnx | 13 + MainWindow.xaml | 25 ++ MainWindow.xaml.cs | 38 ++ Models/ProcessItem.cs | 19 + Package.appxmanifest | 53 +++ Properties/launchSettings.json | 10 + Services/FilePickerService.cs | 22 ++ Services/ProcessHackerService.cs | 68 ++++ ViewModels/MainWindowViewModel.cs | 217 +++++++++++ app.manifest | 19 + 24 files changed, 1278 insertions(+) create mode 100644 .gitignore create mode 100644 App.xaml create mode 100644 App.xaml.cs create mode 100644 Assets/LockScreenLogo.scale-200.png create mode 100644 Assets/SplashScreen.scale-200.png create mode 100644 Assets/Square150x150Logo.scale-200.png create mode 100644 Assets/Square44x44Logo.scale-200.png create mode 100644 Assets/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 Assets/StoreLogo.png create mode 100644 Assets/Wide310x150Logo.scale-200.png create mode 100644 Converters/MemoryAddressConverter.cs create mode 100644 Hack/Hack.xaml create mode 100644 Hack/Hack.xaml.cs create mode 100644 IPClab3.csproj create mode 100644 IPClab3.slnx create mode 100644 MainWindow.xaml create mode 100644 MainWindow.xaml.cs create mode 100644 Models/ProcessItem.cs create mode 100644 Package.appxmanifest create mode 100644 Properties/launchSettings.json create mode 100644 Services/FilePickerService.cs create mode 100644 Services/ProcessHackerService.cs create mode 100644 ViewModels/MainWindowViewModel.cs create mode 100644 app.manifest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0cd31f --- /dev/null +++ b/.gitignore @@ -0,0 +1,365 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +onnx-models \ No newline at end of file diff --git a/App.xaml b/App.xaml new file mode 100644 index 0000000..2047e09 --- /dev/null +++ b/App.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/App.xaml.cs b/App.xaml.cs new file mode 100644 index 0000000..7aaafc5 --- /dev/null +++ b/App.xaml.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using IPClab3.Services; +using IPClab3.ViewModels; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Microsoft.UI.Xaml.Shapes; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace IPClab3; +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : Application +{ + public static IServiceProvider Services + { + get; + private set; + } + private Window? _window; + + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + InitializeComponent(); + Services = ConfigureServices(); + } + + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + _window = Services.GetRequiredService(); + _window.Activate(); + } + + private static ServiceProvider ConfigureServices() + { + var services = new ServiceCollection(); + + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + return services.BuildServiceProvider(); + } +} diff --git a/Assets/LockScreenLogo.scale-200.png b/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..7440f0d4bf7c7e26e4e36328738c68e624ee851e GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(FqV6|IEGZ*x-#9g>~Mkr+x6^F zy~CDX2QIMs&Gcs3RnRBoxBA!*(Mfw0KTCYuYk0WlEIV>qBmPl! zq4ukrvfADX@#p8fbLY(H47N+k`FZ(FZh?cDro7>{8mkBO3>^oaIx`3!Jl)Qq)HI!+ z(S=1{o~eT)&W^=Ea8C`-17(Jv5(nHFJ{dOjGdxLVkY_y6&S1whfuFI4MM0kF0f&cO zPDVpV%nz;Id$>+0Ga5e9625-JcI)oq=#Pa3p^>8BB}21BUw@eN!-6@w%X+^`+Vn?! zryu|3T>kVWNBYyBc=7Y6H#s1Ah!OI_nezW zXTqOdkv2Az6KKBV=$yHdF^R3Fqw(TZEoNSZX>reXJ#bwX42%f|Pgg&ebxsLQ010xn AssI20 literal 0 HcmV?d00001 diff --git a/Assets/SplashScreen.scale-200.png b/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..32f486a86792a5e34cd9a8261b394c49b48f86be GIT binary patch literal 5372 zcmd5=Z){Ul6u)iv53sCbIJKLzl(EF%0tzcEY@|pLrfgF~2Dk$KFtU+$kbYq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png b/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..f713bba67f551ef91020b75716a4dc8ebd744b1c GIT binary patch literal 637 zcmeAS@N?(olHy`uVBq!ia0vp^5g^RL1|$oo8kjIJFu8cTIEGZ*dUI*J;2{SImxtDO zm%3!R$UazoY}x{$j0P5ABYXWr(l=jxJ6ps1W{tV=^>{Dl><3nv3A}sm=EZ)#l3`NR zpZda3^rNox*D1%NC98Z~L*6zipLw~Gxn&(Y-;KmJ+aR6eLabU-L#y8HW%7P-E_-VlLqIabbHPHKT*)fT@9iWJ7iWgOT9%0}Lrj>lztPxWq6sPw3pi z#-<=#$jjrP_DD*i!RLsn0mIA=>4~N)IMYWIf=j%-zuKCdMG%tHYot70D1| zvWa0wMhauW#S>1CnI_;>!1Q3zMA17@DOVq{MQ+{U7^a&yA+%dMCG;WNPV0i;w$tu; zX^b}UKziPM)(<;)ruW;-`)bBN+rQNM*Zs_>?n$|FVFo-e*PZb*@U7VAd+tHb4e?=Blc~}S6K)wL}r*Gf`BM#QB z+y>N$mCswb4d{^{S9v_!eQj4fTRMOwOCi?lSk9%<=vAz}jM-*PQtH@Odn1LZcd^j#o> hW$4xn+CT+ep9lJ{OAO?njobhL002ovPDHLkV1nYebbkN< literal 0 HcmV?d00001 diff --git a/Assets/StoreLogo.png b/Assets/StoreLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..a4586f26bdf7841cad10f39cdffe2aca3af252c1 GIT binary patch literal 456 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2o;fF!p=8IEGZ*dUM0H=rDtTTVkd2 z(%lbKn@VS_lUaADVB&;Z6F#LM+mPsa?e>FnHo;HND^!P`-lX%BH~FOg%y&x+t*x!? zg$#_1A1kgsSvO(fw`bOmo;lrJX8byO1j^gf7qohR%mmt z@L)WX;>gqgK|tWJvQ5j;4;=gt4HXVKSMYRv5RhY5vS~TqfK_NAP*r{h!!g^BZ;w4r z7CGdsai)y;fJQc`7{Z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CrzXGTrZ@;GF>596)00d&n@&Et; literal 0 HcmV?d00001 diff --git a/Converters/MemoryAddressConverter.cs b/Converters/MemoryAddressConverter.cs new file mode 100644 index 0000000..0d7a333 --- /dev/null +++ b/Converters/MemoryAddressConverter.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Markup; + +namespace IPClab3.Converters; + +public class MemoryAddressConverter : IValueConverter +{ + + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value is IntPtr ptr) + { + if (ptr == IntPtr.Zero) + return "0x0"; + + ulong numericAddress = (ulong)ptr; + + // Format dynamically: 8 digits for 32-bit (x86), 16 digits for 64-bit (x64) + string hexFormat = IntPtr.Size == 4 ? "X8" : "X16"; + return $"0x{numericAddress.ToString(hexFormat, CultureInfo.InvariantCulture)}"; + } + + return "0x0"; + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + if (value is string addressStr) + { + if (string.IsNullOrWhiteSpace(addressStr)) + return IntPtr.Zero; + + string cleanInput = addressStr.Trim(); + if (cleanInput.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) + { + cleanInput = cleanInput.Substring(2); + } + + if (!ulong.TryParse(cleanInput, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong numericAddress)) + { + return IntPtr.Zero; + } + + // Architecture safety overflow check + if (IntPtr.Size == 4 && numericAddress > uint.MaxValue) + { + return IntPtr.Zero; + } + + return (IntPtr)numericAddress; + } + + return IntPtr.Zero; + } +} \ No newline at end of file diff --git a/Hack/Hack.xaml b/Hack/Hack.xaml new file mode 100644 index 0000000..c04ecd7 --- /dev/null +++ b/Hack/Hack.xaml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Hack/Hack.xaml.cs b/Hack/Hack.xaml.cs new file mode 100644 index 0000000..c938c16 --- /dev/null +++ b/Hack/Hack.xaml.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using IPClab3.Models; +using IPClab3.ViewModels; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace IPClab3.Hack; + +public sealed partial class Hack : UserControl +{ + public MainWindowViewModel ViewModel; + public Window window; + public Hack() + { + InitializeComponent(); + } + + private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) + { + ViewModel.SelectedProcess = (ProcessItem)args.SelectedItem; + } + + private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) + { + if (ViewModel.SelectedProcess?.ProcessName != sender.Text) + ViewModel.SelectedProcess = null; + } + + private void Button_PointerEntered(object sender, PointerRoutedEventArgs e) + { + ViewModel.AttachProcessCommand.NotifyCanExecuteChanged(); + } + + private async void Button_Click(object sender, RoutedEventArgs e) + { + await ViewModel.PickFile(WinRT.Interop.WindowNative.GetWindowHandle(window)); + } +} diff --git a/IPClab3.csproj b/IPClab3.csproj new file mode 100644 index 0000000..aee6631 --- /dev/null +++ b/IPClab3.csproj @@ -0,0 +1,73 @@ + + + WinExe + net8.0-windows10.0.19041.0 + 10.0.17763.0 + IPClab3 + app.manifest + x86;x64;ARM64 + win-x86;win-x64;win-arm64 + win-$(Platform).pubxml + true + false + true + enable + None + true + true + 14.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + + + + + + + true + + + + + False + True + False + True + + \ No newline at end of file diff --git a/IPClab3.slnx b/IPClab3.slnx new file mode 100644 index 0000000..08ca457 --- /dev/null +++ b/IPClab3.slnx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/MainWindow.xaml b/MainWindow.xaml new file mode 100644 index 0000000..a353933 --- /dev/null +++ b/MainWindow.xaml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs new file mode 100644 index 0000000..dd14e60 --- /dev/null +++ b/MainWindow.xaml.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using System.Threading.Tasks; +using IPClab3.Models; +using IPClab3.ViewModels; +using Microsoft.UI; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace IPClab3; +/// +/// An empty window that can be used on its own or navigated to within a Frame. +/// +public sealed partial class MainWindow : Window +{ + public MainWindow(MainWindowViewModel viewModel) + { + InitializeComponent(); + yeag.ViewModel = viewModel; + yeag.window = this; + ExtendsContentIntoTitleBar = true; + SetTitleBar(AppTitleBar); + AppWindow.Resize(new Windows.Graphics.SizeInt32(550, 850)); + } +} diff --git a/Models/ProcessItem.cs b/Models/ProcessItem.cs new file mode 100644 index 0000000..2a5f068 --- /dev/null +++ b/Models/ProcessItem.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IPClab3.Models; + +public class ProcessItem +{ + public int Pid + { + get; set; + } + public string ProcessName + { + get; set; + } +} \ No newline at end of file diff --git a/Package.appxmanifest b/Package.appxmanifest new file mode 100644 index 0000000..4822926 --- /dev/null +++ b/Package.appxmanifest @@ -0,0 +1,53 @@ + + + + + + + + + + IPClab3 + retrd + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..c1ba016 --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "IPClab3 (Package)": { + "commandName": "MsixPackage" + }, + "IPClab3 (Unpackaged)": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/Services/FilePickerService.cs b/Services/FilePickerService.cs new file mode 100644 index 0000000..fec824c --- /dev/null +++ b/Services/FilePickerService.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.Storage.Pickers; + +namespace IPClab3.Services; + +public class FilePickerService +{ + public async Task RequestFileOpener(IntPtr hwnd) + { + var picker = new FileOpenPicker(); + picker.FileTypeFilter.Add(".exe"); + + WinRT.Interop.InitializeWithWindow.Initialize(picker, hwnd); + + var file = await picker.PickSingleFileAsync(); + return file?.Path; + } +} \ No newline at end of file diff --git a/Services/ProcessHackerService.cs b/Services/ProcessHackerService.cs new file mode 100644 index 0000000..991c4e2 --- /dev/null +++ b/Services/ProcessHackerService.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace IPClab3.Services; + +public partial class ProcessHackerService +{ + private IntPtr _processHandle; + + const int PROCESS_VM_READ = 0x0010; + const int PROCESS_VM_WRITE = 0x0020; + const int PROCESS_VM_OPERATION = 0x0008; + + [LibraryImport("kernel32.dll", SetLastError = true)] + public static partial IntPtr OpenProcess(int dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId); + + [LibraryImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static partial bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int dwSize, out IntPtr lpNumberOfBytesRead); + + [LibraryImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static partial bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, int dwSize, out IntPtr lpNumberOfBytesWritten); + + [LibraryImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static partial bool CloseHandle(IntPtr hObject); + + public int StartProcess(string target) + { + var process = Process.Start(target); + CloseHandle(_processHandle); + _processHandle = OpenProcess(process.Id); + return process.Id; + } + + public int AttachProcess(int pid) + { + CloseHandle(_processHandle); + _processHandle = OpenProcess(pid); + return pid; + } + + private IntPtr OpenProcess(int pid) + { + return OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, false, pid); + } + + public bool ReadMemory(IntPtr address, int size, out byte[] bytes) + { + var buffer = new byte[size]; + var result = ReadProcessMemory(_processHandle, address, buffer, buffer.Length, out var bytesRead); + bytes = buffer; + return result; + } + + public bool WriteMemory(IntPtr address, string newMemory) + { + var newBytes = Encoding.UTF8.GetBytes(newMemory + "\0"); + var result = WriteProcessMemory(_processHandle, address, newBytes, newBytes.Length, out var bytesWritten); + return result; + } +} diff --git a/ViewModels/MainWindowViewModel.cs b/ViewModels/MainWindowViewModel.cs new file mode 100644 index 0000000..6cd5bbd --- /dev/null +++ b/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,217 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using IPClab3.Models; +using IPClab3.Services; + +namespace IPClab3.ViewModels; + +public partial class MainWindowViewModel(ProcessHackerService processHackerService, FilePickerService filePickerService) : ObservableObject +{ + private ProcessHackerService _processHackerService = processHackerService; + private FilePickerService _filePickerService = filePickerService; + + private CancellationTokenSource _cts; + private List _allProcesses; + + [ObservableProperty] + private ObservableCollection _suggestions = []; + + private string _searchText = string.Empty; + public string SearchText + { + get => _searchText; + set + { + if (SetProperty(ref _searchText, value)) + { + _ = UpdateSuggestionsAsync(value); + } + } + } + + [ObservableProperty] + [NotifyCanExecuteChangedFor(nameof(AttachProcessCommand))] + public partial ProcessItem SelectedProcess + { + get; + set; + } + + [ObservableProperty] + [NotifyCanExecuteChangedFor(nameof(ReadMemoryCommand))] + [NotifyCanExecuteChangedFor(nameof(WriteMemoryCommand))] + public partial int StartedPid + { + get; + set; + } + + [ObservableProperty] + [NotifyCanExecuteChangedFor(nameof(ReadMemoryCommand))] + [NotifyCanExecuteChangedFor(nameof(WriteMemoryCommand))] + public partial IntPtr MemoryAddress + { + get; + set; + } + + private async Task UpdateSuggestionsAsync(string query) + { + // 1. Cancel the previous running search task immediately + _cts?.Cancel(); + _cts?.Dispose(); + _cts = new CancellationTokenSource(); + var token = _cts.Token; + + if (string.IsNullOrWhiteSpace(query)) + { + Suggestions.Clear(); + return; + } + + try + { + // Optional: Debounce briefly (e.g., wait 150ms) to ensure the user + // stopped typing before blasting the OS with process queries. + await Task.Delay(150, token); + + // 2. Offload the heavy blocking OS operation to a pool thread + List filteredResults = await Task.Run(() => + { + // Check token before starting the heavy lifting + token.ThrowIfCancellationRequested(); + + // Hit the live OS snapshot + var liveSnapshot = Process.GetProcesses(); + + token.ThrowIfCancellationRequested(); + + // Filter on the background thread + return liveSnapshot + .Where(p => p.ProcessName.Contains(query, StringComparison.OrdinalIgnoreCase)) + .Select(p => new ProcessItem { Pid = p.Id, ProcessName = p.ProcessName }) + .OrderBy(p => p.ProcessName) + .ToList(); + }, token); + + // 3. Check token one final time before updating the UI thread + token.ThrowIfCancellationRequested(); + + // Safely swap out items on the Main/UI thread + Suggestions.Clear(); + foreach (var process in filteredResults) + { + Suggestions.Add(process); + } + } + catch (OperationCanceledException) + { + // Ignored: Expected when the user types quickly and cancels old operations + } + catch (Exception ex) + { + Debug.WriteLine($"Error fetching processes: {ex.Message}"); + } + } + + [ObservableProperty] + [NotifyCanExecuteChangedFor(nameof(StartProcessCommand))] + public partial string FilePath + { + get; + set; + } + + public async Task PickFile(IntPtr hwnd) + { + FilePath = await _filePickerService.RequestFileOpener(hwnd); + } + + private bool CanStartProcess() + { + return File.Exists(FilePath); + } + + [RelayCommand(CanExecute = nameof(CanStartProcess))] + public void StartProcess() + { + StartedPid = _processHackerService.StartProcess(FilePath); + } + + private bool CanAttachProcess() + { + if (SelectedProcess == null) return false; + + try + { + var process = Process.GetProcessById(SelectedProcess.Pid); + return true; + } + catch (ArgumentException) { return false; } + } + + [RelayCommand(CanExecute = nameof(CanAttachProcess))] + public void AttachProcess() + { + StartedPid = _processHackerService.AttachProcess(SelectedProcess.Pid); + } + + [ObservableProperty] + public partial string ReadData + { + get; + set; + } = "Прочитать из памяти"; + + [ObservableProperty] + public partial int ReadLength + { + get; + set; + } + + [ObservableProperty] + public partial string WriteData + { + get; + set; + } = "Записать в память"; + + private bool CanWorkWithMemory() + { + return StartedPid != 0 && MemoryAddress != IntPtr.Zero; + } + + [RelayCommand(CanExecute = nameof(CanWorkWithMemory))] + public void ReadMemory() + { + if (_processHackerService.ReadMemory(MemoryAddress, ReadLength, out var bytes)) + ReadData = Encoding.UTF8.GetString(bytes); + } + + [RelayCommand(CanExecute = nameof(CanWorkWithMemory))] + public void WriteMemory() + { + if (_processHackerService.WriteMemory(MemoryAddress, WriteData)) + { + IsSuccessOpen = true; + Task.Run(() => { Task.Delay(10000); IsSuccessOpen = false; }); + } + } + + [ObservableProperty] + public partial bool IsSuccessOpen + { + get; + set; + } +} \ No newline at end of file diff --git a/app.manifest b/app.manifest new file mode 100644 index 0000000..9d5e647 --- /dev/null +++ b/app.manifest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + PerMonitorV2 + + + \ No newline at end of file