Skip to content

Instantly share code, notes, and snippets.

View floxay's full-sized avatar
🌙

Huba Tuba floxay

🌙
View GitHub Profile
@floxay
floxay / optimize_simple_glb.py
Last active March 12, 2023 03:37
Python 3 script to optimize textures in simple(!) glTF 2.0 GLB files.
import json
from io import BytesIO
from pathlib import Path
from struct import Struct
from typing import TYPE_CHECKING
from PIL import Image
from PIL.PngImagePlugin import PngImageFile
if TYPE_CHECKING:
@floxay
floxay / vccd.py
Last active February 12, 2023 16:47
# original:
# https://github.com/SteamDatabase/ValveResourceFormat/blob/8ff0321c9ec6f5c0d487515fc87346cd02fac949/ValveResourceFormat/ClosedCaptions/ClosedCaptions.cs
import struct
FILE_PATH = r"D:\subtitles_english.dat"
with open(FILE_PATH, "rb") as f:
magic, version = struct.unpack("<4sI", f.read(8))
We couldn’t find that file to show.
@floxay
floxay / get_client_version.py
Last active April 26, 2024 20:01
Get VALORANT client/build version from game executable
import pefile
def get_product_version(data: bytes) -> str:
pe = pefile.PE(data=data, fast_load=True)
pe.parse_data_directories(
directories=[pefile.DIRECTORY_ENTRY["IMAGE_DIRECTORY_ENTRY_RESOURCE"]]
)
for file_info in pe.FileInfo:
for entry in file_info: