Skip to content

Instantly share code, notes, and snippets.

View MaKiPL's full-sized avatar
🐈
Petting every stray cat I can find

Marcin Gomulak MaKiPL

🐈
Petting every stray cat I can find
  • AnotherMoon
  • Poland
View GitHub Profile
@MaKiPL
MaKiPL / kh2hdext.py
Created October 31, 2019 13:19
Kingdom Hearts 2.5 HD ReMix PS3 file extractor
import sys
import struct
import os
def ReadEntry():
filename = str(fd.read(0x20)).strip('\x00')
offset = struct.unpack('>Q', fd.read(8))[0]
entrySize = struct.unpack('>Q', fd.read(8))[0]
fd.seek(0x10, 1) # unk
@MaKiPL
MaKiPL / SH_Downpour_PS3extract
Created April 25, 2019 19:50
COALESCED PS3 - Silent Hill Downpour [WIP]
Looks like the internet is completely empty now on all the data about PS3 big-endian coalesced BIN files. For example:
the popular ME3Explorer tool expect completely different structure. Another example provides of exporting and importing files with AutoIt3 script by swuforce. AutoIt? Really...
Therefore given example of SHGAME\COOKEDPS3\COALESCED_INT.BIN gives this structure:
BIG-ENDIAN
uint fileCount
sint abs(fileNameSize*2)
wchar fileName[abs(fileNameSize)] //includes null terminator. fileNameSize corresponds to real bytes rather than wchar count. Therefore "game" in wchar/unicode is actually 8 bytes
uint fileSize
@MaKiPL
MaKiPL / FF8_cameraDumper.py
Created January 4, 2019 13:52
Final Fantasy VIII battle stage camera pointers dumper- use for reverse engineering and/or camera modding
import sys
import struct
_5d4 = [4,5,9,12,13,14,15,21,22,23,24,26, 29,32,33,34,35,36,39,40,50,53,55,61,62,63,64,65,66,67,68,69,70, 71,72,73,75,78,82,83,85,86,87,88,89,90,91,94,96,97,98,99,100,105, 106,121,122,123,124,125,126,127,135,138,141,144,145,148,149,150,151,158,160]
_5d8 = [0,1,2,3,6,7,10,11,17,18,25,27,28,38,41,42,43,47,49,57,58,59,60,74,76,77,80,81,84,93,95,101,102,103,104,109,110,111,112,113,114,115,116,117,118,119,120,128,129,130,131,132,133,134,139,140,143,146,152,153,154,155,156,159,161,162]
fd = open(sys.argv[1], 'rb')
stageid = int(sys.argv[1][5:8])
if stageid in _5d4:
fd.seek(0x5d4, 0)