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.
Zero Tolerance for Disrespect

Crimson Skies: High Road to Revenge (*.tga)

Featured Replies

  • Supporter
  • Solution

Well this should do...

from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("Crimson Skies: High Road to Revenge Env tex(*.dds)", "dds")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
   noesis.logPopup()
   return 1
        
def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 20:
      return 0
   return 1
   
def noepyLoadRGBA(data, texList):
    bs = NoeBitStream(data)
    baseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
    print(baseName)
    ImgWidth = bs.readUInt()
    ImgHeight = bs.readUInt()
    PixelFormat = bs.readUInt()
    MipMap = bs.readUInt()
    for i in range(6):
        ImgSize = bs.readUInt()
        data = bs.readBytes(ImgSize)
        MipCount = MipMap - 1
        for j in range(MipCount):
            DataSize = bs.readUInt()
            MipData = bs.readBytes(DataSize)
            
        if PixelFormat == 1:
            texFmt = noesis.NOESISTEX_DXT1
        elif PixelFormat == 3:
            texFmt = noesis.NOESISTEX_DXT3
        elif PixelFormat == 5:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "r8 g8 b8 a8", noesis.NTEXFLAG_CUBEMAP)
            texFmt = noesis.NOESISTEX_DXT5
        elif PixelFormat == 6:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "b0 g0 r0 a16")
            #data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 14:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "b5 g6 r5 a0")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 15:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "r8 g8 b8 a8")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 16:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "b8 g8 r8 a8")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 19:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "r0 g0 b0 a8")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 20:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "r8 g8 b8 a8")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        texList.append(NoeTexture(rapi.getInputName(), ImgWidth, ImgHeight, data, texFmt))
    return 1

 

  • Author
  • Localization
19 hours ago, h3x3r said:

Well this should do...

from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("Crimson Skies: High Road to Revenge Env tex(*.dds)", "dds")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
   noesis.logPopup()
   return 1
        
def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 20:
      return 0
   return 1
   
def noepyLoadRGBA(data, texList):
    bs = NoeBitStream(data)
    baseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
    print(baseName)
    ImgWidth = bs.readUInt()
    ImgHeight = bs.readUInt()
    PixelFormat = bs.readUInt()
    MipMap = bs.readUInt()
    for i in range(6):
        ImgSize = bs.readUInt()
        data = bs.readBytes(ImgSize)
        MipCount = MipMap - 1
        for j in range(MipCount):
            DataSize = bs.readUInt()
            MipData = bs.readBytes(DataSize)
            
        if PixelFormat == 1:
            texFmt = noesis.NOESISTEX_DXT1
        elif PixelFormat == 3:
            texFmt = noesis.NOESISTEX_DXT3
        elif PixelFormat == 5:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "r8 g8 b8 a8", noesis.NTEXFLAG_CUBEMAP)
            texFmt = noesis.NOESISTEX_DXT5
        elif PixelFormat == 6:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "b0 g0 r0 a16")
            #data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 14:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "b5 g6 r5 a0")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 15:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "r8 g8 b8 a8")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 16:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "b8 g8 r8 a8")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 19:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "r0 g0 b0 a8")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        elif PixelFormat == 20:
            data = rapi.imageDecodeRaw(data, ImgWidth, ImgHeight, "r8 g8 b8 a8")
            data = rapi.imageFromMortonOrder(data, ImgWidth, ImgHeight, 4)
            texFmt = noesis.NOESISTEX_RGBA32
        texList.append(NoeTexture(rapi.getInputName(), ImgWidth, ImgHeight, data, texFmt))
    return 1

 

did some testing, looks like this works fine! with the exception of the random ~a in some textures, looks like all of the CS:HRTR textures can now be extracted!

cheers and thanks a ton, really appreciate the help you guys ❤️ 

Edited by notameowcelot

  • Author
  • Localization

...found an odd .tga that just won't extract, actually! Can't zip it due to my max total size being at 80kb for some reason, but let me know if there's a way to send it through mega perhaps

On 4/22/2024 at 6:10 PM, notameowcelot said:

did some testing, looks like this works fine! with the exception of the random ~a in some textures, looks like all of the CS:HRTR textures can now be extracted!

cheers and thanks a ton, really appreciate the help you guys ❤️ 

 

  • Author
  • Localization
16 hours ago, h3x3r said:

Tell me a path and name of a file. I have game files.

Should be PF_Gangster.bin (found in airplanes.zip if you're using retail or August 2003 prototype builds), GangsterPF.tga.

Edited by notameowcelot

  • Supporter

Well i checked it but don't know what's goin on. Texture format is DXT1 but noesis strugle to open it. Not sure why. There's no error at all.

When i tried it in Raw Texture Cooker it show it properly.

On 4/24/2024 at 4:11 AM, notameowcelot said:

cheers and thanks a ton, really appreciate the help you guys

@notameowcelot Barring some smaller loose ends, would you consider this topic solved via h3x3r's original post (or the April 21st one)? "..." / "Mark as solution" Cheers.

Edited by piken

  • Author
  • Localization
13 hours ago, piken said:

@notameowcelot Barring some smaller loose ends, would you consider this topic solved via h3x3r's original post (or the April 21st one)? "..." / "Mark as solution" Cheers.

Aye, will consider it solved! Just gotta figure out the ~a and this weird issue with PF_Gangster but that should be it.

Create an account or sign in to comment

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.