I know the CGFX format, but I am not asking for that. What ever,thank you
here are more files and 2 ram dump: compressed.rarI would need more files or a ram dump of that file to crack it, but it would help to know from which game it is.
public static void DecompressGunvolt(string infile, string outfile)
{
byte[] result = DecompressGunvolt(File.ReadAllBytes(infile));
if (result != null)
File.WriteAllBytes(outfile, result);
}
public static byte[] DecompressGunvolt(byte[] data)
{
byte[] result = null;
int headersize, csize, usize;
using (var ms = new MemoryStream(data))
using (var br = new BinaryReader(ms))
{
headersize = br.ReadInt32();
br.ReadInt32(); // some pointer, only used in runtime
csize = br.ReadInt32();
usize = br.ReadInt32();
br.ReadInt32(); // some pointer, only used in runtime
br.ReadInt32(); // 0
csize -= headersize;
result = Decompress_GunvoltSLZ(br.ReadBytes(csize), usize);
}
return result;
}
public static byte[] Decompress_GunvoltSLZ(byte[] compData, int uncompressedSize)
{
byte[] decompData = new byte[uncompressedSize];
int inPtr = 0, outPtr = 0;
ushort dist, count;
byte flags = 0;
try
{
do
{
flags = compData[inPtr++];
for (int cbit = 1; (cbit & 0xFF) > 0; cbit <<= 1)
{
if ((flags & cbit) == 0) //if bit is not set, uncompressed!
{
decompData[outPtr++] = compData[inPtr++];
if (inPtr > compData.Length) break; //check if we reached the end of file
}
else //compressed
{
var dat = BitConverter.ToUInt16(compData, inPtr); inPtr += 2;
dist = (ushort)((dat & 0xFFF) + 1);
count = (ushort)((dat >> 12) + 2);
do
{
decompData[outPtr] = decompData[(outPtr - dist)];
outPtr++;
count--;
} while (count > 0);
}
if (inPtr >= compData.Length) break; //check if we reached the end of file
}
} while (inPtr < compData.Length);
}
catch //(Exception ex)
{
}
return decompData;
}
Thank you! This really helpful. thank you very much! Do you have any idea about the IOBJ file?Why don't you just say that it's "Azure Striker Gunvolt" ?
Well your ram dump is useless, it's just the exefs and not some decompressed IOBJ file.
Since i own this game, i made a ramdump myself and found file 1026 decompressed in it, here the decompress code in C#:
Code:public static void DecompressGunvolt(string infile, string outfile) { byte[] result = DecompressGunvolt(File.ReadAllBytes(infile)); if (result != null) File.WriteAllBytes(outfile, result); } public static byte[] DecompressGunvolt(byte[] data) { byte[] result = null; int headersize, csize, usize; using (var ms = new MemoryStream(data)) using (var br = new BinaryReader(ms)) { headersize = br.ReadInt32(); br.ReadInt32(); // some pointer, only used in runtime csize = br.ReadInt32(); usize = br.ReadInt32(); br.ReadInt32(); // some pointer, only used in runtime br.ReadInt32(); // 0 csize -= headersize; result = Decompress_GunvoltSLZ(br.ReadBytes(csize), usize); } return result; } public static byte[] Decompress_GunvoltSLZ(byte[] compData, int uncompressedSize) { byte[] decompData = new byte[uncompressedSize]; int inPtr = 0, outPtr = 0; ushort dist, count; byte flags = 0; try { do { flags = compData[inPtr++]; for (int cbit = 1; (cbit & 0xFF) > 0; cbit <<= 1) { if ((flags & cbit) == 0) //if bit is not set, uncompressed! { decompData[outPtr++] = compData[inPtr++]; if (inPtr > compData.Length) break; //check if we reached the end of file } else //compressed { var dat = BitConverter.ToUInt16(compData, inPtr); inPtr += 2; dist = (ushort)((dat & 0xFFF) + 1); count = (ushort)((dat >> 12) + 2); do { decompData[outPtr] = decompData[(outPtr - dist)]; outPtr++; count--; } while (count > 0); } if (inPtr >= compData.Length) break; //check if we reached the end of file } } while (inPtr < compData.Length); } catch //(Exception ex) { } return decompData; }