Skip to content

Commit dd1df49

Browse files
committed
Code cleanup
1 parent 068ca10 commit dd1df49

File tree

10 files changed

+355
-358
lines changed

10 files changed

+355
-358
lines changed

src/Constants/MemProtection.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ namespace Arctium.WoW.Launcher.Constants;
55

66
enum MemProtection
77
{
8-
NoAccess = 0x1,
9-
ReadOnly = 0x2,
10-
ReadWrite = 0x4,
11-
WriteCopy = 0x8,
12-
Execute = 0x10,
13-
ExecuteRead = 0x20,
8+
NoAccess = 0x1,
9+
ReadOnly = 0x2,
10+
ReadWrite = 0x4,
11+
WriteCopy = 0x8,
12+
Execute = 0x10,
13+
ExecuteRead = 0x20,
1414
ExecuteReadWrite = 0x40,
1515
ExecuteWriteCopy = 0x80,
16-
Guard = 0x100,
17-
NoCache = 0x200,
18-
WriteCombine = 0x400,
16+
Guard = 0x100,
17+
NoCache = 0x200,
18+
WriteCombine = 0x400,
1919
}

src/Constants/MemState.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Arctium.WoW.Launcher.Constants;
55

66
enum MemState
77
{
8-
Commit = 0x1000,
8+
Commit = 0x1000,
99
Reserve = 0x2000,
10-
Free = 0x10000
10+
Free = 0x10000
1111
}

src/Constants/MemType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace Arctium.WoW.Launcher.Constants;
66
enum MemType : uint
77
{
88
Private = 0x20000,
9-
Mapped = 0x40000,
10-
Image = 0x1000000
9+
Mapped = 0x40000,
10+
Image = 0x1000000
1111
}

src/Constants/NtStatus.cs

Lines changed: 329 additions & 329 deletions
Large diffs are not rendered by default.

src/IO/WinMemory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) Arctium.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
using static Arctium.WoW.Launcher.Misc.NativeWindows;
54
using static Arctium.WoW.Launcher.Misc.Helpers;
5+
using static Arctium.WoW.Launcher.Misc.NativeWindows;
66

77
namespace Arctium.WoW.Launcher.IO;
88

@@ -13,7 +13,7 @@ class WinMemory
1313
public nint BaseAddress { get; }
1414

1515
ProcessBasicInformation _peb;
16-
16+
1717
readonly nint _processHandle;
1818
readonly Dictionary<string, (long Address, byte[] Data)> _patchList;
1919

@@ -252,7 +252,7 @@ bool RemapAndPatch(nint viewAddress, int viewSize)
252252
NtUnmapViewOfSection(_processHandle, viewBase2);
253253

254254
// Check if the allocation protections is the right one.
255-
if (VirtualQueryEx(_processHandle, BaseAddress, out MemoryBasicInformation mbi, MemoryBasicInformation.Size) != 0
255+
if (VirtualQueryEx(_processHandle, BaseAddress, out MemoryBasicInformation mbi, MemoryBasicInformation.Size) != 0
256256
&& mbi.AllocationProtect == MemProtection.ExecuteRead)
257257
{
258258
// Also check if we can change the page protection.

src/Launcher.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ public static async ValueTask<string> PrepareGameLaunch(ParseResult commandLineR
119119

120120
await tcpClient.ConnectAsync(portal.HostName, portal.Port, tcpClientTimeout.Token);
121121

122-
123122
if (gameVersion == GameVersion.Retail)
124123
{
125124
using var sslStream = new SslStream(tcpClient.GetStream(), false,

src/Misc/Extensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ public static HashSet<long> FindPattern(this byte[] data, short[] pattern, int m
6161
match = data.FindPattern(pattern, match, 0);
6262

6363
if (match == 0)
64-
continue;
65-
66-
matchList.Add(match);
67-
64+
continue;
65+
66+
matchList.Add(match);
67+
6868
match += pattern.Length;
6969

7070
} while ((matchList.Count < maxMatches || match < maxOffset) && match != 0);

src/Misc/Helpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static (string IPAddress, string HostName, int Port) ParsePortal(string c
103103
public static async Task<bool> CheckUrl(string url, string fallbackUrl)
104104
{
105105
using var httpClient = new HttpClient();
106-
106+
107107
httpClient.Timeout = TimeSpan.FromSeconds(5);
108108

109109
try

src/Program.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Copyright (c) Arctium.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4-
using System.CommandLine.Parsing;
54
using Arctium.WoW.Launcher;
6-
5+
using System.CommandLine.Parsing;
76
using static Arctium.WoW.Launcher.Misc.Helpers;
87

98
// "Arctium" should not be removed from the final binary name.

src/Usings.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
// Copyright (c) Arctium.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
global using Arctium.WoW.Launcher.Constants;
5+
global using Arctium.WoW.Launcher.IO;
6+
global using Arctium.WoW.Launcher.Misc;
7+
global using Arctium.WoW.Launcher.Structures;
48
global using System.Collections.Concurrent;
59
global using System.CommandLine;
610
global using System.Diagnostics;
711
global using System.Runtime.CompilerServices;
812
global using System.Runtime.InteropServices;
913
global using System.Text;
10-
11-
global using Arctium.WoW.Launcher.Constants;
12-
global using Arctium.WoW.Launcher.IO;
13-
global using Arctium.WoW.Launcher.Misc;
14-
global using Arctium.WoW.Launcher.Structures;

0 commit comments

Comments
 (0)