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.

Ridge Racer 7 tex file

Featured Replies

  • Author
  • Localization

h3x3r, posted Sat Feb 25, 2023 9:38 am (75572)


It's a container. Table is in BigEndian. File count starts at 0x10 and offsets starts at 0x14.
I will try to make a bms for unpack RPT container and then noesis script for export R7T container.

O.K here's bms to unpack RPT. Just add *.dat extension to it.
Code:
############################
# Ridge Racer 7 tex unpack #
############################
endian big
get baseFileName basename

get Magic uint32
if Magic == 1380996096      # RPT
   getdstring dummy 0xC
   savepos baseOffset
   get files uint32
elif Magic == 1098015564   # ArcL
   get files uint32
   getdstring dummy 0x8
   savepos baseOffset
elif Magic == 1346454347   # PACK
   get files uint32
endif

for i = 0 < files
   if Magic != 1346454347
      get offset uint32
      math offset baseOffset
      savepos tmp
   else
      get offset uint32
      get fileNum uint32
      get fileSize uint32
      savepos tmp
   endif
   goto offset
   getdstring dummy 0x8
   get fileId uint32
   getdstring dummy 0x18
   get size uint32
   math size 40
   string name p= "%s/%u.r7t" baseFileName fileId
   log name offset size
   goto tmp
next i

And here's noesis script tested on provided samples. Anyway there is one or meaybe more formats which uses ps3 swizzle. So those you must convert with Raw texture previewer/converter.
Code:
from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("Ridge Racer 7 - Texture", ".r7t")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
   noesis.logPopup()
   return 1
       
def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 20:
      return 0
   if bs.readUInt() != 0x00543752:
      return 0
   return 1
   
def noepyLoadRGBA(data, texList):
    bs = NoeBitStream(data,NOE_BIGENDIAN)
    texBaseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
    texMagic = bs.readUInt()
    bs.readBytes(12)
    texPixelFormat = bs.readUByte()
    bs.readBytes(7)
    texWidth = bs.readUShort()
    texHeight = bs.readUShort()
    bs.readBytes(8)
    texSize = bs.readUInt()
 
    data = bs.readBytes(texSize)
    if texPixelFormat == 136:
        data = rapi.imageDecodeDXT(data, texWidth, texHeight, noesis.NOESISTEX_DXT5)
        texFmt = noesis.NOESISTEX_RGBA32
        print("Pixel Format > DXT5")
        print("Texture Width  >",texWidth)
        print("Texture Height >",texHeight)
    elif texPixelFormat == 134:
        data = rapi.imageDecodeDXT(data, texWidth, texHeight, noesis.NOESISTEX_DXT1)
        texFmt = noesis.NOESISTEX_RGBA32
        print("Pixel Format > DXT1")
        print("Texture Width  >",texWidth)
        print("Texture Height >",texHeight)
    elif texPixelFormat == 133:
        data = rapi.imageDecodeRaw(data, texWidth, texHeight, "a8r8g8b8")
        texFmt = noesis.NOESISTEX_RGBA32
        print("Pixel Format > RGBA8 PS3 swizzle")
        print("Texture Width  >",texWidth)
        print("Texture Height >",texHeight)
    texList.append(NoeTexture(rapi.getInputName(), texWidth, texHeight, data, texFmt))
    return 1
  • Author
  • Localization

Bl4z3_Ice, posted Sun Feb 26, 2023 2:50 am (75578)


h3x3r wrote:
It's a container. Table is in BigEndian. File count starts at 0x10 and offsets starts at 0x14.
I will try to make a bms for unpack RPT container and then noesis script for export R7T container.

O.K here's bms to unpack RPT. Just add *.dat extension to it.
Code:
############################
# Ridge Racer 7 tex unpack #
############################
endian big
get baseFileName basename

idstring "RPT"
getdstring dummy 0xD
savepos baseOffset

get files uint32

for i = 0 < files
   get offset uint32
   math offset baseOffset
   savepos tmp
   goto offset
   getdstring dummy 0x8
   get fileId uint32
   getdstring dummy 0x18
   get size uint32
   math size 40
   string name p= "%s/%u.r7t" baseFileName fileId
   log name offset size
   goto tmp
next i

And here's noesis script tested on provided samples. Anyway there is one or meaybe more formats which uses ps3 swizzle. So those you must convert with Raw texture previewer/converter.
Code:
from inc_noesis import *
import noesis
import rapi
import os

def registerNoesisTypes():
   handle = noesis.register("Ridge Racer 7 - Texture", ".r7t")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
   noesis.logPopup()
   return 1
       
def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 20:
      return 0
   if bs.readUInt() != 0x00543752:
      return 0
   return 1
   
def noepyLoadRGBA(data, texList):
    bs = NoeBitStream(data,NOE_BIGENDIAN)
    texBaseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName()))
    texMagic = bs.readUInt()
    bs.readBytes(12)
    texPixelFormat = bs.readUByte()
    bs.readBytes(7)
    texWidth = bs.readUShort()
    texHeight = bs.readUShort()
    bs.readBytes(8)
    texSize = bs.readUInt()
 
    data = bs.readBytes(texSize)
    if texPixelFormat == 136:
        data = rapi.imageDecodeDXT(data, texWidth, texHeight, noesis.NOESISTEX_DXT5)
        texFmt = noesis.NOESISTEX_RGBA32
        print("Pixel Format > DXT5")
    elif texPixelFormat == 134:
        data = rapi.imageDecodeDXT(data, texWidth, texHeight, noesis.NOESISTEX_DXT1)
        texFmt = noesis.NOESISTEX_RGBA32
        print("Pixel Format > DXT1")
    elif texPixelFormat == 133:
        data = rapi.imageDecodeRaw(data, texWidth, texHeight, "a8r8g8b8")
        texFmt = noesis.NOESISTEX_RGBA32
        print("Pixel Format > RGBA8 PS3 swizzle")
    texList.append(NoeTexture(rapi.getInputName(), texWidth, texHeight, data, texFmt))
    return 1


thank you so much brother. btw I've found i guess one broken yellow texture after extracting it. is it normal?
  • Author
  • Localization

h3x3r, posted Sun Feb 26, 2023 7:25 am (75579)


Bl4z3_Ice wrote:
btw I've found i guess one broken yellow texture after extracting it. is it normal?

Yep, these are ps3 swizzled. You must use raw texture converter. Just open r7t file in raw texture converter and set offset 0x28 and don't forget to check ps3 swizzle flag.
This is what i get with raw tex conv.
Image
Not sure about pixel format, but it's definitely 8 bit per pixel. I tried one of these and i get something like masks in channels.
And this is how it looks in photoshop.
Image
Try to capture some textures with ninja ripper or any tool which can capture textures from PS3 emu.

EDiT: I updated my previous post. Bms now supports 3 formats of texture archive.
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.