Red Faction: Difference between revisions

From LANCommander
(Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Volition}} |Publishers = {{Game.InfoBox.Publisher|THQ}} {{Game.InfoBox.Publisher|THQ Nordic}} {{Game.InfoBox.Publisher|Graphsim Entertainment}} {{Game.InfoBox.Publisher|Deep Silver}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|May 21, 2001}} |Genres = {{Game.InfoBox.Genre|Adventure}} {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Red_Faction }} {{Game.ActionBox |Actions =...")
 
No edit summary
 
Line 5: Line 5:
{{Game.InfoBox.Developer|Volition}}
{{Game.InfoBox.Developer|Volition}}
|Publishers =
|Publishers =
{{Game.InfoBox.Publisher|THQ}}
{{Game.InfoBox.Publisher|THQ}}{{Game.InfoBox.Publisher|THQ Nordic}}{{Game.InfoBox.Publisher|Graphsim Entertainment}}{{Game.InfoBox.Publisher|Deep Silver}}
{{Game.InfoBox.Publisher|THQ Nordic}}
{{Game.InfoBox.Publisher|Graphsim Entertainment}}
{{Game.InfoBox.Publisher|Deep Silver}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|May 21, 2001}}
{{Game.InfoBox.ReleaseDate|Windows|May 22, 2001}}
|Genres =
|Genres =
{{Game.InfoBox.Genre|Adventure}}
{{Game.InfoBox.Genre|Adventure}}{{Game.InfoBox.Genre|Shooter}}
{{Game.InfoBox.Genre|Shooter}}
|PCGamingWiki = Red_Faction}}
| PCGamingWiki = Red_Faction
}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play|Path = RF.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\DashFactionLauncher.exe|Arguments = -game|WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Run Setup|Path = RedFaction.exe|Arguments = |WorkingDirectory = |Primary = False}}
{{Game.ActionBox.Row|Name = Run Setup|Path = {InstallDir}\DashFactionLauncher.exe|Arguments = |WorkingDirectory = |Primary = False}}
}}
}}


{{Game.Scripts.NameChange
 
|Name = Name Change Script
{{Game.Scripts.Install
|Description = Red Faction stores the player name in the file players.cfg. This file stores the multiplayer name for the player in three locations in the first 263 bytes of the file. There is no visible checksum to this section of the file and can be modified freely. There is some extra data after the player name that cannot be modified and will mess up the config. However, we can make a default name that is 20 characters long and replace them as needed. If our name is shorter than 20 bytes, 0x00 is written to make up to 20 bytes. The game will trim these values for us and reconstruct the cfg file.
|Name = Install Script
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$NewName = $args[0]
<syntaxhighlight lang="powershell" line>
$InstallDir = $PSScriptRoot
$Display = Get-PrimaryDisplay


function Get-AsciiBytes([string]$InputString, [int]$MaxLength)
New-Item -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition"
{
    if ($InputString.Length -gt $MaxLength)
    {
        $InputString = $InputString.Substring(0, $MaxLength)
    }


    $bytes = [System.Text.Encoding]::ASCII.GetBytes($InputString)
New-Item -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction"
    $array = @()
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "EregCount" -Value 1 -Force
    $count = 0
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Geometry Cache Size" -Value 8 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Vsync" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Fast Animations" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0" -Value "Intel(R) HD Graphics 520" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Driver" -Value "igdumdim32.dll" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Vendor ID" -Value 32902 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Device ID" -Value 6422 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 0 (16 bit)" -Value 23 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 0 (32 bit)" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 1 (16 bit)" -Value 23 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 1 (32 bit)" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 2 (16 bit)" -Value 23 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 2 (32 bit)" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 3 (16 bit)" -Value 23 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 3 (32 bit)" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Selected Video Card" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Resolution Width" -Value $Display.Bounds.Width -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Resolution Height" -Value $Display.Bounds.Height -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Resolution Bit Depth" -Value 32 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Resolution Backbuffer Format" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "UpdateRate" -Value 200000 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "GameTracker" -Value "rfgt.factionfiles.com" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "ForcePort" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "CmdLineOptions" -Value "" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "StraightToSetup" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "EAX" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "ListLAN" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "ServerName" -Value "Vintage" -Force


    $extraPadding = $MaxLength - $bytes.Length
New-Item -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction"
 
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Executable Path" -Value "$InstallDirectory\RF_120na.exe" -Force
    foreach ($byte in $bytes)
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Window Mode" -Value 0 -Force
    {
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Disable LOD Models" -Value 1 -Force
        if ($count -lt $MaxLength)
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Anisotropic Filtering" -Value 1 -Force
        {
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Nearest Texture Filtering" -Value 0 -Force
            $array += $byte
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "MSAA" -Value 0 -Force
            $count++
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "FPS Counter" -Value 1 -Force
        }
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Max FPS" -Value 120 -Force
    }
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Server Max FPS" -Value 120 -Force
 
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "High Scanner Resolution" -Value 1 -Force
    for ($i = $count; $i -lt $MaxLength; $i++)
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "High Monitor Resolution" -Value 1 -Force
    {
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "True Color Textures" -Value 1 -Force
        $bytes += 0x00
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Horizontal FOV" -Value 0 -Force
    }
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Fpgun FOV Scale" -Value 1065353216 -Force
 
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Direct Input" -Value 0 -Force
    return $bytes
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Fast Start" -Value 1 -Force
}
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Scoreboard Animations" -Value 0 -Force
 
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Level Sound Volume" -Value 1065353216 -Force
function Patch-Binary([byte[]]$Data, [int]$Offset, [string]$FilePath)
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Allow Overwriting Game Files" -Value 0 -Force
{
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Version" -Value "" -Force
    $bytes = [System.IO.File]::ReadAllBytes($FilePath)
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Swap Assault Rifle Controls" -Value 0 -Force
 
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Swap Grenade Controls" -Value 0 -Force
    for ($i = 0; $i -lt $Data.Length; $i++)
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Glares" -Value 1 -Force
    {
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Linear Pitch" -Value 0 -Force
        $bytes[$Offset + $i] = $Data[$i]
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Show Enemy Bullets" -Value 1 -Force
    }
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Keep Launcher Open" -Value 0 -Force
 
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Skip Cutscene Control" -Value -1 -Force
    [System.IO.File]::WriteAllBytes($FilePath, $bytes)
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Damage Screen Flash" -Value 1 -Force
}
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Language" -Value -1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Reduced Speed In Background" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Big HUD" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Reticle Scale" -Value 1065353216 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Mesh Static Lighting" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Player Join Beep" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Autosave" -Value 1 -Force


New-Item -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Version"
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Version" -Name "Major" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Version" -Name "Minor" -Value 20 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Version" -Name "Build" -Value 0 -Force
</syntaxhighlight>
}}
           
{{Game.Scripts.Uninstall
|Name = Uninstall Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
Remove-Item -Path "HKCU:\SOFTWARE\Volition\Red Faction" -Force -Recurse
</syntaxhighlight>
}}
           
{{Game.Scripts.NameChange
|Name = Name Change Script
|Description = Red Faction stores the player name in the file players.cfg. This file stores the multiplayer name for the player in three locations in the first 263 bytes of the file. There is no visible checksum to this section of the file and can be modified freely. There is some extra data after the player name that cannot be modified and will mess up the config. However, we can make a default name that is 20 characters long and replace them as needed. If our name is shorter than 20 bytes, 0x00 is written to make up to 20 bytes. The game will trim these values for us and reconstruct the cfg file.
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
$Default = ([byte[]](0x1B, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0xF2, 0x1F, 0x77, 0xB4, 0xF3, 0x00, 0x00, 0xB3, 0xF1, 0x00, 0x42, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x01, 0x29, 0x01, 0x02, 0x00, 0x00, 0x00, 0x40, 0xA2, 0xFF, 0x10, 0x40, 0xA2, 0xFF, 0x10, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0x97, 0x03, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x04, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x1E, 0x04, 0xA0, 0x3A, 0x1E, 0x04, 0x01, 0x00, 0x00, 0x00, 0xB3, 0xF1, 0x00, 0x00, 0x88, 0x33, 0x01, 0x01, 0x04, 0x00, 0x00, 0x00, 0x34, 0x68, 0xA8, 0x76, 0x00, 0x00, 0x00, 0x00, 0x88, 0x48, 0xCD, 0x0F, 0x70, 0xF7, 0x19, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x0E, 0x00, 0x10, 0x00, 0x05, 0x00, 0x06, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x09, 0x00, 0x0B, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0D, 0x00))
$Default = ([byte[]](0x1B, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0xF2, 0x1F, 0x77, 0xB4, 0xF3, 0x00, 0x00, 0xB3, 0xF1, 0x00, 0x42, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x01, 0x29, 0x01, 0x02, 0x00, 0x00, 0x00, 0x40, 0xA2, 0xFF, 0x10, 0x40, 0xA2, 0xFF, 0x10, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0x97, 0x03, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x04, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x1E, 0x04, 0xA0, 0x3A, 0x1E, 0x04, 0x01, 0x00, 0x00, 0x00, 0xB3, 0xF1, 0x00, 0x00, 0x88, 0x33, 0x01, 0x01, 0x04, 0x00, 0x00, 0x00, 0x34, 0x68, 0xA8, 0x76, 0x00, 0x00, 0x00, 0x00, 0x88, 0x48, 0xCD, 0x0F, 0x70, 0xF7, 0x19, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x0E, 0x00, 0x10, 0x00, 0x05, 0x00, 0x06, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x09, 0x00, 0x0B, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0D, 0x00))
$NewNameHex = Get-AsciiBytes -InputString $NewName -MaxLength 20
$NewPlayerAliasHex = ConvertTo-StringBytes -Input $NewPlayerAlias -MaxLength 20 -MinLength 20


Patch-Binary -FilePath "$InstallDir\players.cfg" -Offset 0x00 -Data $Default
Edit-PatchBinary -FilePath "$InstallDirectory\players.cfg" -Offset 0x00 -Data $Default
Patch-Binary -FilePath "$InstallDir\players.cfg" -Offset 0x01 -Data $NewNameHex
Edit-PatchBinary -FilePath "$InstallDirectory\players.cfg" -Offset 0x01 -Data $NewPlayerAliasHex
Patch-Binary -FilePath "$InstallDir\players.cfg" -Offset 0x21 -Data $NewNameHex
Edit-PatchBinary -FilePath "$InstallDirectory\players.cfg" -Offset 0x21 -Data $NewPlayerAliasHex
Patch-Binary -FilePath "$InstallDir\players.cfg" -Offset 0x55 -Data $NewNameHex
Edit-PatchBinary -FilePath "$InstallDirectory\players.cfg" -Offset 0x55 -Data $NewPlayerAliasHex
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 21:54, 8 January 2024

Developers
Volition
Publishers
THQTHQ NordicGraphsim EntertainmentDeep Silver
Release Date
Windows: May 22, 2001
Genres
AdventureShooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\DashFactionLauncher.exe -game True
Run Setup {InstallDir}\DashFactionLauncher.exe False

Install Script

$Display = Get-PrimaryDisplay

New-Item -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition"

New-Item -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction"
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "EregCount" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Geometry Cache Size" -Value 8 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Vsync" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Fast Animations" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0" -Value "Intel(R) HD Graphics 520" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Driver" -Value "igdumdim32.dll" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Vendor ID" -Value 32902 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Device ID" -Value 6422 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 0 (16 bit)" -Value 23 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 0 (32 bit)" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 1 (16 bit)" -Value 23 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 1 (32 bit)" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 2 (16 bit)" -Value 23 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 2 (32 bit)" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 3 (16 bit)" -Value 23 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Video Card 0 Resolution 3 (32 bit)" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Selected Video Card" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Resolution Width" -Value $Display.Bounds.Width -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Resolution Height" -Value $Display.Bounds.Height -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Resolution Bit Depth" -Value 32 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "Resolution Backbuffer Format" -Value 22 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "UpdateRate" -Value 200000 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "GameTracker" -Value "rfgt.factionfiles.com" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "ForcePort" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "CmdLineOptions" -Value "" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "StraightToSetup" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "EAX" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "ListLAN" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction" -Name "ServerName" -Value "Vintage" -Force

New-Item -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction"
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Executable Path" -Value "$InstallDirectory\RF_120na.exe" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Window Mode" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Disable LOD Models" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Anisotropic Filtering" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Nearest Texture Filtering" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "MSAA" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "FPS Counter" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Max FPS" -Value 120 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Server Max FPS" -Value 120 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "High Scanner Resolution" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "High Monitor Resolution" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "True Color Textures" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Horizontal FOV" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Fpgun FOV Scale" -Value 1065353216 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Direct Input" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Fast Start" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Scoreboard Animations" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Level Sound Volume" -Value 1065353216 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Allow Overwriting Game Files" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Version" -Value "" -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Swap Assault Rifle Controls" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Swap Grenade Controls" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Glares" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Linear Pitch" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Show Enemy Bullets" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Keep Launcher Open" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Skip Cutscene Control" -Value -1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Damage Screen Flash" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Language" -Value -1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Reduced Speed In Background" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Big HUD" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Reticle Scale" -Value 1065353216 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Mesh Static Lighting" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Player Join Beep" -Value 0 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Dash Faction" -Name "Autosave" -Value 1 -Force

New-Item -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Version"
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Version" -Name "Major" -Value 1 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Version" -Name "Minor" -Value 20 -Force
New-ItemProperty -Path "registry::\HKEY_CURRENT_USER\SOFTWARE\Volition\Red Faction\Version" -Name "Build" -Value 0 -Force

Uninstall Script

Remove-Item -Path "HKCU:\SOFTWARE\Volition\Red Faction" -Force -Recurse

Name Change Script

Red Faction stores the player name in the file players.cfg. This file stores the multiplayer name for the player in three locations in the first 263 bytes of the file. There is no visible checksum to this section of the file and can be modified freely. There is some extra data after the player name that cannot be modified and will mess up the config. However, we can make a default name that is 20 characters long and replace them as needed. If our name is shorter than 20 bytes, 0x00 is written to make up to 20 bytes. The game will trim these values for us and reconstruct the cfg file.

$Default = ([byte[]](0x1B, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0xF2, 0x1F, 0x77, 0xB4, 0xF3, 0x00, 0x00, 0xB3, 0xF1, 0x00, 0x42, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x01, 0x29, 0x01, 0x02, 0x00, 0x00, 0x00, 0x40, 0xA2, 0xFF, 0x10, 0x40, 0xA2, 0xFF, 0x10, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0x97, 0x03, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x80, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x04, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x26, 0x02, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x1E, 0x04, 0xA0, 0x3A, 0x1E, 0x04, 0x01, 0x00, 0x00, 0x00, 0xB3, 0xF1, 0x00, 0x00, 0x88, 0x33, 0x01, 0x01, 0x04, 0x00, 0x00, 0x00, 0x34, 0x68, 0xA8, 0x76, 0x00, 0x00, 0x00, 0x00, 0x88, 0x48, 0xCD, 0x0F, 0x70, 0xF7, 0x19, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x07, 0x00, 0x0F, 0x00, 0x0E, 0x00, 0x10, 0x00, 0x05, 0x00, 0x06, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x09, 0x00, 0x0B, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0D, 0x00))
$NewPlayerAliasHex = ConvertTo-StringBytes -Input $NewPlayerAlias -MaxLength 20 -MinLength 20

Edit-PatchBinary -FilePath "$InstallDirectory\players.cfg" -Offset 0x00 -Data $Default
Edit-PatchBinary -FilePath "$InstallDirectory\players.cfg" -Offset 0x01 -Data $NewPlayerAliasHex
Edit-PatchBinary -FilePath "$InstallDirectory\players.cfg" -Offset 0x21 -Data $NewPlayerAliasHex
Edit-PatchBinary -FilePath "$InstallDirectory\players.cfg" -Offset 0x55 -Data $NewPlayerAliasHex