Skip to content

Instantly share code, notes, and snippets.

import unrealsdk
import csv
from typing import Dict, Set
INVBAL_CLS_BLACKLIST = (
"CustomizationInventoryBalanceData",
"InventoryBalanceData_Generated",
"VaultCardRewardBalanceData",
)
INVDATA_CLS_BLACKLIST = (
@apple1417
apple1417 / decompressed.ksy
Created August 15, 2021 11:38
Kaitai Struct format for BL2/TPS Profile files
meta:
id: decompressed
title: BL2/TPS Decompressed Profile Data
endian: be
seq:
- id: setting_count
type: u4
- id: all_settings
type: online_profile_setting
repeat: expr
@apple1417
apple1417 / complete_vault_card_challenges.py
Last active October 19, 2022 05:40
completes all vault card challenges on your profile, requires `bl3-cli-saveedit`
try:
import argparse
from bl3save.bl3profile import BL3Profile
from bl3save.OakShared_pb2 import ChallengeSaveGameData
VC1_CHALLENGES = {
"/Game/PatchDLC/VaultCard/Challenges/Daily/VC1/VC1_DailyChallenge_CurrencyEridium.VC1_DailyChallenge_CurrencyEridium_C",
"/Game/PatchDLC/VaultCard/Challenges/Daily/VC1/VC1_DailyChallenge_HuntAntalope.VC1_DailyChallenge_HuntAntalope_C",
"/Game/PatchDLC/VaultCard/Challenges/Daily/VC1/VC1_DailyChallenge_HuntBlindingBanshee.VC1_DailyChallenge_HuntBlindingBanshee_C",
@apple1417
apple1417 / marquee.py
Created May 17, 2021 03:50
tkinter marquee
import tkinter as tk
from threading import Lock
from tkinter import font
from typing import ClassVar, Optional
from util import Animatable, set_callback_property
class Marquee(tk.Canvas, Animatable):
_text_id: Optional[int]
@apple1417
apple1417 / hunt_scraper.py
Created February 27, 2021 23:48
Scrapes the BL3 hunt webpage and writes your points/rank to a file, which obs can use as a text source so that you don't have to update it manually.
import traceback
from datetime import timedelta
from time import sleep
import requests
from bs4 import BeautifulSoup
"""
====================================================================================================
Only edit these constants between the two lines
# https://docs.google.com/spreadsheets/d/1GrSU0VQN3oTZLa5dYV0AzyYFkdEaECHYjh79UUfAb38/edit?usp=sharing
import csv
import png
# Originally from https://sashamaps.net/docs/tools/20-colors/
COLOUR_LIST = [
(230, 25, 75), ( 60, 180, 75), (255, 225, 25), ( 0, 130, 200),
(245, 130, 48), (145, 30, 180), (240, 50, 230), (210, 245, 60),
(250, 190, 212), (170, 110, 40), (128, 0, 0), (128, 128, 0),

Serial Version Edit

Converts BL3 item serial codes into equivalents at other versions.

Background

If you've ever tried downpatching your game you've probably noticed it makes all your items disappear. This tool helps avoid that.

Your save file contains all items stored as serial codes. Each serial code has a version embedded in it, and when the game loads your character it completely ignores any serial codes with a greater version than what it can handle. Unfortuantly, whenever the game saves your character, it saves the serial codes at the latest version, even if it could fit into an earlier one. This is why items disappear - they're all at the latest vesion, so older game versions cannot handle them.

This tool lets you convert the serial codes to other versions, so hopefully you can find a version of the code that an older patch of the game will load.

Finding BL3 load remover pointers

All this only applies to the Steam version. The Epic version likely works similarly, but I can't test.

This might not be the best way of doing these things, but knowing the process might be helpful for finding similar ones in other unreal games.

I originally found the pointers on OAK-PATCHWIN64-79 (aka the cartel event patch) if you want to double check addresses. Unfortuantly I wasn't able to find nice AOB scans to easily convert them to other versions, but having knowledge of how they should work already makes it easier.

Main Menu

<Structures>
<Structure Name="Engine._pNetwork" AutoFill="0" AutoCreate="1" DefaultHex="0" AutoDestroy="0" DoNotSaveLocal="0" RLECompression="1" AutoCreateStructsize="4096">
<Elements>
<Element Offset="0" Vartype="Pointer" Bytesize="4" OffsetHex="00000000" Description="NetworkLibrary Instance" DisplayMethod="unsigned integer">
<Structure Name="Autocreated from 02E799A0" AutoFill="0" AutoCreate="1" DefaultHex="0" AutoDestroy="0" DoNotSaveLocal="0" RLECompression="1" AutoCreateStructsize="4096">
<Elements>
<Element Offset="32" Vartype="Pointer" Bytesize="4" OffsetHex="00000020" Description="ga_sesSessionState" DisplayMethod="unsigned integer">
<Structure Name="Autocreated from 02E55898" AutoFill="0" AutoCreate="1" DefaultHex="0" AutoDestroy="0" DoNotSaveLocal="0" RLECompression="1" AutoCreateStructsize="4096">
<Elements>
@apple1417
apple1417 / SSRev.CSX
Last active February 13, 2020 18:21
Cheat Engine Structs for Serious Sam Revolution
<Structures>
<Structure Name="Engine._pNetwork" AutoFill="0" AutoCreate="1" DefaultHex="0" AutoDestroy="0" DoNotSaveLocal="0" RLECompression="1" AutoCreateStructsize="4096">
<Elements>
<Element Offset="0" Vartype="Pointer" Bytesize="4" Description="NetworkLibrary Instance" DisplayMethod="Unsigned Integer">
<Structure Name="Autocreated from 02E799A0" AutoFill="0" AutoCreate="1" DefaultHex="0" AutoDestroy="0" DoNotSaveLocal="0" RLECompression="1" AutoCreateStructsize="4096">
<Elements>
<Element Offset="32" Vartype="Pointer" Bytesize="4" Description="ga_sesSessionState" DisplayMethod="Unsigned Integer">
<Structure Name="Autocreated from 02E55898" AutoFill="0" AutoCreate="1" DefaultHex="0" AutoDestroy="0" DoNotSaveLocal="0" RLECompression="1" AutoCreateStructsize="4096">
<Elements>