Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save firestack/afa80b1f01a4e243d789c61466964ab5 to your computer and use it in GitHub Desktop.

Select an option

Save firestack/afa80b1f01a4e243d789c61466964ab5 to your computer and use it in GitHub Desktop.
Portal Patch
  1. Download and open HxD.
  2. Open the original engine.dll in HxD.
  3. Go to Search -> Replace -> Hex-values.
  4. Search for 8B F1 E8 40 CD 05 00 8B 7D 10 83 F8 02 0F 94 C3.
  5. Replace with 31 C0 E9 2D 01 00 00 90 90 90 90 90 90 90 90 90.
  6. Use File -> Save as... and save it as engine.dll.

Reference: patching sub_1013BF40 result to successfully return always fixes the constant "No Steam logon\n" error. Meant for Portal Reloaded.

Python usage: python3 patch.py engine.dll

from pathlib import Path
import sys
old=bytes.fromhex("8B F1 E8 40 CD 05 00 8B 7D 10 83 F8 02 0F 94 C3")
new=bytes.fromhex("31 C0 E9 2D 01 00 00 90 90 90 90 90 90 90 90 90")
d=Path(sys.argv[1]).read_bytes()
Path("engine.dll").write_bytes(d.replace(old,new,1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment