From c3c5ba3b09996efdf740c3a6498ea3265d4ac859 Mon Sep 17 00:00:00 2001 From: BranK <23649425+ItsBranK@users.noreply.github.com> Date: Thu, 4 Jan 2024 05:26:59 -0500 Subject: [PATCH] v1.1 - Fixed a bug when toggling the auto load box off and on making the program think nothing was injected. --- Forms/MainFrm.cs | 29 +++++++++---------- Framework/Assembly.cs | 4 +-- .../PublishProfiles/FolderProfile.pubxml.user | 2 +- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Forms/MainFrm.cs b/Forms/MainFrm.cs index 8f9336c..da334c5 100644 --- a/Forms/MainFrm.cs +++ b/Forms/MainFrm.cs @@ -145,24 +145,21 @@ private void ProcessTmr_Tick(object sender, EventArgs e) if (ShouldInject() && (process != null)) { - if ((_status != StatusTypes.LoadSuccess) && (_status != StatusTypes.LoadFailure)) - { - LoadBtn.Enabled = true; + LoadBtn.Enabled = true; - if (_autoLoad) - { - if ((_status != StatusTypes.DelayingLoad) && !string.IsNullOrEmpty(_processName)) - { - SetStatus(StatusTypes.DelayingLoad); - DelayTmr.Start(); - } - } - else + if (_autoLoad) + { + if ((_status != StatusTypes.DelayingLoad) && !string.IsNullOrEmpty(_processName)) { - DelayTmr.Stop(); - SetStatus(StatusTypes.FoundProcess); + SetStatus(StatusTypes.DelayingLoad); + DelayTmr.Start(); } } + else + { + DelayTmr.Stop(); + SetStatus(StatusTypes.FoundProcess); + } } else if (process == null) { @@ -290,7 +287,7 @@ private void SelectProcess(Process? process) private bool ShouldInject() { - if (!string.IsNullOrEmpty(_libraryFile) && (_status != StatusTypes.LoadSuccess)) + if (!string.IsNullOrEmpty(_libraryFile) && (_status != StatusTypes.LoadSuccess) && (_status != StatusTypes.LoadFailure)) { return ((_autoLoad && !string.IsNullOrEmpty(_processName)) || (_processId != 0)); } @@ -310,7 +307,7 @@ private void InjectFile() { InjectionResults result = FLoader.LoadLibrary(process, _libraryFile); - if (result == InjectionResults.Success) + if ((result == InjectionResults.Success) || (result == InjectionResults.AlreadyInjected)) { this.Text = (Assembly.GetTitle() + " - " + _processName); SetStatus(StatusTypes.LoadSuccess); diff --git a/Framework/Assembly.cs b/Framework/Assembly.cs index 116744d..f787fa6 100644 --- a/Framework/Assembly.cs +++ b/Framework/Assembly.cs @@ -6,10 +6,10 @@ public static class Assembly { private static readonly bool _x64Bit = true; private static readonly string _title = "ItsBranK's Library Loader"; - private static readonly string _version = "1.0"; + private static readonly string _version = "1.1"; public static bool Is64Bit() { return _x64Bit; } public static string GetTitle() { return (_title + (Is64Bit() ? " (x64)" : " (x86)")); } public static string GetVersion() { return _version; } } -} +} \ No newline at end of file diff --git a/Properties/PublishProfiles/FolderProfile.pubxml.user b/Properties/PublishProfiles/FolderProfile.pubxml.user index feb277c..f607739 100644 --- a/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - True|2024-01-03T14:15:58.2872530Z;True|2024-01-03T09:02:15.0595698-05:00;True|2024-01-03T09:01:35.1117958-05:00;True|2024-01-03T08:58:32.0226600-05:00;True|2024-01-03T08:57:16.6367138-05:00; + True|2024-01-04T10:25:03.4565233Z;True|2024-01-04T05:24:24.5689024-05:00;True|2024-01-04T05:23:52.6036310-05:00;True|2024-01-03T09:17:05.4363136-05:00;True|2024-01-03T09:15:58.2872530-05:00;True|2024-01-03T09:02:15.0595698-05:00;True|2024-01-03T09:01:35.1117958-05:00;True|2024-01-03T08:58:32.0226600-05:00;True|2024-01-03T08:57:16.6367138-05:00; \ No newline at end of file