Skip to content

Instantly share code, notes, and snippets.

@yipo
Last active April 6, 2024 14:32
Show Gist options
  • Save yipo/8e8bda27cf0d39600196f5bbfa955eb1 to your computer and use it in GitHub Desktop.
Save yipo/8e8bda27cf0d39600196f5bbfa955eb1 to your computer and use it in GitHub Desktop.
SimCity 3000 Unlimited: Unlock supported resolution
$ErrorActionPreference = 'Stop'
function Get-ExecutablePath {
$key = 'HKLM:\SOFTWARE\WOW6432Node\Electronic Arts\Maxis\SimCity 3000 Unlimited'
try {
$dir = Get-ItemPropertyValue -Path $key -Name 'InstalledPath'
}
catch [Management.Automation.ItemNotFoundException] {
Write-Error -Message 'The game is not installed.'
}
Join-Path -Path $dir -ChildPath 'SC3U.exe' -Resolve
}
function Unlock-Resolution ([string]$File) {
$p = (
'8b-4c-24-04-8b-44-24-08-53',
'c2-08-00-90-8b-44-24-08-53'
), (
'8b-4c-24-04-8b-54-24-08-81-f9',
'c2-08-00-90-8b-54-24-08-81-f9'
)
$data = [BitConverter]::ToString((Get-Content -Path $File -Encoding Byte -Raw))
$data = $data -replace $p[0] -replace $p[1]
Set-Content -Path $File -Encoding Byte -Value (Convert-HexStringToBytes -String $data)
}
function Convert-HexStringToBytes ([string]$String) {
return $String -split '-' | ForEach-Object -Process {
[Convert]::ToByte($_, 16)
}
}
Unlock-Resolution -File (Get-ExecutablePath)
@yipo
Copy link
Author

yipo commented Mar 31, 2024

About the hack trick, please check this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment