Skip to content

Commit 7fe12aa

Browse files
committed
Function to toggle Run dialog
1 parent 4e0daed commit 7fe12aa

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.9")]
36-
[assembly: AssemblyFileVersion("1.0.0.9")]
35+
[assembly: AssemblyVersion("1.0.0.10")]
36+
[assembly: AssemblyFileVersion("1.0.0.10")]

XRFAgent.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<UpdatePeriodically>false</UpdatePeriodically>
2626
<UpdateRequired>false</UpdateRequired>
2727
<MapFileExtensions>true</MapFileExtensions>
28-
<ApplicationRevision>9</ApplicationRevision>
28+
<ApplicationRevision>10</ApplicationRevision>
2929
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
3030
<UseApplicationTrust>false</UseApplicationTrust>
3131
<BootstrapperEnabled>true</BootstrapperEnabled>
@@ -119,7 +119,7 @@
119119
<Version>6.0.0</Version>
120120
</PackageReference>
121121
<PackageReference Include="System.Text.Json">
122-
<Version>8.0.3</Version>
122+
<Version>8.0.4</Version>
123123
</PackageReference>
124124
</ItemGroup>
125125
<ItemGroup>

modCommand.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ public static void Handle(string inputCommand, string inputSource, string reques
3030
if (inputData[1] == "installed" && inputData[2] == "software") { outputResponse = modSystem.GetInstalledSoftware(); }
3131
else if (inputData[1] == "system" && inputData[2] == "details") { outputResponse = modSystem.GetSystemDetails(); } break;
3232
case "disable" when inputData.Length == 2:
33-
if (inputData[1] == "autoupdate") { outputResponse = modUpdate.DisableAutoupdate(); } break;
33+
if (inputData[1] == "autoupdate") { outputResponse = modUpdate.DisableAutoupdate(); }
34+
if (inputData[1] == "rundialog") { outputResponse = modSystem.ConfigureRunDialog(inputData[0]); } break;
3435
case "enable" when inputData.Length == 2:
35-
if (inputData[1] == "autoupdate") { outputResponse = modUpdate.EnableAutoupdate(); } break;
36+
if (inputData[1] == "autoupdate") { outputResponse = modUpdate.EnableAutoupdate(); }
37+
if (inputData[1] == "rundialog") { outputResponse = modSystem.ConfigureRunDialog(inputData[0]); } break;
3638
case "hac":
3739
case "hacontroller":
3840
string inputCommandTrimmed = inputCommand.Remove(0, inputData[0].Length + 1);

modSystem.cs

+21
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,26 @@ public static string ShutdownHost()
216216
return "Shutdown failed";
217217
}
218218
}
219+
220+
/// <summary>
221+
/// Configures the system Run dialog, which is frequently used by phone scammers
222+
/// </summary>
223+
/// <param name="action">(string) Action to take</param>
224+
/// <returns>(string) Response</returns>
225+
public static string ConfigureRunDialog(string action)
226+
{
227+
int newvalue = 0;
228+
if (action == "disable") { newvalue = 1; }
229+
RegistryKey explorerPolicies = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);
230+
explorerPolicies.SetValue("NoRun", newvalue, RegistryValueKind.DWord);
231+
explorerPolicies.Close();
232+
233+
modDatabase.Config ConfigObj = new modDatabase.Config { Key = "Security_RunDialog", Value = action + "d" };
234+
modDatabase.AddOrUpdateConfig(ConfigObj);
235+
string SystemDetailsJSON = "{\"systemdetails\":[" + JsonSerializer.Serialize(ConfigObj) + "]}";
236+
modSync.SendMessage("server", "nodedata", "systemdetails", SystemDetailsJSON);
237+
238+
return "Run dialog " + action + "d";
239+
}
219240
}
220241
}

0 commit comments

Comments
 (0)