Skip to content

Commit 5631d73

Browse files
authored
Add files via upload
1 parent 73b75bb commit 5631d73

7 files changed

Lines changed: 310 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.6.33723.286
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoMoreCookiesService", "NoMoreCookiesService\NoMoreCookiesService.csproj", "{C0D865A4-6E6E-4853-8018-C66D619F6C23}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{C0D865A4-6E6E-4853-8018-C66D619F6C23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{C0D865A4-6E6E-4853-8018-C66D619F6C23}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{C0D865A4-6E6E-4853-8018-C66D619F6C23}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{C0D865A4-6E6E-4853-8018-C66D619F6C23}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {E1350D67-7433-4642-AA41-EF1DFDBBCBD2}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>

NoMoreCookiesService/NoMoreCookiesService/MainService.Designer.cs

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Data;
5+
using System.Diagnostics;
6+
using System.Linq;
7+
using System.ServiceProcess;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
using System.Runtime.InteropServices;
11+
using Microsoft.Win32;
12+
using System.IO;
13+
14+
namespace NoMoreCookiesService
15+
{
16+
public partial class MainService : ServiceBase
17+
{
18+
[DllImport("kernel32.dll", SetLastError = true)]
19+
private static extern bool CloseHandle(IntPtr Handle);
20+
21+
[DllImport("kernel32.dll", SetLastError = true)]
22+
private static extern IntPtr GetModuleHandle(string lib);
23+
24+
[DllImport("kernel32.dll", SetLastError = true)]
25+
private static extern IntPtr GetProcAddress(IntPtr Module, string Function);
26+
27+
[DllImport("kernel32.dll", SetLastError = true)]
28+
private static extern bool WriteProcessMemory(IntPtr ProcHandle, IntPtr BaseAddress, string Buffer, int size, int NumOfBytes);
29+
30+
[DllImport("kernel32.dll", SetLastError = true)]
31+
private static extern IntPtr VirtualAllocEx(IntPtr ProcessHandle, IntPtr Address, int Size, uint AllocationType, uint Protection);
32+
33+
[DllImport("kernel32.dll", SetLastError = true)]
34+
private static extern IntPtr CreateRemoteThread(IntPtr ProcessHandle, IntPtr ThreadAttributes, uint StackSize, IntPtr StartAddress, IntPtr Parameter, uint CreationFlags, [Out] uint ThreadID);
35+
36+
[DllImport("kernel32.dll", SetLastError = true)]
37+
private static extern uint WaitForSingleObject(IntPtr Handle, uint TimeInMilli);
38+
39+
[DllImport("kernel32.dll", SetLastError = true)]
40+
private static extern bool VirtualFreeEx(IntPtr ProcessHandle, IntPtr Address, int Size, uint FreeType);
41+
42+
public MainService()
43+
{
44+
InitializeComponent();
45+
}
46+
47+
public static unsafe int strlen(string s)
48+
{
49+
int length = 0;
50+
fixed (char* pStr = s)
51+
{
52+
length = *(((int*)pStr) - 1);
53+
}
54+
return length;
55+
}
56+
57+
protected override void OnStart(string[] args)
58+
{
59+
string Config = File.ReadAllText(Environment.CurrentDirectory + "\\NoMoreConfig.txt");
60+
string DllPath = null;
61+
if (Config == "XMode: Disabled")
62+
{
63+
if (Environment.Is64BitProcess)
64+
{
65+
DllPath = @"C:\NoMoreCookies_x64.dll";
66+
}
67+
else
68+
{
69+
DllPath = @"C:\NoMoreCookies.dll";
70+
}
71+
}
72+
else if (Config == "XMode: Enabled")
73+
{
74+
if (Environment.Is64BitProcess)
75+
{
76+
DllPath = @"C:\XNoMoreCookies.dll";
77+
}
78+
else
79+
{
80+
DllPath = @"C:\XNoMoreCookies_x64.dll";
81+
}
82+
}
83+
if (DllPath != null)
84+
{
85+
foreach (Process ProcessInject in Process.GetProcesses())
86+
{
87+
try
88+
{
89+
if (ProcessInject.Id != Process.GetCurrentProcess().Id)
90+
{
91+
bool IsWow64 = false;
92+
IntPtr LoadLibraryA = GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
93+
IntPtr Allocation = VirtualAllocEx(ProcessInject.Handle, IntPtr.Zero, strlen(DllPath), 0x00001000 | 0x00002000, 0x04);
94+
WriteProcessMemory(ProcessInject.Handle, Allocation, DllPath, strlen(DllPath), 0);
95+
IntPtr RemoteThread = CreateRemoteThread(ProcessInject.Handle, IntPtr.Zero, 0, LoadLibraryA, Allocation, 0, 0);
96+
WaitForSingleObject(RemoteThread, 4000);
97+
VirtualFreeEx(ProcessInject.Handle, Allocation, strlen(DllPath), 0x00008000);
98+
CloseHandle(RemoteThread);
99+
CloseHandle(ProcessInject.Handle);
100+
101+
102+
}
103+
}
104+
catch
105+
{
106+
continue;
107+
}
108+
}
109+
}
110+
this.Stop();
111+
}
112+
113+
protected override void OnStop()
114+
{
115+
116+
}
117+
}
118+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{C0D865A4-6E6E-4853-8018-C66D619F6C23}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>NoMoreCookiesService</RootNamespace>
10+
<AssemblyName>NoMoreCookiesService</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>x86</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<Prefer32Bit>false</Prefer32Bit>
26+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Net.Http" />
45+
<Reference Include="System.ServiceProcess" />
46+
<Reference Include="System.Xml" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<Compile Include="MainService.cs">
50+
<SubType>Component</SubType>
51+
</Compile>
52+
<Compile Include="MainService.Designer.cs">
53+
<DependentUpon>MainService.cs</DependentUpon>
54+
</Compile>
55+
<Compile Include="Program.cs" />
56+
<Compile Include="Properties\AssemblyInfo.cs" />
57+
</ItemGroup>
58+
<ItemGroup>
59+
<None Include="App.config" />
60+
</ItemGroup>
61+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
62+
</Project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Linq;
5+
using System.Runtime.CompilerServices;
6+
using System.ServiceProcess;
7+
using System.Text;
8+
using System.Threading;
9+
using System.Threading.Tasks;
10+
11+
namespace NoMoreCookiesService
12+
{
13+
internal static class Program
14+
{
15+
static void Main()
16+
{
17+
Thread.Sleep(10000);
18+
ServiceBase[] ServicesToRun;
19+
ServicesToRun = new ServiceBase[]
20+
{
21+
new MainService()
22+
};
23+
ServiceBase.Run(ServicesToRun);
24+
}
25+
}
26+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("NoMoreCookiesService")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("NoMoreCookiesService")]
13+
[assembly: AssemblyCopyright("Copyright © 2023")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("c0d865a4-6e6e-4853-8018-c66d619f6c23")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)