Results 1 to 1 of 1
  1. #1
    h4x0r
    h4x0r is offline
    h4x0r's Avatar
    Join Date
    2011 Aug
    Location
    ..\root\home\pgc
    Posts
    826
    Thanks
    64
    Thanked 525 Times in 205 Posts
    Rep Power
    8

    Grimlands Online O3PK Unpack Script

    Script by aluigi
    Game: Grimlands Online

    For unpack you need QuickBMS Tool.

    PHP Code:
    # O3PK archive
    #   Grimlands
    # script for QuickBMS http://quickbms.aluigi.org

    print "this script MUST be launched with the -9 option!!!"

    idstring "O3PK"
    get DUMMY long
    get VER short
    getdstring DUMMY 14
    get OFFSET longlong
    goto OFFSET
    idstring 
    "HSHT"
    get DUMMY long
    get XFILES long 
    # entries
    get FILES long  # real files
    get OFFSET longlong
    get DUMMY long
    get ZSIZE long
    math SIZE 
    XFILES
    math SIZE 
    *= 0x28
    clog MEMORY_FILE OFFSET ZSIZE SIZE

    # pre-allocate space for the arrays
    putarray 0 XFILES 0
    putarray 1 XFILES 0
    putarray 2 XFILES 0

    print "collecting OFFSET and SIZE..."
    math NAMES_OFF  0
    math NAMES_SIZE 
    0
    math j 
    0
    for XFILES
        get DUMMY longlong MEMORY_FILE
        get OFFSET longlong MEMORY_FILE
        get DUMMY longlong MEMORY_FILE
        get SIZE long MEMORY_FILE
        get CHUNKED long MEMORY_FILE    
    # ???
        
    getdstring DUMMY 0x8 MEMORY_FILE
        
    if OFFSET != 0
            putarray 1 j OFFSET
            putarray 2 j SIZE
            math j 
    += 1

            
    if OFFSET NAMES_OFF
                math NAMES_OFF  
    OFFSET
                math NAMES_SIZE 
    SIZE
            
    endif
        endif
    next i

    print "collecting filenames..."
    math OFFSET NAMES_OFF
    math SIZE   
    NAMES_SIZE
    callfunction UNCHUNK 1
    goto 0 MEMORY_FILE2
    for FILES   #XFILES
        
    savepos TMP MEMORY_FILE2
        
    if TMP SIZE
            
    #get NAME line MEMORY_FILE2
            
    getct NAME string 0xa MEMORY_FILE2
        
    else
            
    set NAME string ""
        
    endif
        
    putarray 0 i NAME
    next i

    print "OFFSET sorting, wait patiently!!!"
    math TMP FILES
    math TMP 
    -= 1
    for TMP
        getarray OFFSET 1 i
        math j 
    i
        
    for += FILES
            getarray OFFSET2 1 j
            
    if OFFSET2 uOFFSET
                getarray SIZE  2 i
                getarray SIZE2 2 j
                putarray 1 i OFFSET2
                putarray 2 i SIZE2
                putarray 1 j OFFSET
                putarray 2 j SIZE
                math OFFSET 
    OFFSET2
            
    endif
        
    next j
    next i

    print "extraction..."
    for FILES
        getarray OFFSET 1 j
        getarray SIZE 2 j
        callfunction UNCHUNK 1
        getarray NAME 0 j
        log NAME 0 SIZE MEMORY_FILE2
    next j

    startfunction UNCHUNK
        putvarchr MEMORY_FILE2 SIZE 0
        log MEMORY_FILE2 0 0
        
    for XSIZE SIZE
            
    goto OFFSET
            get CHUNK_OFFSET longlong
            savepos OFFSET
            
    goto CHUNK_OFFSET
            get CHUNK_ZSIZE short
            savepos CHUNK_OFFSET
            append  
    # all the chunks are compressed, even if CHUNK_ZSIZE is >= 4096
            
    clog MEMORY_FILE2 CHUNK_OFFSET CHUNK_ZSIZE 0x10000  # was 4096
            
    append
            get XSIZE asize MEMORY_FILE2
        next
    endfunction 
    HOW TO Use:

    PHP Code:
    quickbms -9 Grimlands.bms "d:\Grimlands\Data\Assets_0.8.221.o3pk" "d:\Grimlands\Data\Assets_0.8.221" 

Similar Threads

  1. [Info] JX3 Online PAK Unpack Script
    By h4x0r in forum Game Files
    Replies: 3
    Last Post: 2016-06-03, 12:52 PM
  2. [Info] CW Online Unpack Script
    By h4x0r in forum Game Files
    Replies: 0
    Last Post: 2012-02-16, 08:24 PM
  3. [Info] Basaltic Online PAK Unpack Script
    By h4x0r in forum Game Files
    Replies: 0
    Last Post: 2012-02-16, 08:17 PM
  4. [Info] TZ Online EVP Unpack Script
    By h4x0r in forum Game Files
    Replies: 1
    Last Post: 2012-02-09, 05:13 AM
  5. [Info] DK Online XAC Unpack Script
    By h4x0r in forum Game Files
    Replies: 0
    Last Post: 2012-02-08, 09:31 PM
Visitors found this page by searching for:
Nobody landed on this page from a search engine, yet!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •