Created
December 9, 2025 17:28
-
-
Save DartPower/57a3bad8df03442c6bd89a464bd57f6d to your computer and use it in GitHub Desktop.
splash boot for package3 injector (by lRaphtalial)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image | |
| import sys, os | |
| from struct import pack as pk | |
| from math import floor | |
| SPLASH_SCREEN_WIDTH = 1280 | |
| SPLASH_SCREEN_HEIGHT = 720 | |
| SPLASH_SCREEN_STRIDE = 768 | |
| def convert_bytes(data): | |
| mutable = bytearray() | |
| pixel_length = 4 + ((SPLASH_SCREEN_STRIDE - SPLASH_SCREEN_HEIGHT) * 4) | |
| row_length = 4 * SPLASH_SCREEN_HEIGHT + ((SPLASH_SCREEN_STRIDE - SPLASH_SCREEN_HEIGHT) * 4) | |
| for ii in range(SPLASH_SCREEN_WIDTH): | |
| for jj in range(SPLASH_SCREEN_HEIGHT): | |
| mutable += pk('<BBBB', data[ii*row_length+jj*4+2], data[ii*row_length+jj*4+1], data[ii*row_length+jj*4], data[ii*row_length+jj*4+3]) | |
| splash = Image.frombytes('RGBA', (SPLASH_SCREEN_HEIGHT, SPLASH_SCREEN_WIDTH), mutable) | |
| # splash = splash.transpose(Image.ROTATE_270) | |
| splash.save('splash.bmp') | |
| def main(argc, argv): | |
| if argc != 2: | |
| print('Usage: %s package3' % argv[0]) | |
| return 1 | |
| with open(argv[1], 'rb') as f: | |
| package3 = f.read() | |
| assert package3[:4] == b'PK31' | |
| assert len(package3) == 0x800000 | |
| convert_bytes(package3[0x400000:0x7C0000]) | |
| return 0 | |
| if name == 'main': | |
| sys.exit(main(len(sys.argv), sys.argv)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment