How to unpack the data files of your cache
This will not show you how to unpack models as they are another part of the cache. But as soon as ive found the easy way to unpack them ill notify you... (should take max 30mins :P)
Step 1:
Make a new java file named Loader.java
put this **** in it:
Code:
import java.io.*;
public class Loader
{
public static final void writeFile(String s, byte data[])
{
try
{
File a = new File(s);
FileOutputStream fileoutputstream = new FileOutputStream(s);
fileoutputstream.write(data, 0, data.length);
fileoutputstream.close();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
Step 2:
open the file named "StreamLoader.java"
find right above paste this
Code:
Loader.writeFile("./unpacked/"+s, abyte0);
Step 3:
Make a folder named "unpacked" inside your client directory...
Save and compile... run... voila :)
Hope you enjoyed... remember no model unpacking with this :D
Edit: Howto unpack sprites:
Requirements: Renamed source
Step 1:
Open Sprite.java and above the last "}" add this:
Code:
public static void SaveImage(int width, int height, int ai[], String s)
{
BufferedImage bufferedimage = new BufferedImage(width, height, 1);
bufferedimage.setRGB(0, 0, width, height, ai, 0, width);
Graphics2D graphics2d = bufferedimage.createGraphics();
graphics2d.dispose();
try
{
File file = new File((new StringBuilder()).append("./extractedSprites/").toString());
if(!file.exists())
{
file.mkdir();
}
File file1 = new File((new StringBuilder()).append("./extractedSprites/").append(s).append(".png").toString());
ImageIO.write(bufferedimage, "png", file1);
}
catch(IOException ioexception)
{
System.out.println("error!");
ioexception.printStackTrace();
}
}
The saveimage method is stolen from defy's extracter.. and he got it from Silab.. -.-
Step 2:
find:
Code:
myPixels[k1] = ai[stream.readUnsignedByte()];
right under add
Code:
SaveImage(myWidth, myHeight, myPixels, s + i);
Step 3:
find:
Code:
myPixels[l1 + i2 * myWidth] = ai[stream.readUnsignedByte()];
under add:
Code:
SaveImage(myWidth, myHeight, myPixels, s + i);
Step 4:
Save, Compile and run!