360haven works best with JavaScript enabled
[WIP] Generic Xbox360 Compression Library - Page 2
Loading
Register
Page 2 of 4 FirstFirst 1234 LastLast
Results 9 to 16 of 30
  1. #9
    Program Engineer
    Jappi88


    Jappi88 is offline
    Join Date : Dec 2010
    Age : 35
    Posts : 1,660
    Array

    Re: Generic Xbox360 Compression Library

    Quote Originally Posted by PUR3 RAF3X View Post
    Whats happen with this dll?
    Be Patient...Fairchild will fix it when he gets the time.

    Also dont get your hopes up , u most probebly wont be able to desompress the save using the compress.dll(LzoPro)
    Downloads : 166 || Uploads : 31 || Rep Power : 8667 || Posts : 1,660 || Thanks : 188 || Thanked 10,799 Times in 600 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.

  2. #10
    Reverse Engineer


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

    Re: Generic Xbox360 Compression Library

    Compression library has been updated now, hope everything works smooth now.

    Note the new argument (uint compress_level) on the compress function.
    Valid compress levels are (LZO Freeware: 1-9, LZO PRO: 1-10)
    Downloads : 47 || Uploads : 4 || Rep Power : 5338 || Posts : 211 || Thanks : 71 || Thanked 737 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!

  3. #11
    Divided by zero and lived

    mojobojo is offline
    Join Date : Dec 2010
    Posts : 389
    Array

    Re: Generic Xbox360 Compression Library

    The readme has a typo, the VB code example is copied twice. Also wouldn't we need an h file for the lib file to include the lib file? Anways, great job.
    Downloads : 4 || Uploads : 1 || Rep Power : 5546 || Posts : 389 || Thanks : 52 || Thanked 1,033 Times in 236 Posts



  4. #12
    Developer

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

    Re: Generic Xbox360 Compression Library

    Just tested out the compression, and it seems either I'm doing something wrong or it's still not working properly.

    Code:
    <DllImport("compress.dll", CallingConvention:=CallingConvention.Cdecl)> _
    Public Shared Function lzo_compress(<Out> decompressed_buffer As Byte(), decompressed_size As UInteger, <[In]> compressed_buffer As Byte(), compressed_size As UInteger, type As UInteger, compression_level As UInteger) As UInteger
    End Function
    
    Private Function Compress(decompressedData As Byte()) As Byte()
        Dim compressedData As Byte() = New Byte(compressedSize - 1) {}
        lzo_compress(decompressedData, decompressedSize, compressedData, compressedSize, 12, 1)
        Return compressedData
    End Function
    It's just returning a null byte array. I tried doing different compression levels, and also tried 13 but got the same result.

  5. #13
    Reverse Engineer


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

    Re: Generic Xbox360 Compression Library

    The library seems to be unstable, need to look into more error handling when sending signals from unmanaged code to managed, but the library works in my example C# tool i made really fast. Perhaps the sourcecode below helps:

    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    using System.IO;
    
    namespace example
    {
        public partial class Form1 : Form
        {
            enum CompressionMethods {
        // 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)
    }
    
            public byte[] ReadAllBytes(string fileName, int offset)
            {
                byte[] buffer = null;
                using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
                {
                    //Console.Out.WriteLine("fs.Length: " + fs.Length + "\n");
                    //Console.Out.WriteLine("offset: " + offset + "\n");
                    buffer = new byte[(fs.Length - offset)];
                    fs.Seek(offset, SeekOrigin.Begin);
                    fs.Read(buffer, 0, (int)(fs.Length - offset));
                }
                return buffer;
            } 
            
            public Form1()
            {
                InitializeComponent();
            }
    
            [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);
            
            private void button1_Click(object sender, EventArgs e)
            {
                string Pfad = string.Empty;
    
                OpenFileDialog openFileDialog1 = new OpenFileDialog();
                openFileDialog1.Filter = "Save (*.sav)|*.sav|All files (*.*)|*.*";
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                    Pfad = openFileDialog1.FileName;
    
                UInt32 decompressed_size = 24875;    // Static for now on my testfile
                byte[] decompressed_buffer = new byte[decompressed_size];
    
                byte[] compressed_buffer = ReadAllBytes(Pfad, 0x18);
    
                uint compressed_size = (uint)compressed_buffer.Length;
                uint result = lzo_decompress(compressed_buffer, compressed_size, decompressed_buffer, decompressed_size, (uint)CompressionMethods.COMP_LZOPRO1X);
    
                richTextBox1.Text += "\nDecompress result: " + result + "\n";
                for (int i = 0; i < 128; i++)
                    richTextBox1.Text += decompressed_buffer[i].ToString("X2");
    
    
                decompressed_size = result;
                result = lzo_compress(decompressed_buffer, decompressed_size, compressed_buffer, compressed_size, (uint)CompressionMethods.COMP_LZOPRO1X_COMPRESS, 10);
    
                richTextBox1.Text += "\nCompress result: " + result + "\n";
                for (int i = 0; i < 128; i++)
                    richTextBox1.Text += compressed_buffer[i].ToString("X2");
    
    
                /*
                for (int i = 0; i < result; i++)
                    richTextBox1.Text += decompressed_buffer[i].ToString("X2");
                 */
    
            }
        }
    }
    Downloads : 47 || Uploads : 4 || Rep Power : 5338 || Posts : 211 || Thanks : 71 || Thanked 737 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!

  6. #14
    Developer

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

    Re: Generic Xbox360 Compression Library

    I try again thanks hope we can De/Compress Borderland 2 ;)

  7. #15
    Developer

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

    Re: Generic Xbox360 Compression Library

    No idea why but the decompressedData return allways no data? Any idea?

  8. #16
    Reverse Engineer


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

    Re: Generic Xbox360 Compression Library

    Quote Originally Posted by PUR3 RAF3X View Post
    No idea why but the decompressedData return allways no data? Any idea?
    Don't know, perhaps it's correct but why [] on the In and not the Out and should the [] be there for VB?
    Code:
    <Out> decompressed_buffer As Byte(), decompressed_size As UInteger, <[In]> compressed_buffer
    Downloads : 47 || Uploads : 4 || Rep Power : 5338 || Posts : 211 || Thanks : 71 || Thanked 737 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!

 

 
Page 2 of 4 FirstFirst 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

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!

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
  •  

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.

★★★★★¯\_(ツ)_/¯