Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
- Fixed a bug when toggling the auto load box off and on making the program think nothing was injected.
  • Loading branch information
ItsBranK committed Jan 4, 2024
1 parent 9118a0d commit c3c5ba3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
29 changes: 13 additions & 16 deletions Forms/MainFrm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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));
}
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions Framework/Assembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
}
}
2 changes: 1 addition & 1 deletion Properties/PublishProfiles/FolderProfile.pubxml.user
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>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;</History>
<History>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;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

0 comments on commit c3c5ba3

Please sign in to comment.