Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
EZFNDEV committed Nov 2, 2020
0 parents commit 72c25ac
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 0 deletions.
17 changes: 17 additions & 0 deletions FortniteLauncher.crproj
@@ -0,0 +1,17 @@
<project outputDir="..\..\..\build" baseDir="obj\Release" xmlns="http://confuser.codeplex.com">
<rule pattern="true" preset="maximum" inherit="false">
<protection id="anti ildasm" />
<protection id="anti tamper" />
<protection id="constants" />
<protection id="ctrl flow" />
<protection id="anti dump" />
<protection id="anti debug" />
<protection id="invalid metadata" />
<protection id="ref proxy" />
<protection id="resources" />
<protection id="rename" />
</rule>
<packer id="compressor" />
<module path="FortniteLauncher.exe" />
<probePath>..\..\bin\Release</probePath>
</project>
78 changes: 78 additions & 0 deletions FortniteLauncher.csproj
@@ -0,0 +1,78 @@
<?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>{B4D532C1-4E45-43E1-B2AB-296CFC9ECE1B}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>FortniteLauncher</RootNamespace>
<AssemblyName>FortniteLauncher</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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>
</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>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Management" />
</ItemGroup>
<ItemGroup>
<Compile Include="Utilities\Extensions.cs" />
<Compile Include="Utilities\Win32.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Icon.ico" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
Binary file added Icon.ico
Binary file not shown.
104 changes: 104 additions & 0 deletions Program.cs
@@ -0,0 +1,104 @@
using FortniteLauncher.Utilities;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;

namespace FortniteLauncher
{
class Program
{
private const string FORTNITE_EXECUTABLE = "FortniteClient-Win64-Shipping.exe";

private static Process _fnProcess;
private static Process FortniteEACProcess;
private static bool InjectDLL;

static void Main(string[] args)
{
string joinedArgs = string.Join(" ", args);

// Check if the Fortnite client exists in the current work path.
if (!File.Exists(FORTNITE_EXECUTABLE))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"\"{FORTNITE_EXECUTABLE}\" is missing!");
Console.ReadKey();
Environment.Exit(1);
}

// Check if -NOSSLPINNING exists in args (regardless of case) to disable SSL pinning
if (joinedArgs.ToUpper().Contains("-NOSSLPINNING"))
{
joinedArgs = Regex.Replace(joinedArgs, "-NOSSLPINNING", string.Empty, RegexOptions.IgnoreCase);
InjectDLL = true;
string PlataniumPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Platanium.dll");
if (!File.Exists(PlataniumPath))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine($"\"Platanium.dll\" is missing!");
Console.ReadKey();
Environment.Exit(1);
}
}

// Setup a process exit event handler
AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit);

// Fortnite EAC
FortniteEACProcess = new Process
{
StartInfo =
{
FileName = "FortniteClient-Win64-Shipping_EAC.exe",
Arguments = $"{joinedArgs} -noeac -fromfl=be -fltoken=f7b9gah4h5380d10f721dd6a"

}
};
FortniteEACProcess.Start();
FortniteEACProcess.Suspend();

// Initialize Fortnite process with start info
_fnProcess = new Process
{
StartInfo =
{
FileName = FORTNITE_EXECUTABLE,
Arguments = $"{joinedArgs} -noeac -fromfl=be -fltoken=f7b9gah4h5380d10f721dd6a"
}
};

_fnProcess.Start(); // Start Fortnite client process

// Check if -NOSSLPINNING exists in args (regardless of case) to disable SSL pinning
if (InjectDLL)
{
string PlataniumPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Platanium.dll");
IntPtr hProcess = Win32.OpenProcess(1082, false, _fnProcess.Id);
IntPtr procAddress = Win32.GetProcAddress(Win32.GetModuleHandle("kernel32.dll"), "LoadLibraryA");
uint num = (uint)((PlataniumPath.Length + 1) * Marshal.SizeOf(typeof(char)));
IntPtr intPtr = Win32.VirtualAllocEx(hProcess, IntPtr.Zero, num, 12288U, 4U);
UIntPtr uintPtr;
Win32.WriteProcessMemory(hProcess, intPtr, Encoding.Default.GetBytes(PlataniumPath), num, out uintPtr);
Win32.CreateRemoteThread(hProcess, IntPtr.Zero, 0U, procAddress, intPtr, 0U, IntPtr.Zero);
_fnProcess.WaitForExit(); // We'll wait for the Fortnite process to exit, otherwise our launcher will just close instantly
}
}

private static void OnProcessExit(object sender, EventArgs e)
{
if (!FortniteEACProcess.HasExited)
{
FortniteEACProcess.Resume();
FortniteEACProcess.Kill();
}
if (!_fnProcess.HasExited)
{
_fnProcess.Kill();
}
}
}
}
36 changes: 36 additions & 0 deletions Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("FortniteLauncher")]
[assembly: AssemblyDescription("A custom FortniteLauncher by Cyuubi which includes an SSL pinning bypass. Fixed by EZFN")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FortniteLauncher")]
[assembly: AssemblyCopyright("Copyright © Cyuubi 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b4d532c1-4e45-43e1-b2ab-296cfc9ece1b")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
46 changes: 46 additions & 0 deletions Utilities/Extensions.cs
@@ -0,0 +1,46 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace FortniteLauncher.Utilities
{
[Flags]
public enum ThreadAccess : int
{
SUSPEND_RESUME = (0x0002),
}
public static class ProcessExtension
{
[DllImport("kernel32.dll")]
static extern IntPtr OpenThread(ThreadAccess dwDesiredAccess, bool bInheritHandle, uint dwThreadId);
[DllImport("kernel32.dll")]
static extern uint SuspendThread(IntPtr hThread);
[DllImport("kernel32.dll")]
static extern int ResumeThread(IntPtr hThread);

public static void Suspend(this Process process)
{
foreach (ProcessThread thread in process.Threads)
{
var pOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)thread.Id);
if (pOpenThread == IntPtr.Zero)
{
break;
}
SuspendThread(pOpenThread);
}
}
public static void Resume(this Process process)
{
foreach (ProcessThread thread in process.Threads)
{
var pOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)thread.Id);
if (pOpenThread == IntPtr.Zero)
{
break;
}
ResumeThread(pOpenThread);
}
}
}
}
27 changes: 27 additions & 0 deletions Utilities/Win32.cs
@@ -0,0 +1,27 @@
using System;
using System.Runtime.InteropServices;

public static class Win32
{
public const int PROCESS_ALL_ACCESS = 0x1F0FFF;

[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);

[DllImport("kernel32.dll")]
public static extern bool ReadProcessMemory(IntPtr hProcess, ulong lpBaseAddress, byte[] lpBuffer, int dwSize, int lpNumberOfBytesRead = 0);

[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, uint nSize, out UIntPtr lpNumberOfBytesWritten);

[DllImport("kernel32.dll")]
public static extern void RaiseException(uint dwExceptionCode, uint dwExceptionFlags, uint nNumberOfArguments, IntPtr lpArguments);
[DllImport("kernel32.dll")]
public static extern IntPtr CreateRemoteThread(IntPtr hProcess, IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, uint dwCreationFlags, IntPtr lpThreadId);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr GetModuleHandle(string lpModuleName);
[DllImport("kernel32", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
public static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, uint dwSize, uint flAllocationType, uint flProtect);
}

0 comments on commit 72c25ac

Please sign in to comment.