Project64/NagScreenBypassScript

From Emulation General Wiki
Jump to navigation Jump to search

The registry key generator script[edit]

Script requires Python 3. Does not need to be running on Windows. You do need to determine your machine ID.

#!/usr/bin/env python3
# ANGELSFALL Copyright (C) 2021- by The Knights Of The Sixty-Fourth Order
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

import sys
import hashlib
import zlib

print("You will need your Machine ID.")
print("This is in the URL that comes up when you ask to support Project64.")
print("Look for something of the form https://www.pj64-emu.com/support-project64.html?ver=Dev-4.0.0.5673-9ad8d49&machine=BE4892570B29A6882CA5951FE83A160E")
print("The text after the last = is your machine ID.")
mach_id = input("Machine ID? ").strip()

# Utilities

def padme(str):
	res = str.encode("utf8").ljust(300, b'\x00')
	assert(len(res) == 300)
	return res

# Constructing SupportInfo Struct

support_info = b''
# len 300 strings
support_info += padme("ANGELSFALL")
support_info += padme("4E7ED31D906C9E2C51D00EF6D0F5BEF4671801B0FE26BB6922887773F11ABB517EDAB6885601")
support_info += padme("Knights Of The Sixty-Fourth Order")
support_info += padme(mach_id)
# run count @ 1200 / 0x4b0, 32-bit but padded
support_info += b'\x00\x01\x00\x00\x00\x00\x00\x00'
# last updated @ 0x4b8, another 8 bytes
support_info += b'\x00\x00\x00\x00\x00\x00\x00\x00'
# last shown @ 0x4c0, another 8 bytes
support_info += b'\x00\x00\x00\x00\x00\x00\x00\x00'
# validated @ 0x4c8, a final 8 bytes (more padding, huh.)
support_info += b'\x01\x00\x00\x00\x00\x00\x00\x00'

# Constructing Precomp

precomp = support_info + hashlib.md5(support_info).hexdigest().upper().encode("utf8")

# Dump precomp
dump = open("precompg.bin", "wb")
dump.write(precomp)
dump.close()

# Constructing Compressed Output

user_prexor = zlib.compress(precomp)

user = b''
# deXOR
for i in range(len(user_prexor)):
	user += bytes([user_prexor[i] ^ 0xAA])

# Output

af = open("angelsfall.reg", "w")

af.write("Windows Registry Editor Version 5.00\r\n")
af.write("\r\n")
af.write("[HKEY_CURRENT_USER\\SOFTWARE\\Project64]\r\n")
af.write("\"user\"=hex:" + user.hex(",") + "\r\n")

af.close()
print("A .reg file has been created. Review it if you wish, then install it.")

Script for grabbing support info blob (as another way to get machine ID)[edit]

This script does need to be run on Windows or in Wine, as it grabs the information from Project64's registry key.


# ANGELSFALL Copyright (C) 2021- by The Knights Of The Sixty-Fourth Order
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

import winreg
import zlib

key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "SOFTWARE\\Project64")
key = winreg.QueryValueEx(key, "user")[0]

key_dexor = b''

# deXOR
for i in range(len(key)):
	key_dexor += bytes([key[i] ^ 0xAA])

# decompress
key = zlib.decompress(key_dexor)

dump = open("precomp.bin", "wb")
dump.write(key)
dump.close()