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.

Madagascar : extracting textures in png or bmp help

Featured Replies

  • Author
  • Localization

HARVLAW_ORENGI, posted Sun Apr 23, 2017 10:28 am (22570)


Hey guys, i need some help extracting texture's from Madagascar and if anyone could tell me how to unpack and repack the textures in png or bmp format , that would be great :D .
the type of file is a .stream

Download the .stream i'm on about : http://download1509.mediafireuserdownload.com/9xavvk73tspg/nljg14zoiosub9v/banquet.stream

i tried using this but this bms code only extracts one texture and it extract's it in txd format

Get Q ASIZE 0 ;
Math offset = 1
For T = 0 Math OFFSET = 1 ;
GoTo OFFSET 0
findloc OFFSET string "\x72\x77\x49\x44\x5F\x54\x45\x58\x44\x49\x43\x54\x49\x4F\x4E\x41\x52\x59" 0 0 ;
If OFFSET = 0 ;
Math T = Q ;
Math T = 1 ;
ELSE ;
GoTo OFFSET 0 ;
SavePos start 0 ;
GoTo 0x14 0 SEEK_CUR ;
SavePos start 0 ;
Get namelength Long 0 ;
GoTo start 0 ;
GoTo namelength 0 SEEK_CUR ;
GoTo 0x10 0 SEEK_CUR ;
Get size Long 0 ;
SavePos start 0 ;
Math x = T ;
string x = .TXD ;
Log x start size 0 ;
EndIF ;
Next T ;
  • Author
  • Localization

StreamThread, posted Sun Apr 23, 2017 8:16 pm (22582)


That is RenderWare 3x engine stream data. Sections IDs is modified.
  • Author
  • Localization

StreamThread, posted Mon Apr 24, 2017 8:55 pm (22628)


QuickBMS unpack script:

Code:

# RenderWare 3.6.0.2 binary stream file unpacker v.0.1 (Madagascar: The game)

get sSize asize

for
math I 1
log memory_file 0 0
get rwType long
set fName string I
string fName "_"
get sectSize long
get rwVersion long
savepos sectOffset

     if rwType != 1814
        string fName rwType
        string fName .UNK
        log fName sectOffset sectSize
     else
        log memory_file sectOffset sectSize
     endif

     if rwType == 1814
        get headerSize long memory_file
        savepos headerStart memory_file
        get nameSize long memory_file
        get rwName string memory_file
        string fName rwName
        strlen fNameLen rwName
        math nameSize - fNameLen
        math nameSize - 1
        goto nameSize memory_file SEEK_CUR
        goto 16 memory_file SEEK_CUR
        get rwID_Size long memory_file
        get rwID string memory_file

        if rwID == "rwID_TEXDICTIONARY"
           string fName - .txd #subtract extension for debug
           string fName - .TXD
           string fName .txd
        elif rwID == "rwaID_WAVEDICT"
           string fName - .rws
           string fName - .RWS
           string fName .rws
        elif rwID == "rwID_WORLD"
           string fName - .bsp
           string fName - .BSP
           string fName .bsp
        elif rwID == "TextStringDict"
           string fName - .txl
           string fName - .TXL
           string fName .txl
        elif rwID == "rwID_CLUMP"
           string fName - .dff
           string fName - .DFF
           string fName .dff
        elif rwID == "rwID_HANIMANIMATION"
           string fName - .anm
           string fName - .ANM
           string fName .anm
        elif rwID == "SCRIPT"
           string fName - .ai
           string fName - .AI
           string fName .ai
        elif rwID == "TEXT"
           string fName .TEXT
        elif rwID == "rwID_2DFONT"
           string fName - .fnt
           string fName - .FNT
           string fName .fnt
        elif rwID == "KFset"
           string fName - .lpa
           string fName - .LPA
           string fName .lpa
       #DEBUGELSE
        else
           string fName "."
           string fName rwID
        endif
      
        goto headerStart memory_file SEEK_SET
        goto headerSize memory_file SEEK_CUR
        get fSize long memory_file
        savepos fOffset memory_file
        log fName fOffset fSize memory_file
     endif

goto sectSize 0 SEEK_CUR
savepos checkPos

     if checkPos == sSize
        print "Files Extracted: %i%"
        cleanexit
     endif
next



*.TXD and *.DFF files can be opened with various of fan-made GTA tools (like Magic.TXD, 3ds max DFF plugins).

RenderWare_STREAM.bms

  • Author
  • Localization

HARVLAW_ORENGI, posted Wed Apr 26, 2017 3:15 pm (22661)


:D :D :D thank you so much , when i make mods in the future i will give you credit for helping , thanks i appreciate it :D
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.