hacktools¶
A set of utilities and tools for rom hacking and translations.
Documentation is available at illidanz.github.io/hacktools.
Installing dependencies¶
Most dependencies are optional, and can be installed with pip install 'hacktools[name1,name2]' or pip install 'hacktools[all]' to install all of them.
Dependencies list¶
nds: needed for NDS roms and compressed binaries.psp: needed for PSP ISO/BIN signing.iso: needed for PSX/PS2 ISO.graphics: needed for most functions that deal with graphics.cli: needed by tools that use CLI/GUI.armips: needed forcommon.armipsPatch.xdelta: needed forcommon.xdeltaPatch.ips: needed forcommon.ipsPatch.
Supported platforms and formats¶
External dependencies not included are marked as (through *dependency*)
NDS¶
ROM
NCGR/NSCR/NCER/NCLR images
NBFC/NTFT/NBFS/NBFP images
NFTR fonts
NARC archives
Textures in NSBMD 3D files
PSP¶
ISO
GIM/GMO images
PGF fonts
PMF header for MPS movies
BIN signing
PSX¶
BIN/ISO
TIM images
WonderSwan / WonderSwan Color¶
ROM banks
Assembly (through NASM)
Raw and tiled images
Sprites
GameBoy¶
ROM banks
Assembly (through wla-gb and wlalink)
Wii¶
Other / Generic¶
CPK archives
ARCH archives (including compression/decompression)
LZ10, LZ11, Huffman, CRILAYLA and RACJIN compression/decompression
ARM/MIPS binary patching
xdelta patch creation
IPS patch creation
API Reference¶
- arch
- common
StreamFileFiltersetupFileLogging()logMessage()logDebug()logWarning()logError()varsHex()showProgress()toHex()isAscii()codeToChar()loadTable()shiftPointer()checkShiftJIS()openSection()getSectionNames()getSection()getSections()getSectionPercentage()mergeSections()TranslationFileFontGlyphwordwrap()centerLines()readEncodedString()detectEncodedString()detectASCIIString()writeEncodedString()extractBinaryStrings()BinaryPointerrepackBinaryStrings()makeFolder()clearFolder()copyFolder()mergeFolder()copyFile()makeFolders()getFiles()getFolders()bundledFile()bundledExecutable()execute()crcFile()crc16()xdeltaPatch()ipsPatch()armipsPatch()deltaToFrame()readPalette()getColorDistance()sumColors()readRGB5A3()readRGB5A1()getPaletteIndex()findBestPalette()drawPalette()flipTile()
- compression
- cpk
- gb
- gui
- nasm
- nds
- nitro
extractNSBMD()repackNSBMD()extractIMG()repackIMG()FontNFTRFontHDWCFontPAMCreadNFTR()extractFontData()NARCNARCFilereadNARC()extractNARCFile()extractNARC()repackNARCFile()repackNARC()NCGRNSCRMapNCERBankCellreadNitroGraphic()readNCLR()readNCGR()readNCGRTiles()readNSCR()readMapData()getNCERCellSize()readNCER()cellIntersect()tileToPixels()drawNCER()drawNCGR()writeNCGRData()writeNCGRTile()writeNCGR()writeNSCR()writeMappedNSCR()writeMultiMappedNSCR()searchTile()writeNCER()NSBMDbppNSBMDNSBMDTextureNSBMDPalettereadTEX0()readNSBMD()readNSBTX()drawNSBMD()writeNSBMD()readManualCells()readNitroGraphicNBFC()readNitroGraphicNTFT()readNBFP()readNBFC()readNBFS()
- ps2
- psp
extractIso()repackIso()UMDFilerepackUMD()searchUMD()ELFELFSectionreadELF()expandELF()extractBinaryStrings()repackBinaryStrings()decryptBIN()signBIN()GIMGIMImageTGAImageGMOreadGMO()readGMOChunk()readGIM()readGIMBlock()writeGIM()writeGIMPixel()readColor()writeColor()drawGIM()drawGIMPixel()PGFPGFGlyphgetBPEValue()readBPETable()setBPEValue()setBPETable()readPGFData()fontpaletteextractPGFBitmap()bitmapRLE()repackPGFBitmap()extractPGFData()checkPGFDataMap()repackPGFData()mpstopmf()
- psx
- wii
extractARC()extractTPL()repackTPL()repackARC()extractBREFT()extractBRTEX()repackBRTEX()extractBRFNT()repackBRFNT()extractIso()repackIso()getTexDataSize()getTPLTransform()getTexTransform()texToTPL()tplToTex()TPLTPLImagereadTPL()writeTPL()getFontGlyphs()extractFontData()repackFontData()
- ws
extractRom()repackRom()memoryToBank()readPointer()readTile()writeTile()bwpalettecolpaletteextractImage()repackImage()extractTiledImage()repackTiledImage()TileMapTileDataSpriteDatareadPalette()writePalette()readMappedImage()readSprite()extractMappedImage()writeMappedImage()repackMappedImage()repackMappedTiles()