The game is a free to play mmo called Rise of Immortals http://www.riseofimmortals.com/
This code also works on other Petroglyph games using the alo format.
Download the client for free for a sample of your own
Ok in this particular format the file contains one zlib chunk that needs to be decompressed to gain access to the model
They only give us the compressed size and a constant offset the data starts at.
So the format of these alo files is
Bytes 01 - 16 #Header Information
Bytes 17 - 20 #Compressed size
Offset 36 #Start of zlib data
So knowing this we can use this code here to get the raw file in memory to work with
Code: Select all
#load the model
def noepyLoadModel(data, mdlList):
ctx = rapi.rpgCreateContext()
bs = NoeBitStream(data)
bs.seek(16, NOESEEK_ABS)
compsize = bs.read("i")
bs.seek(36, NOESEEK_ABS)
decompData = bytearray()
cmpData = bs.readBytes(compsize[0])
decompSize = rapi.getInflatedSize(cmpData)
decompData += rapi.decompInflate(cmpData, decompSize)
bs.seek(0, NOESEEK_ABS)
bs = NoeBitStream(decompData, NOE_LITTLEENDIAN)
We create a context with
ctx = rapi.rpgCreateContext()
Then we open our byte stream
bs = NoeBitStream(data)
Then We get the compressed size of the zlib chunk
Code: Select all
bs.seek(16, NOESEEK_ABS)
compsize = bs.read("i")
Code: Select all
decompData = bytearray()
Code: Select all
cmpData = bs.readBytes(compsize[0])
Code: Select all
decompSize = rapi.getInflatedSize(cmpData)
Code: Select all
decompData += rapi.decompInflate(cmpData, decompSize)
Code: Select all
bs.seek(0, NOESEEK_ABS)
bs = NoeBitStream(decompData, NOE_LITTLEENDIAN)
The end result
If anyone has any questions on anything done in this model format just ask.