Skip to content

Instantly share code, notes, and snippets.

View aerosoul94's full-sized avatar

aerosoul94

View GitHub Profile
import sys
def read_uint32(stream):
return int.from_bytes(stream.read(4), 'big')
def read_uint64(stream):
return int.from_bytes(stream.read(8), 'big')
class BDEmuImageDetail:
@aerosoul94
aerosoul94 / net_decrypt.py
Created February 10, 2023 22:18
TLOU net-patch.bin crypto tools
import hmac
import hashlib
import sys
import blowfish # pip install blowfish
def decrypt_and_verify(file_name):
cipher = blowfish.Cipher(b'(SH[@2>r62%5+QKpy|g6')
h = hmac.new(b'xM;6X%/p^L/:}-5QoA+K8:F*M!~sb(WK<E%6sW_un0a[7Gm6,()kHoXY+yI/s;Ba',
digestmod=hashlib.sha1)
with open(file_name, 'rb') as fp:
@aerosoul94
aerosoul94 / xbebrutehash.py
Created November 24, 2022 00:00
Finds xbe sections in an hdd image using the section hashes
import sys
import hashlib
def brutehash(path, start, end, size, secthash):
with open(path, 'rb') as fp:
fp.seek(start)
blocksize = 0x1000 # PAGE_SIZE
seed = size.to_bytes(4, byteorder='little')
for block in range(start, end, blocksize):
fp.seek(block)
# Find and load exports, imports, and opd section for PS3 elf's.
#@author aerosoul
#@category Analysis
#@keybinding
#@menupath
#@toolbar
# NOTE:
# You may also want to enable Propagate R2 Pointer for the PowerPC
# Constant Reference Analyzer in order to fill in the remaining
@aerosoul94
aerosoul94 / extractall.py
Last active November 13, 2023 01:48
Script for extracting League of Legends Solid State Network solid files
import xml.etree.ElementTree as ET
import zlib
import struct
import argparse
import os
class File:
def __init__(self, elem):
self._file_name = elem.find('FileName').text
self._file_index = int(elem.find('FileIndex').text)
@aerosoul94
aerosoul94 / dc-disassemble.py
Last active October 3, 2023 13:37
The Last of Us script disassembler
import struct
import sys
import re
import os
#
## StringId Generation
#
def create_table(poly):
@aerosoul94
aerosoul94 / ps3rec.py
Last active December 31, 2020 21:31
PS3 Data Recovery
import os
import struct
import sys
import zlib
import argparse
import ctypes
class FileCarver(object):
def __init__(self, f, offset):
@aerosoul94
aerosoul94 / fios.py
Created February 19, 2020 00:48
Dump FIOS cache files
from datetime import datetime
import struct
import os
class CacheDescriptor(object):
DESCRIPTOR_FMT = ">QQQQII16s456x"
def __init__(self, f):
(self.accessDate,
self.modificationDate,
@aerosoul94
aerosoul94 / X360Partitions.md
Last active July 5, 2020 19:51
XBOX 360 Partition Documentation

1746

Dev

Partition Name Start (in sectors) Length (NSectors) Notes
PhysicalDisk 0 DiskNSectors Covers entire drive
Partition0 0 DiskNSectors Covers entire drive
PixDump 0x400 (DiskNSectors / 8) & 0x1fffff80 DiskSize / PageSize?
DumpPartition PixDumpStart+ PixDumpNSectors 0x107180 After PixDump
SystemPartition DumpPartitionStart + DumpPartitionNSectors 0x10000 After DumpPartition
Partition1 SystemPartitionStart + SystemPartitionNSectors AltFlashStart - (SystemPartitionStart + SystemPartitionNSectors) After SystemPartition
@aerosoul94
aerosoul94 / VitaReloc.md
Last active January 28, 2023 00:46
Visualize bit fields in PSVita relocations.