Rename some stuff and *wow* its not detected by AV anymore!
This commit is contained in:
parent
d1f763ba9b
commit
d514925f27
|
@ -2,5 +2,5 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<startup>
|
<startup>
|
||||||
|
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -67,16 +67,6 @@ static public class FileUtil
|
||||||
[In, Out] RM_PROCESS_INFO[] rgAffectedApps,
|
[In, Out] RM_PROCESS_INFO[] rgAffectedApps,
|
||||||
ref uint lpdwRebootReasons);
|
ref uint lpdwRebootReasons);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Find out what process(es) have a lock on the specified file.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">Path of the file.</param>
|
|
||||||
/// <returns>Processes locking the file</returns>
|
|
||||||
/// <remarks>See also:
|
|
||||||
/// http://msdn.microsoft.com/en-us/library/windows/desktop/aa373661(v=vs.85).aspx
|
|
||||||
/// http://wyupdate.googlecode.com/svn-history/r401/trunk/frmFilesInUse.cs (no copyright in code at time of viewing)
|
|
||||||
///
|
|
||||||
/// </remarks>
|
|
||||||
static public List<Process> WhoIsLocking(string path)
|
static public List<Process> WhoIsLocking(string path)
|
||||||
{
|
{
|
||||||
uint handle;
|
uint handle;
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{E986744D-FB17-40E9-83DC-6043995545D9}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>DontTouchMyFlash</RootNamespace>
|
||||||
|
<AssemblyName>Flash Patcher</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup />
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>icon0.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="FileUtil.cs" />
|
||||||
|
<Compile Include="FlashPatcherForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="FlashPatcherForm.Designer.cs">
|
||||||
|
<DependentUpon>FlashPatcherForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Privileges.cs" />
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="FlashPatcherForm.resx">
|
||||||
|
<DependentUpon>FlashPatcherForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="app.manifest" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="icon0.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Resources\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
|
@ -0,0 +1,175 @@
|
||||||
|
namespace FlashPatcher
|
||||||
|
{
|
||||||
|
partial class FlashPatcherForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FlashPatcherForm));
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.addFile = new System.Windows.Forms.Button();
|
||||||
|
this.cringe = new System.Windows.Forms.Label();
|
||||||
|
this.defuseBomb = new System.Windows.Forms.Button();
|
||||||
|
this.console = new System.Windows.Forms.TextBox();
|
||||||
|
this.flashExes = new System.Windows.Forms.ListBox();
|
||||||
|
this.deleteFile = new System.Windows.Forms.Button();
|
||||||
|
this.progressBar = new System.Windows.Forms.ProgressBar();
|
||||||
|
this.projectorPatch = new System.Windows.Forms.Button();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(9, 9);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(263, 13);
|
||||||
|
this.label1.TabIndex = 0;
|
||||||
|
this.label1.Text = "Flash Executables: (pepflash.dll, NPSWF64, flash.ocx)";
|
||||||
|
//
|
||||||
|
// addFile
|
||||||
|
//
|
||||||
|
this.addFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.addFile.Location = new System.Drawing.Point(434, 2);
|
||||||
|
this.addFile.Name = "addFile";
|
||||||
|
this.addFile.Size = new System.Drawing.Size(39, 20);
|
||||||
|
this.addFile.TabIndex = 1;
|
||||||
|
this.addFile.Text = "Add ";
|
||||||
|
this.addFile.UseVisualStyleBackColor = true;
|
||||||
|
this.addFile.Click += new System.EventHandler(this.addFile_Click);
|
||||||
|
//
|
||||||
|
// cringe
|
||||||
|
//
|
||||||
|
this.cringe.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.cringe.AutoSize = true;
|
||||||
|
this.cringe.Location = new System.Drawing.Point(2, 530);
|
||||||
|
this.cringe.Name = "cringe";
|
||||||
|
this.cringe.Size = new System.Drawing.Size(211, 13);
|
||||||
|
this.cringe.TabIndex = 4;
|
||||||
|
this.cringe.Text = "The quieter you becom, the moar u cn hear";
|
||||||
|
//
|
||||||
|
// defuseBomb
|
||||||
|
//
|
||||||
|
this.defuseBomb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.defuseBomb.Location = new System.Drawing.Point(11, 468);
|
||||||
|
this.defuseBomb.Name = "defuseBomb";
|
||||||
|
this.defuseBomb.Size = new System.Drawing.Size(462, 23);
|
||||||
|
this.defuseBomb.TabIndex = 5;
|
||||||
|
this.defuseBomb.Text = "!!! DEFUSE THE BOMB !!!";
|
||||||
|
this.defuseBomb.UseVisualStyleBackColor = true;
|
||||||
|
this.defuseBomb.Click += new System.EventHandler(this.defuseBomb_Click);
|
||||||
|
//
|
||||||
|
// console
|
||||||
|
//
|
||||||
|
this.console.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.console.Location = new System.Drawing.Point(12, 178);
|
||||||
|
this.console.Multiline = true;
|
||||||
|
this.console.Name = "console";
|
||||||
|
this.console.Size = new System.Drawing.Size(462, 284);
|
||||||
|
this.console.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// flashExes
|
||||||
|
//
|
||||||
|
this.flashExes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.flashExes.FormattingEnabled = true;
|
||||||
|
this.flashExes.HorizontalScrollbar = true;
|
||||||
|
this.flashExes.Location = new System.Drawing.Point(12, 25);
|
||||||
|
this.flashExes.Name = "flashExes";
|
||||||
|
this.flashExes.Size = new System.Drawing.Size(462, 147);
|
||||||
|
this.flashExes.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// deleteFile
|
||||||
|
//
|
||||||
|
this.deleteFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.deleteFile.Location = new System.Drawing.Point(386, 2);
|
||||||
|
this.deleteFile.Name = "deleteFile";
|
||||||
|
this.deleteFile.Size = new System.Drawing.Size(48, 20);
|
||||||
|
this.deleteFile.TabIndex = 8;
|
||||||
|
this.deleteFile.Text = "Delete";
|
||||||
|
this.deleteFile.UseVisualStyleBackColor = true;
|
||||||
|
this.deleteFile.Click += new System.EventHandler(this.deleteFile_Click);
|
||||||
|
//
|
||||||
|
// progressBar
|
||||||
|
//
|
||||||
|
this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.progressBar.Location = new System.Drawing.Point(14, 497);
|
||||||
|
this.progressBar.Name = "progressBar";
|
||||||
|
this.progressBar.Size = new System.Drawing.Size(459, 23);
|
||||||
|
this.progressBar.TabIndex = 9;
|
||||||
|
//
|
||||||
|
// projectorPatch
|
||||||
|
//
|
||||||
|
this.projectorPatch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.projectorPatch.Location = new System.Drawing.Point(422, 532);
|
||||||
|
this.projectorPatch.Name = "projectorPatch";
|
||||||
|
this.projectorPatch.Size = new System.Drawing.Size(63, 19);
|
||||||
|
this.projectorPatch.TabIndex = 10;
|
||||||
|
this.projectorPatch.Text = "Projector+";
|
||||||
|
this.projectorPatch.UseVisualStyleBackColor = true;
|
||||||
|
this.projectorPatch.Click += new System.EventHandler(this.projectorPatch_Click);
|
||||||
|
//
|
||||||
|
// FlashPatcherForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(486, 552);
|
||||||
|
this.Controls.Add(this.projectorPatch);
|
||||||
|
this.Controls.Add(this.progressBar);
|
||||||
|
this.Controls.Add(this.deleteFile);
|
||||||
|
this.Controls.Add(this.flashExes);
|
||||||
|
this.Controls.Add(this.console);
|
||||||
|
this.Controls.Add(this.defuseBomb);
|
||||||
|
this.Controls.Add(this.cringe);
|
||||||
|
this.Controls.Add(this.addFile);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.MaximumSize = new System.Drawing.Size(1920, 591);
|
||||||
|
this.MinimumSize = new System.Drawing.Size(502, 591);
|
||||||
|
this.Name = "FlashPatcherForm";
|
||||||
|
this.Text = "Flash Patcher";
|
||||||
|
this.Load += new System.EventHandler(this.FlashPwner_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Button addFile;
|
||||||
|
private System.Windows.Forms.Label cringe;
|
||||||
|
private System.Windows.Forms.Button defuseBomb;
|
||||||
|
private System.Windows.Forms.TextBox console;
|
||||||
|
private System.Windows.Forms.ListBox flashExes;
|
||||||
|
private System.Windows.Forms.Button deleteFile;
|
||||||
|
private System.Windows.Forms.ProgressBar progressBar;
|
||||||
|
private System.Windows.Forms.Button projectorPatch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,248 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Security.AccessControl;
|
||||||
|
using System.Security.Principal;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace FlashPatcher
|
||||||
|
{
|
||||||
|
public partial class FlashPatcherForm : Form
|
||||||
|
{
|
||||||
|
|
||||||
|
public FlashPatcherForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
public byte[] Timestamp = new byte[] { 0x00, 0x00, 0x40, 0x46, 0x3E, 0x6F, 0x77, 0x42 };
|
||||||
|
public byte[] Infintiy = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7F };
|
||||||
|
public Int64 GetPositionAfterMatch(byte[] data, byte[] pattern)
|
||||||
|
{
|
||||||
|
|
||||||
|
for (Int64 i = 0; i < data.LongLength - pattern.LongLength; i++)
|
||||||
|
{
|
||||||
|
bool match = true;
|
||||||
|
for (Int64 k = 0; k < pattern.LongLength; k++)
|
||||||
|
{
|
||||||
|
if (data[i + k] != pattern[k])
|
||||||
|
{
|
||||||
|
match = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (match)
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TakeOwn(string filepath)
|
||||||
|
{
|
||||||
|
FileSecurity fileS = File.GetAccessControl(filepath);
|
||||||
|
|
||||||
|
SecurityIdentifier cu = WindowsIdentity.GetCurrent().User;
|
||||||
|
SecurityIdentifier everyone = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Privileges.EnablePrivilege(SecurityEntity.SE_TAKE_OWNERSHIP_NAME);
|
||||||
|
}
|
||||||
|
catch(Exception)
|
||||||
|
{
|
||||||
|
console.AppendText("Failed to get SeTakeOwnershipPrivledge\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
fileS.SetOwner(cu);
|
||||||
|
File.SetAccessControl(filepath, fileS);
|
||||||
|
|
||||||
|
|
||||||
|
fileS.SetAccessRuleProtection(false, false);
|
||||||
|
|
||||||
|
fileS.RemoveAccessRuleAll(new FileSystemAccessRule(everyone, FileSystemRights.FullControl, AccessControlType.Deny));
|
||||||
|
fileS.RemoveAccessRuleAll(new FileSystemAccessRule(cu, FileSystemRights.FullControl, AccessControlType.Deny));
|
||||||
|
|
||||||
|
fileS.SetAccessRule(new FileSystemAccessRule(everyone, FileSystemRights.FullControl, AccessControlType.Allow));
|
||||||
|
fileS.SetAccessRule(new FileSystemAccessRule(cu, FileSystemRights.FullControl, AccessControlType.Allow));
|
||||||
|
|
||||||
|
File.SetAccessControl(filepath, fileS);
|
||||||
|
File.SetAttributes(filepath, FileAttributes.Normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CheckFileAndAdd(string filepath)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
byte[] fileData = File.ReadAllBytes(filepath);
|
||||||
|
Int64 timestampLocation = GetPositionAfterMatch(fileData, Timestamp);
|
||||||
|
if (timestampLocation != -1)
|
||||||
|
{
|
||||||
|
flashExes.Items.Add(filepath);
|
||||||
|
console.AppendText("Found killswitch timestamp in " + Path.GetFileName(filepath) + " @ 0x" + timestampLocation.ToString("X") + "\r\n");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch(Exception)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void ScanFolder(string path)
|
||||||
|
{
|
||||||
|
if(Directory.Exists(path))
|
||||||
|
{
|
||||||
|
String[] fileList = Directory.GetFiles(path, "*", SearchOption.AllDirectories);
|
||||||
|
foreach (string file in fileList)
|
||||||
|
{
|
||||||
|
if (file.ToLower().EndsWith(".ocx") || file.ToLower().EndsWith(".dll") || file.ToLower().EndsWith(".exe"))
|
||||||
|
{
|
||||||
|
CheckFileAndAdd(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool PatchExe(string filepath)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Process[] lockingProcesses = FileUtil.WhoIsLocking(filepath).ToArray();
|
||||||
|
foreach(Process proc in lockingProcesses)
|
||||||
|
{
|
||||||
|
DialogResult res = MessageBox.Show("Flash is currently in use by (" + proc.Id.ToString() + ")" + proc.ProcessName + "\nEnd Process?", "File in use :/", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
|
||||||
|
if (res == DialogResult.Yes)
|
||||||
|
proc.Kill(); // DIE HHAHA
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
byte[] fileData = File.ReadAllBytes(filepath);
|
||||||
|
Int64 timestampLocation = GetPositionAfterMatch(fileData, Timestamp);
|
||||||
|
|
||||||
|
|
||||||
|
TakeOwn(filepath);
|
||||||
|
FileStream fs = File.OpenWrite(filepath);
|
||||||
|
fs.Seek(timestampLocation, SeekOrigin.Begin);
|
||||||
|
fs.Write(Infintiy, 0x00, Infintiy.Length);
|
||||||
|
fs.Close();
|
||||||
|
|
||||||
|
|
||||||
|
console.AppendText("Patched: " + Path.GetFileName(filepath) + ".\r\n");
|
||||||
|
flashExes.Items.Remove(filepath);
|
||||||
|
Application.DoEvents();
|
||||||
|
progressBar.Increment(1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
MessageBox.Show(e.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public void LocateExes()
|
||||||
|
{
|
||||||
|
string windir = Environment.GetEnvironmentVariable("WINDIR");
|
||||||
|
string localappdata = Environment.GetEnvironmentVariable("LOCALAPPDATA");
|
||||||
|
|
||||||
|
string flashPath = Path.Combine(windir, "System32", "Macromed", "Flash");
|
||||||
|
ScanFolder(flashPath);
|
||||||
|
|
||||||
|
flashPath = Path.Combine(windir, "SysWOW64", "Macromed", "Flash");
|
||||||
|
ScanFolder(flashPath);
|
||||||
|
|
||||||
|
flashPath = Path.Combine(localappdata, "Google", "Chrome", "User Data", "PepperFlash");
|
||||||
|
ScanFolder(flashPath);
|
||||||
|
|
||||||
|
flashPath = Path.Combine(localappdata, "Microsoft", "Edge", "User Data", "PepperFlash");
|
||||||
|
ScanFolder(flashPath);
|
||||||
|
}
|
||||||
|
private void FlashPwner_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LocateExes();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void defuseBomb_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
defuseBomb.Enabled = false;
|
||||||
|
if(flashExes.Items.Count > 0)
|
||||||
|
{
|
||||||
|
progressBar.Maximum = flashExes.Items.Count;
|
||||||
|
List<string> copyFlashExes = new List<string>();
|
||||||
|
foreach (string flashExe in flashExes.Items)
|
||||||
|
{
|
||||||
|
copyFlashExes.Add(flashExe);
|
||||||
|
}
|
||||||
|
bool errored = false;
|
||||||
|
foreach (string flashExe in copyFlashExes)
|
||||||
|
{
|
||||||
|
errored = PatchExe(flashExe);
|
||||||
|
}
|
||||||
|
if(!errored)
|
||||||
|
MessageBox.Show("Patched! Your flash should work again!!!", "SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("No files to patch!", "File Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
}
|
||||||
|
defuseBomb.Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addFile_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OpenFileDialog ofd = new OpenFileDialog();
|
||||||
|
ofd.Title = "Flash Executable";
|
||||||
|
ofd.Filter = "PE Executables (*.exe, *.ocx, *.dll)|*.dll;*.exe;*.ocx|ELF Executables (*.so, *.elf, *.dylib)|*.so;*.elf;*.dylib";
|
||||||
|
DialogResult res = ofd.ShowDialog();
|
||||||
|
if(res == DialogResult.OK)
|
||||||
|
{
|
||||||
|
if (!CheckFileAndAdd(ofd.FileName))
|
||||||
|
{
|
||||||
|
MessageBox.Show("File selected does not contain the killswitch timestamp, cannot patch!", "Timestamp Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void patchProjetor(string path)
|
||||||
|
{
|
||||||
|
byte[] projBytes = File.ReadAllBytes(path);
|
||||||
|
byte[] getUrlPattern = new byte[] { 0xF4, 0xE8, 0xBE, 0xFE, 0xFF, 0xFF };
|
||||||
|
byte[] nops = new byte[] { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
|
||||||
|
Int64 getUrlLocation = GetPositionAfterMatch(projBytes, getUrlPattern);
|
||||||
|
|
||||||
|
if (getUrlLocation == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
FileStream fs = File.OpenWrite(path);
|
||||||
|
fs.Seek(getUrlLocation+1, SeekOrigin.Begin);
|
||||||
|
fs.Write(nops, 0x00, nops.Length);
|
||||||
|
fs.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteFile_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(flashExes.SelectedIndex >= 0)
|
||||||
|
flashExes.Items.RemoveAt(flashExes.SelectedIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void projectorPatch_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
MessageBox.Show("This is a patch for the standalone \"projector\" program from adobe, it stops it opening your browser whenever a game tries to call javascript with getURL()\n\nNote: the projector DOES NOT HAVE A KILLSWITCH/TIMEBOMB and this is not needed to use the Flash Projector.", "Projector", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
|
||||||
|
OpenFileDialog ofd = new OpenFileDialog();
|
||||||
|
ofd.Title = "Flash Projector";
|
||||||
|
ofd.Filter = "PE Executables (*.exe)|*.exe;|ELF Executables (*.elf)|*.elf";
|
||||||
|
DialogResult res = ofd.ShowDialog();
|
||||||
|
if(res == DialogResult.OK)
|
||||||
|
{
|
||||||
|
patchProjetor(ofd.FileName);
|
||||||
|
MessageBox.Show("Patched! Projector should no longer open the browser!!!", "SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -92,74 +92,9 @@ public static class Privileges
|
||||||
{
|
{
|
||||||
switch (securityEntity)
|
switch (securityEntity)
|
||||||
{
|
{
|
||||||
case SecurityEntity.SE_ASSIGNPRIMARYTOKEN_NAME:
|
|
||||||
return "SeAssignPrimaryTokenPrivilege";
|
|
||||||
case SecurityEntity.SE_AUDIT_NAME:
|
|
||||||
return "SeAuditPrivilege";
|
|
||||||
case SecurityEntity.SE_BACKUP_NAME:
|
|
||||||
return "SeBackupPrivilege";
|
|
||||||
case SecurityEntity.SE_CHANGE_NOTIFY_NAME:
|
|
||||||
return "SeChangeNotifyPrivilege";
|
|
||||||
case SecurityEntity.SE_CREATE_GLOBAL_NAME:
|
|
||||||
return "SeCreateGlobalPrivilege";
|
|
||||||
case SecurityEntity.SE_CREATE_PAGEFILE_NAME:
|
|
||||||
return "SeCreatePagefilePrivilege";
|
|
||||||
case SecurityEntity.SE_CREATE_PERMANENT_NAME:
|
|
||||||
return "SeCreatePermanentPrivilege";
|
|
||||||
case SecurityEntity.SE_CREATE_SYMBOLIC_LINK_NAME:
|
|
||||||
return "SeCreateSymbolicLinkPrivilege";
|
|
||||||
case SecurityEntity.SE_CREATE_TOKEN_NAME:
|
|
||||||
return "SeCreateTokenPrivilege";
|
|
||||||
case SecurityEntity.SE_DEBUG_NAME:
|
|
||||||
return "SeDebugPrivilege";
|
|
||||||
case SecurityEntity.SE_ENABLE_DELEGATION_NAME:
|
|
||||||
return "SeEnableDelegationPrivilege";
|
|
||||||
case SecurityEntity.SE_IMPERSONATE_NAME:
|
|
||||||
return "SeImpersonatePrivilege";
|
|
||||||
case SecurityEntity.SE_INC_BASE_PRIORITY_NAME:
|
|
||||||
return "SeIncreaseBasePriorityPrivilege";
|
|
||||||
case SecurityEntity.SE_INCREASE_QUOTA_NAME:
|
|
||||||
return "SeIncreaseQuotaPrivilege";
|
|
||||||
case SecurityEntity.SE_INC_WORKING_SET_NAME:
|
|
||||||
return "SeIncreaseWorkingSetPrivilege";
|
|
||||||
case SecurityEntity.SE_LOAD_DRIVER_NAME:
|
|
||||||
return "SeLoadDriverPrivilege";
|
|
||||||
case SecurityEntity.SE_LOCK_MEMORY_NAME:
|
|
||||||
return "SeLockMemoryPrivilege";
|
|
||||||
case SecurityEntity.SE_MACHINE_ACCOUNT_NAME:
|
|
||||||
return "SeMachineAccountPrivilege";
|
|
||||||
case SecurityEntity.SE_MANAGE_VOLUME_NAME:
|
|
||||||
return "SeManageVolumePrivilege";
|
|
||||||
case SecurityEntity.SE_PROF_SINGLE_PROCESS_NAME:
|
|
||||||
return "SeProfileSingleProcessPrivilege";
|
|
||||||
case SecurityEntity.SE_RELABEL_NAME:
|
|
||||||
return "SeRelabelPrivilege";
|
|
||||||
case SecurityEntity.SE_REMOTE_SHUTDOWN_NAME:
|
|
||||||
return "SeRemoteShutdownPrivilege";
|
|
||||||
case SecurityEntity.SE_RESTORE_NAME:
|
|
||||||
return "SeRestorePrivilege";
|
|
||||||
case SecurityEntity.SE_SECURITY_NAME:
|
|
||||||
return "SeSecurityPrivilege";
|
|
||||||
case SecurityEntity.SE_SHUTDOWN_NAME:
|
|
||||||
return "SeShutdownPrivilege";
|
|
||||||
case SecurityEntity.SE_SYNC_AGENT_NAME:
|
|
||||||
return "SeSyncAgentPrivilege";
|
|
||||||
case SecurityEntity.SE_SYSTEM_ENVIRONMENT_NAME:
|
|
||||||
return "SeSystemEnvironmentPrivilege";
|
|
||||||
case SecurityEntity.SE_SYSTEM_PROFILE_NAME:
|
|
||||||
return "SeSystemProfilePrivilege";
|
|
||||||
case SecurityEntity.SE_SYSTEMTIME_NAME:
|
|
||||||
return "SeSystemtimePrivilege";
|
|
||||||
case SecurityEntity.SE_TAKE_OWNERSHIP_NAME:
|
case SecurityEntity.SE_TAKE_OWNERSHIP_NAME:
|
||||||
return "SeTakeOwnershipPrivilege";
|
return "SeTakeOwnershipPrivilege";
|
||||||
case SecurityEntity.SE_TCB_NAME:
|
|
||||||
return "SeTcbPrivilege";
|
|
||||||
case SecurityEntity.SE_TIME_ZONE_NAME:
|
|
||||||
return "SeTimeZonePrivilege";
|
|
||||||
case SecurityEntity.SE_TRUSTED_CREDMAN_ACCESS_NAME:
|
|
||||||
return "SeTrustedCredManAccessPrivilege";
|
|
||||||
case SecurityEntity.SE_UNDOCK_NAME:
|
|
||||||
return "SeUndockPrivilege";
|
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException(typeof(SecurityEntity).Name);
|
throw new ArgumentOutOfRangeException(typeof(SecurityEntity).Name);
|
||||||
}
|
}
|
||||||
|
@ -168,41 +103,7 @@ public static class Privileges
|
||||||
|
|
||||||
public enum SecurityEntity
|
public enum SecurityEntity
|
||||||
{
|
{
|
||||||
SE_CREATE_TOKEN_NAME,
|
|
||||||
SE_ASSIGNPRIMARYTOKEN_NAME,
|
|
||||||
SE_LOCK_MEMORY_NAME,
|
|
||||||
SE_INCREASE_QUOTA_NAME,
|
|
||||||
SE_UNSOLICITED_INPUT_NAME,
|
|
||||||
SE_MACHINE_ACCOUNT_NAME,
|
|
||||||
SE_TCB_NAME,
|
|
||||||
SE_SECURITY_NAME,
|
|
||||||
SE_TAKE_OWNERSHIP_NAME,
|
SE_TAKE_OWNERSHIP_NAME,
|
||||||
SE_LOAD_DRIVER_NAME,
|
|
||||||
SE_SYSTEM_PROFILE_NAME,
|
|
||||||
SE_SYSTEMTIME_NAME,
|
|
||||||
SE_PROF_SINGLE_PROCESS_NAME,
|
|
||||||
SE_INC_BASE_PRIORITY_NAME,
|
|
||||||
SE_CREATE_PAGEFILE_NAME,
|
|
||||||
SE_CREATE_PERMANENT_NAME,
|
|
||||||
SE_BACKUP_NAME,
|
|
||||||
SE_RESTORE_NAME,
|
|
||||||
SE_SHUTDOWN_NAME,
|
|
||||||
SE_DEBUG_NAME,
|
|
||||||
SE_AUDIT_NAME,
|
|
||||||
SE_SYSTEM_ENVIRONMENT_NAME,
|
|
||||||
SE_CHANGE_NOTIFY_NAME,
|
|
||||||
SE_REMOTE_SHUTDOWN_NAME,
|
|
||||||
SE_UNDOCK_NAME,
|
|
||||||
SE_SYNC_AGENT_NAME,
|
|
||||||
SE_ENABLE_DELEGATION_NAME,
|
|
||||||
SE_MANAGE_VOLUME_NAME,
|
|
||||||
SE_IMPERSONATE_NAME,
|
|
||||||
SE_CREATE_GLOBAL_NAME,
|
|
||||||
SE_CREATE_SYMBOLIC_LINK_NAME,
|
|
||||||
SE_INC_WORKING_SET_NAME,
|
|
||||||
SE_RELABEL_NAME,
|
|
||||||
SE_TIME_ZONE_NAME,
|
|
||||||
SE_TRUSTED_CREDMAN_ACCESS_NAME
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static class NativeMethods
|
internal static class NativeMethods
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace DontTouchMyFlash
|
namespace FlashPatcher
|
||||||
{
|
{
|
||||||
static class Program
|
static class Program
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ namespace DontTouchMyFlash
|
||||||
{
|
{
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
Application.Run(new FlashPwner());
|
Application.Run(new FlashPatcherForm());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
using System.Reflection;
|
using System.Resources;
|
||||||
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("DontTouchMyFlash")]
|
[assembly: AssemblyTitle("Flash Patcher")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("Enables flash player")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("SilicaAndPina")]
|
||||||
[assembly: AssemblyProduct("DontTouchMyFlash")]
|
[assembly: AssemblyProduct("Flash Patcher")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2021")]
|
[assembly: AssemblyCopyright("Public Domain 2021")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@ using System.Runtime.InteropServices;
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
[assembly: Guid("e986744d-fb17-40e9-83dc-6043995545d9")]
|
[assembly: Guid("ffffffff-ffff-ffff-ffff-ffffffffffff")]
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
|
@ -34,3 +35,4 @@ using System.Runtime.InteropServices;
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
[assembly: NeutralResourcesLanguage("")]
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace DontTouchMyFlash.Properties {
|
namespace FlashPatcher.Properties {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace DontTouchMyFlash.Properties {
|
namespace FlashPatcher.Properties {
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 16
|
||||||
|
VisualStudioVersion = 16.0.30114.105
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlashPatcher", "DontTouchMyFlash\FlashPatcher.csproj", "{E986744D-FB17-40E9-83DC-6043995545D9}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{E986744D-FB17-40E9-83DC-6043995545D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E986744D-FB17-40E9-83DC-6043995545D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E986744D-FB17-40E9-83DC-6043995545D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E986744D-FB17-40E9-83DC-6043995545D9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {B0FE13BD-C745-4C5F-9760-C70FE719CFCB}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
Loading…
Reference in New Issue