360haven works best with JavaScript enabled
[WIP] Generic Xbox360 Compression Library
Loading
Register
Page 1 of 4 1234 LastLast
Results 1 to 8 of 30
  1. #1
    Reverse Engineer


    fairchild is offline
    Join Date : Jan 2011
    Location : Spain / Sweden
    Posts : 211
    Array

    Generic Xbox360 Compression Library

    This is a Library written in (unmanaged) C/C++ that can be used in your .NET (C# example available) applications to decompress and compress the compressed data from the savegame.

    Make sure to give credits if used in your application.

    Update:



    So, lzopro gave me a hard time as it's not ment to be used the way i wanted it. Took some time to fix this but here is a new version that should work as expected.

    Example (C#):
    Code:
    [DllImport("compress.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern uint lzo_decompress([Out] byte[] compressed_buffer, uint compressed_size, [In] byte[] decompressed_buffer, uint decompressed_size, uint method);
    
    [DllImport("compress.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern uint lzo_compress([Out] byte[] decompressed_buffer, uint decompressed_size, [In] byte[] compressed_buffer, uint compressed_size, uint method, uint compress_level);
    
    void MyFunction()
    {
                UInt32 decompressed_size = <decompressed size>;
                byte[] decompressed_buffer = new byte[decompressed_size];
    
                uint compressed_size = <compressed size>;
                uint result = lzo_decompress(compressed_buffer, compressed_size, decompressed_buffer, decompressed_size, COMP_LZOPRO1X);
    
                // result now contains the real decompressed size and decompressed_buffer contains the decompressed data.
    }
    Available compression methods:
    Code:
    enum {
        // decompressors
        COMP_NONE = 0,			// No compression
        COMP_ZLIB,				// RFC 1950
        COMP_DEFLATE,			// RFC 1951
        COMP_LZO1,				// LZO 1 Freeware
        COMP_LZO1A,				// LZO 1a Freeware
        COMP_LZO1B,				// LZO 1b (safe with overrun) Freeware
        COMP_LZO1C,				// LZO 1c (safe with overrun) Freeware
        COMP_LZO1F,				// LZO 1f (safe with overrun) Freeware
        COMP_LZO1X,				// LZO 1x (safe with overrun) Freeware
        COMP_LZO1Y,				// LZO 1y (safe with overrun) Freeware
        COMP_LZO1Z,				// LZO 1z (safe with overrun) Freeware
        COMP_LZO2A,				// LZO 2a (safe with overrun) Freeware
        COMP_LZOPRO1X,			// LZOPRO 1x (safe with overrun) Freeware
        COMP_LZOPRO1Y,			// LZOPRO 1y (safe with overrun) Freeware
    
        // compressors
        COMP_LZO1_COMPRESS,		// LZO 1 Freeware
        COMP_LZO1_99_COMPRESS,	// better compression ratio at the cost of more memory and time
        COMP_LZO1A_COMPRESS,	// LZO 1a Freeware
        COMP_LZO1A_99_COMPRESS,	// better compression ratio at the cost of more memory and time
        COMP_LZO1B_COMPRESS,	// LZO 1b Freeware  (Valid compression level: 1..9)
        COMP_LZO1B_99_COMPRESS,	// better compression ratio at the cost of more memory and time
        COMP_LZO1B_999_COMPRESS,// even better compression ratio at the cost of more memory and time
        COMP_LZO1C_COMPRESS,	// LZO 1c Freeware  (Valid compression level: 1..9)
        COMP_LZO1C_99_COMPRESS,	// better compression ratio at the cost of more memory and time
        COMP_LZO1C_999_COMPRESS,// even better compression ratio at the cost of more memory and time
        COMP_LZO1F_COMPRESS,	// LZO 1f Freeware
        COMP_LZO1F_999_COMPRESS,// even better compression ratio at the cost of more memory and time
        COMP_LZO1X_COMPRESS,	// LZO 1x Freeware
        COMP_LZO1X_999_COMPRESS,// even better compression ratio at the cost of more memory and time
        COMP_LZO1Y_COMPRESS,	// LZO 1y Freeware
        COMP_LZO1Y_999_COMPRESS,// even better compression ratio at the cost of more memory and time
        COMP_LZO1Z_COMPRESS,	// LZO 1z Freeware
        COMP_LZO1Z_999_COMPRESS,// even better compression ratio at the cost of more memory and time
        COMP_LZO2A_COMPRESS,       // LZO 2a Freeware
        COMP_LZO2A_999_COMPRESS,   // even better compression ratio at the cost of more memory and time
        COMP_LZOPRO1X_COMPRESS,    // LZOPRO 1x	(Valid compression level: 1..10)
        COMP_LZOPRO1Y_COMPRESS,    // LZOPRO 1y	(Valid compression level: 1..10)
    };
    Attached Files Attached Files
    Last edited by fairchild; 09-26-2012 at 10:51 AM.
    Downloads : 47 || Uploads : 4 || Rep Power : 2983 || Posts : 211 || Thanks : 71 || Thanked 736 Times in 108 Posts


    If you feel like donating some bit coins, please do so to address "1DNcjKhrVTGnKTyQYbjx8yTRoenTSySeoP", if you are interested in other projects visit www.chipit.se or www.baeckstrom.com, thanks!

  2. The Following 18 Users Say Thank You to fairchild For This Useful Post:

    + Show/Hide list of the thanked


  3. #2
    The Immortal God
    Rpg_Fan

    CloudStrife7x is offline
    Join Date : Dec 2010
    Location : Unknown
    Age : 29
    Posts : 18,760
    Array
    Twitter: @

    Re: Generic Xbox360 Compression Library

    awesome work on this fair
    Downloads : 157 || Uploads : 0 || Rep Power : 22148 || Posts : 18,760 || Thanks : 4,451 || Thanked 3,095 Times in 2,607 Posts



  4. #3
    Retired Staff

    thegutta is offline
    Join Date : Jun 2011
    Location : On Top Of The World
    Posts : 10,475
    Array
    Twitter: @
    Excellent work Fairchild :)
    Downloads : 47 || Uploads : 0 || Rep Power : 13178 || Posts : 10,475 || Thanks : 3,231 || Thanked 1,396 Times in 1,224 Posts




  5. #4
    Eternal Dragoon
    Rpg_Fan

    Serious_M is offline
    Join Date : Dec 2010
    Location : Netherlands , Amsterdam
    Age : 33
    Posts : 13,032
    Array

    Re: Generic Xbox360 Compression Library

    very nice work as always fairchild
    Downloads : 57 || Uploads : 1 || Rep Power : 16108 || Posts : 13,032 || Thanks : 3,661 || Thanked 1,791 Times in 1,446 Posts


    Serious_M

  6. #5
    Developer

    kill_seth is offline
    Join Date : Apr 2011
    Posts : 676
    Array

    Re: Generic Xbox360 Compression Library

    Can't seem to get it working in VB.Net

    Code:
    <DllImport("compress.dll", CallingConvention:=CallingConvention.Cdecl)> _
        Public Shared Function lzo_decompress(<Out> compressed_buffer As Byte(), compressed_size As UInteger, <[In]> decompressed_buffer As Byte(), decompressed_size As UInteger, type As UInteger) As UInteger
        End Function
    
    Private Function Decompress(compressedData As Byte()) As Byte()
            Dim decompressedSize As UInt32 = dSize
            Dim decompressedData As Byte() = New Byte(decompressedSize) {}
            Dim compressedSize As UInt32 = cSize
            lzo_decompress(compressedData, compressedSize, decompressedData, decompressedSize, 0)
            Return decompressedData
    End Function
    When I go to call the function I get: Unable to load DLL 'compress.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

    I placed the dll in the Application.StartUpPath and in Windows\System32

  7. #6
    Developer

    PUR3 RAF3X is offline
    Join Date : Dec 2010
    Location : Germany
    Age : 39
    Posts : 722
    Array

    Re: Generic Xbox360 Compression Library

    Yes the same prob here. I have try use another ways but nothing work with this dll.



    Code:
    Imports PackageIO
    Imports System.Text
    Imports System
    Imports System.Runtime.InteropServices
    Code:
    Public Declare Function lzo_decompress Lib "C:\Users\****\Documents\Visual Studio 2010\Projects\WindowsApplication5\WindowsApplication5\obj\x86\Debug\compress.dll" (ByVal Compressed_Buffer() As Byte, ByVal Compressed_Buffersize As UInteger, ByVal decompressed_buffer() As Byte, ByVal decompressed_size As UInteger, ByVal type As UInteger) As Integer
    Code:
       <DllImport("compress.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.Cdecl)> _
        Public Shared Function lzo_decompress(<Out()> compressed_buffer As Byte(), compressed_size As UInteger, <[In]()> decompressed_buffer As Byte(), decompressed_size As UInteger, type As UInteger) As UInteger
        End Function


    Code:
        Dim FilePath As String
    
        Dim Compressed_Buffer() As Byte
        Dim decompressed_size As UInteger
        Dim compressed_size As UInteger
    
     Private Sub Decompressdata()
    
            Dim reader As New PackageIO.Reader(FilePath, Endian.Big)
            reader.Position = 28
            decompressed_size = reader.ReadInt32()
            Dim decompressed_buffer As Byte() = New Byte((decompressed_size)) {}
            Compressed_Buffer = reader.ReadBytes(reader.Length, Endian.Little)
            compressed_size = Compressed_Buffer.Length
            decompressed_buffer = {(lzo_decompress(Compressed_Buffer, compressed_size, decompressed_buffer, decompressed_size, 0))}
            System.IO.File.WriteAllBytes(Application.StartupPath + "/SaveGame.dat", decompressed_buffer)
    
        End Sub

  8. #7
    Program Engineer
    Jappi88


    Jappi88 is offline
    Join Date : Dec 2010
    Age : 29
    Posts : 1,659
    Array

    Re: Generic Xbox360 Compression Library

    U guys can try whatever u want...it wont work...its not the way u coded it...fairchild forget to inlcude the maindll.
    Downloads : 164 || Uploads : 31 || Rep Power : 6327 || Posts : 1,659 || Thanks : 187 || Thanked 10,729 Times in 599 Posts


    Programming is 10% science, 20% ingenuity, and 70% getting the ingenuity to work with the science.

    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Programming is like sex:
    One mistake and you have to support it for the rest of your life.

  9. #8
    Developer

    PUR3 RAF3X is offline
    Join Date : Dec 2010
    Location : Germany
    Age : 39
    Posts : 722
    Array

    Re: Generic Xbox360 Compression Library

    Whats happen with this dll?

 

 
Page 1 of 4 1234 LastLast

Similar Threads

  1. [Beta] Minecraft XBLA Compression Library
    By fairchild in forum Xbox 360 Modding Programs
    Replies: 21
    Last Post: 12-28-2015, 12:07 PM
  2. [Release] Generic ABCD0007 (Bound by Flames, Mars Wars,...) Decompressor/Compressor/Fixer v1.0
    By Vulnavia in forum Xbox 360 Modding Programs
    Replies: 10
    Last Post: 06-12-2014, 01:47 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.
     

About 360haven

    360haven is an Forum Devoted To Game modding Fans from all over the world.

    An Awesome Community of Xbox 360 Gamers, Modders and Developers who Create & Share Tutorials, Applications, Gfx, Trainers and Gamesaves.

    A haven for the l33t.
    A scarce paradise for modders.

Like this page

Google+