Thread: Recode the cache loader to load a zip (instead of main cache)

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 Recode the cache loader to load a zip (instead of main cache) 
    Banned

    Join Date
    Dec 2007
    Age
    27
    Posts
    1,987
    Thanks given
    257
    Thanks received
    326
    Rep Power
    0
    Firstly
    MAKE A FUCKING BACKUP OF YOUR CLIENT FILES

    open Decompressor.java

    after
    Code:
    import java.io.*;
    add
    Code:
    import java.util.zip.*;
    after
    Code:
        public Decompressor(RandomAccessFile randomaccessfile, RandomAccessFile randomaccessfile1, int j)
        {
    add
    Code:
    loadZipFile("./ClienthaxCache.zip");
    before
    Code:
        public Decompressor(RandomAccessFile randomaccessfile, RandomAccessFile randomaccessfile1, int j)
        {
    add
    Code:
    ZipFile zipFile = null;
    InputStream zipInputStream = null;
    
    public void loadZipFile(String zipName)
    {
    try
    {
    zipFile = new ZipFile(zipName);
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }
    }
    
    
    
    public byte[] readFileFromZip(int i, int indexType)
    {
    
    String[] endings = {
    "jag", "mdl", "dat","mid","dat"
    };
    String[] locations  = {
    "","1/","2/","3/","4/"
    };
    try
    {
    ZipEntry entry = zipFile.getEntry(locations[indexType]+i+"."+endings[indexType]);
    zipInputStream = zipFile.getInputStream(entry);
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    byte[] buffer = new byte[1024];
    int len;
    while ((len = zipInputStream.read(buffer)) > 0) {
    bos.write(buffer, 0, len);
    }
    
    return bos.toByteArray();
    
    }catch(Exception e){
    e.printStackTrace();
    System.out.println("Error loading "+locations[indexType]+i+"."+endings[indexType]);
    System.out.println("ot o");
    return null;
    }
    }
    after
    Code:
        public synchronized byte[] decompress(int i)
        {
    add
    Code:
    if(1 != 2)//cos people are too dumb to comment out things
    return readFileFromZip(i, (anInt311 - 1));
    open OnDemandFetcher.java
    replace all
    Code:
    closeRequest(onDemandData);
    with
    Code:
    //closeRequest(onDemandData);
    replace
    Code:
            try
            {
                GZIPInputStream gzipinputstream = new GZIPInputStream(new ByteArrayInputStream(onDemandData.buffer));
                do
                {
                    if(i == gzipInputBuffer.length)
                        throw new RuntimeException("buffer overflow!");
                    int k = gzipinputstream.read(gzipInputBuffer, i, gzipInputBuffer.length - i);
                    if(k == -1)
                        break;
                    i += k;
                } while(true);
    
            }
            catch(IOException _ex)
            {
                throw new RuntimeException("error unzipping");
            }
    with
    Code:
    /*        try
            {
                GZIPInputStream gzipinputstream = new GZIPInputStream(new ByteArrayInputStream(onDemandData.buffer));
                do
                {
                    if(i == gzipInputBuffer.length)
                        throw new RuntimeException("buffer overflow!");
                    int k = gzipinputstream.read(gzipInputBuffer, i, gzipInputBuffer.length - i);
                    if(k == -1)
                        break;
                    i += k;
                } while(true);
    
            }
            catch(IOException _ex)
            {
                throw new RuntimeException("error unzipping");
            }
    */
    replace
    Code:
            onDemandData.buffer = new byte[i];
            System.arraycopy(gzipInputBuffer, 0, onDemandData.buffer, 0, i);
    with
    Code:
    //        onDemandData.buffer = new byte[i];
    //        System.arraycopy(gzipInputBuffer, 0, onDemandData.buffer, 0, i);
    replace
    Code:
      if(!crcMatches(versions[onDemandData.dataType][onDemandData.ID], crcs[onDemandData.dataType][onDemandData.ID], abyte0))
    {
                    abyte0 = null;
    }
    with
    Code:
                if(!crcMatches(versions[onDemandData.dataType][onDemandData.ID], crcs[onDemandData.dataType][onDemandData.ID], abyte0))
    {
    //                abyte0 = null;
    }
    in signlink change the getcachedir method to return "";

    save and compile
    Download the zip file [Only registered and activated users can see links. ]
    and just put it with ur client


    Notes:
    All files are not gziped but will load fine (well they betta xD)

    TODO:
    Recode the jag reader
    Find why it sometimes lags at startup
     

  2. #2  
    Registered Member
    Llama's Avatar
    Join Date
    Oct 2006
    Age
    30
    Posts
    510
    Thanks given
    0
    Thanks received
    0
    Rep Power
    106
    LOL nice!!!!! again, you never stop amazing us aaa801 >_>

    also.. "MAKE A FUCKING BACK UP OF YOUR CLIENTS" << epic.



     

  3. #3  
    Registered Member

    Join Date
    Sep 2006
    Age
    28
    Posts
    623
    Thanks given
    2
    Thanks received
    2
    Rep Power
    156
    Nice . Waiting for that upload now

    Seems to easy xD.

    James,
    I'm back
     

  4. #4  
    Banned

    Join Date
    Dec 2007
    Age
    27
    Posts
    1,987
    Thanks given
    257
    Thanks received
    326
    Rep Power
    0
    finaly uploaded after like 2-3 hours dam my connection lol
     

  5. #5  
    Registered Member

    Join Date
    Aug 2007
    Posts
    545
    Thanks given
    6
    Thanks received
    0
    Rep Power
    196
    You amaze LLama again...
     

  6. #6  
    Sub
    Sub is offline
    sυввч

    Sub's Avatar
    Join Date
    Aug 2007
    Age
    21
    Posts
    4,325
    Thanks given
    1,082
    Thanks received
    346
    Discord
    View profile
    Rep Power
    2755
    hax0r ownz clientxz well done
     

  7. #7  
    ZachHaley
    Guest
    good job
     

  8. #8  
    Retired. Stop PMing me.

    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    14
    Posts
    7,528
    Thanks given
    1,783
    Thanks received
    2,822
    Discord
    View profile
    Rep Power
    5000
    Pretty sweet client, nice work.
    [Only registered and activated users can see links. ]
     

  9. #9  
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    27
    Posts
    1,358
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    does this mean the cashe is unpacked and all zipped? also does it mean we can edit the cashe now and no need to repack?

    anyways nice dude.
    Visit Rune Miracle [Only registered and activated users can see links. ]
     

  10. #10  
    Banned

    Join Date
    Dec 2007
    Age
    27
    Posts
    1,987
    Thanks given
    257
    Thanks received
    326
    Rep Power
    0
    Quote Originally Posted by q a z7o View Post
    does this mean the cashe is unpacked and all zipped? also does it mean we can edit the cashe now and no need to repack?

    anyways nice dude.
    yep (mts)
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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