Motocross Madness 2

From LANCommander
Revision as of 01:17, 1 August 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Rainbow Studios}} |Publishers = {{Game.InfoBox.Publisher|Microsoft}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|May 26, 2000}} |Genres = {{Game.InfoBox.Genre|Sport}} {{Game.InfoBox.Genre|Racing}} | PCGamingWiki = Motocross_Madness_2 }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = MCM2.EXE|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Rainbow Studios
Publishers
Microsoft
Release Date
Windows: May 26, 2000
Genres
Sport

Racing

View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play MCM2.EXE True

Install Script

This script requires admin access to function properly

$InstallDir = $PSScriptRoot
$PID = [GUID]::NewGuid()
$EmptyGuid = [GUID]::Empty

New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"

New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" -Name "$InstallDir\MCM2.EXE" -Value "~ WINXPSP3" -Force

New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2"

New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "AllowFreezeCamera" -Value 1 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "CDPath" -Value "$InstallDir" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "FIRSTRUN" -Value 1 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "HardDriveRootPath" -Value "$InstallDir" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "InstalledGroup" -Value 3 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "InstalledType" -Value "Full" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "IsAdmin" -Value 1 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "LangID" -Value 9 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "LastControllerId" -Value "$EmptyGuid" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "Launched" -Value 1 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "MRUProfile" -Value 1 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "PID" -Value "$PID" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "UseControllerId" -Value "$EmptyGuid" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "UseLastVideoCard" -Value 1 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "UseVideoCardIdx" -Value 2 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Motocross Madness 2" -Name "VersionType" -Value "RetailVersion" -Force

Name Change Script

$NewName = $args[0]
$InstallDir = $PSScriptRoot
$PID = [GUID]::NewGuid()
$EmptyGuid = [GUID]::Empty

function Get-AsciiBytes([string]$InputString, [int]$MaxLength)
{
    if ($InputString.Length -gt $MaxLength)
    {
        $InputString = $InputString.Substring(0, $MaxLength)
    }

    $bytes = [System.Text.Encoding]::ASCII.GetBytes($InputString)
    $array = @()
    $count = 0

    $extraPadding = $MaxLength - $bytes.Length

    foreach ($byte in $bytes)
    {
        if ($count -lt $MaxLength)
        {
            $array += $byte
            $count++
        }
    }

    for ($i = $count; $i -lt $MaxLength; $i++)
    {
        $array += 0x00
    }

    return $array
}

function Patch-Binary([byte[]]$Data, [int]$Offset, [string]$FilePath)
{
    $bytes = [System.IO.File]::ReadAllBytes($FilePath)

    for ($i = 0; $i -lt $Data.Length; $i++)
    {
        $bytes[$Offset + $i] = $Data[$i]
    }

    [System.IO.File]::WriteAllBytes($FilePath, $bytes)
}

Copy-Item -Path "$InstallDir\ProfileTemplate" -Destination "$InstallDir\UI\PROFILE\$NewName" -Recurse
Rename-Item -Path "$InstallDir\UI\PROFILE\$NewName\ProfileTemplate.prf" -NewName "$NewName.prf"

$rawBytes = Get-AsciiBytes -InputString $newName -MaxLength 15

Patch-Binary -FilePath "$InstallDir\UI\PROFILE\$NewName\$NewName.prf" -Offset 0 -Data $rawBytes