Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Chicken Invaders Universe .tga

Featured Replies

  • Author
  • Localization

EmeraldPlay, posted Fri Jan 11, 2019 8:19 pm (42192)


Hello,
I'm looking for a way to reliably convert the .tga files present in Chicken Invaders Universe's files to make them readable in editing software. Those .tga files are similar to regular ones, but their headers are messed up (they only contain texture size and the amount of bits per pixel). I already know how to make them readable through hex editing, but that method takes a while to do, which is why I'm looking for a script that would do it faster. I'll explain how to do it below:

First, here is an example header similar to what's used in the game's texture files.
Code:
00?01?00?00?00?01?00?00?20?00?00?00

And here's the end result after converting the header to make the file readable in editing software.
Code:
00?00?02?00?00?00?00?00?00?00?00?00?00?01?00?01?20?00

To convert the example header, first, the third, fourth, seventh, eighth, eleventh and twelfth bytes (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B) need to be removed.
Code:
00?01?'00?00'?00?01?'00?00'?20?00?'00?00'

That will leave you with six bytes. After that, twelve bytes need to be appended to the beginning of the header. The bytes that need to be appended depend on the ninth byte (0x08) in the example header. If that byte is set to 20, then the 12 bytes need to be appended like this:
Code:
'00?00?02?00?00?00?00?00?00?00?00?00'?00?01?00?01?20?00

In this case, the twelve bytes are "00?00?02?00?00?00?00?00?00?00?00?00".
However, if the ninth byte (0x08) in the example header is set to 08, then the twelve bytes will be different:
Code:
'00?00?03?00?00?00?00?00?00?00?00?00'?00?01?00?01?"08"?00

And in this case, the twelve bytes will be "00?00?03?00?00?00?00?00?00?00?00?00".



That's all the script needs to do. It would also be useful if this script could do that to multiple files in a folder instead of only one, and if there was another one for reverting the changes for easier reimporting.

EDIT: I forgot to include some example files to try the script on. You can get them here.
  • Author
  • Localization

Acewell, posted Sat Jan 12, 2019 5:10 am (42227)


this bms script will write new headers to your tga samples. :D
Code:
# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

get NAME basename
string NAME _fixed.tga
get WIDTH long
get HEIGHT long
get TYPE long
savepos OFFSET
get SIZE asize
math SIZE - OFFSET
log memory_file 0x0 0x12
if TYPE == 0x8
    put 0x0 short -1
    put 0x3 short -1
    put 0x0 long -1
    put 0x0 long -1
    put WIDTH short -1
    put HEIGHT short -1
    put 0x8 byte -1
    put 0x8 byte -1
elif TYPE == 0x20
    put 0x0 short -1
    put 0x2 short -1
    put 0x0 long -1
    put 0x0 long -1
    put WIDTH short -1
    put HEIGHT short -1
    put 0x20 byte -1
    put 0x0 byte -1
endif
log NAME 0x0 0x12 -1
append
log NAME OFFSET SIZE
append
  • Author
  • Localization

EmeraldPlay, posted Sun Jan 13, 2019 12:34 am (42263)


Thanks.
  • Author
  • Localization

mohammad as, posted Fri Aug 07, 2020 8:26 am (57940)


How do I use codes?
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.