Wow, thanks for the infoIcehawk78 wrote:Ah, gotcha. That makes sense (I'm looking into doing something similar with Ruby), then.MrAdam wrote:Why? Well, I was thinking about making a mod manager with a bit more features than the existing one.
Im an Android developer and I don't have much experience with Java desktop development (started programming Java when I started working with Android), so my skillset is mostly for mobile stuff. Anyways, for what I can see, the .dat files are just binary encoded C objects? I would just like to know the basic structure of those objects, as it would make it much easier for me to work with
EDIT: Right now Im trying to get the data reading to work using a library called Preon, which enables be to define the structure of the byte-data, and it can then map it to java classes to make it easier to work with, like this:Code: Select all
public class FTLData { @BoundNumber(byteOrder = ByteOrder.LittleEndian, size = "32") public long indexSize; }
From what I can gather, the file format looks to just be this:
Looking up Preon, I'd think you'd want something like this:Code: Select all
4: Index Size 4*Index Size: Indices Files: (For each Index) 4: File Size 4: Filename Size Filename Size: Filename File Size: File
Note: None of this is tested, it's just what I gleaned from the python.Code: Select all
public class BinFile { @BoundNumber(size="32", byteOrder=LittleEndian) Integer index_size @BoundList(type=Integer.class, size="index_size", byteOrder=LittleEndian) @BoundList(type=DataFile.class, size="index_size", byteOrder=LittleEndian) public class DataFile { @BoundNumber(size="32", byteOrder=LittleEndian) Integer file_size @BoundNumber(size="32", byteOrder=LittleEndian) Integer filename_size @BoundString(size="filename_size", byteOrder=LittleEndian) String filename //@Bound(size="file_size", byteOrder=LittleEndian) ChunkOfData file - not sure offhand how you'd populate this } }
[Tool] ftldat r7
-
MrAdam
- Posts: 7
- Joined: Mon Oct 08, 2012 12:56 pm
Re: [Tool] ftldat r7
-
Icehawk78
- Posts: 230
- Joined: Tue Sep 18, 2012 4:55 pm
Re: [Tool] ftldat r7
No problem, let me know if it works for you.MrAdam wrote:Wow, thanks for the infoIll test it when I get home in a few hours
-
MrAdam
- Posts: 7
- Joined: Mon Oct 08, 2012 12:56 pm
Re: [Tool] ftldat r7
Well, it kinda works ^_^Icehawk78 wrote:No problem, let me know if it works for you.MrAdam wrote:Wow, thanks for the infoIll test it when I get home in a few hours
Code: Select all
public class BinaryFile {
@BoundNumber() public int indexSize;
@BoundList(size = "indexSize") public int[] indexes;
@BoundList(size = "10") public DataFile[] files;
public class DataFile {
@BoundNumber() public int size;
@BoundNumber() public int filenameSize;
@BoundString(size = "filenameSize") public String filename;
@BoundString(size = "size") public String data;
}
}Code: Select all
File file = new File("/Users/adam/Desktop/data.dat");
Codec<BinaryFile> codec = Codecs.create(BinaryFile.class);
BinaryFile binaryFile = Codecs.decode(codec, file);
System.out.println(binaryFile.files[0].filename);Code: Select all
data/achievements.xmlthis is what I need for the size parameter of the file array, but haven't figured out how yet.
Code: Select all
public int indexUsed() {
int n = 0;
for (int i = 0; i < indexSize; i++)
if (index[i] != 0) n++;
return n;
}-
Icehawk78
- Posts: 230
- Joined: Tue Sep 18, 2012 4:55 pm
Re: [Tool] ftldat r7
(Slightly modified - sorry, but arrays just bug me because you can't properly loop over them)
Maybe this will work?
Code: Select all
public class BinaryFile {
@BoundNumber() public Integer indexSize;
@BoundList(size = "indexSize") public List<Integer> indexes;
@BoundList(size = "indexUsed()") public List<DataFile> files;
public int indexUsed() {
int i = 0;
for (Integer index : indexes) {
if (index != 0) {
i += 1;
}
return i;
}
public class DataFile {
@BoundNumber() public int size;
@BoundNumber() public int filenameSize;
@BoundString(size = "filenameSize") public String filename;
@BoundString(size = "size") public String data;
}
}-
MrAdam
- Posts: 7
- Joined: Mon Oct 08, 2012 12:56 pm
Re: [Tool] ftldat r7
You cant reference a function in the size parametre, already tried itIcehawk78 wrote:(Slightly modified - sorry, but arrays just bug me because you can't properly loop over them)Maybe this will work?Code: Select all
public class BinaryFile { @BoundNumber() public Integer indexSize; @BoundList(size = "indexSize") public List<Integer> indexes; @BoundList(size = "indexUsed()") public List<DataFile> files; public int indexUsed() { int i = 0; for (Integer index : indexes) { if (index != 0) { i += 1; } return i; } public class DataFile { @BoundNumber() public int size; @BoundNumber() public int filenameSize; @BoundString(size = "filenameSize") public String filename; @BoundString(size = "size") public String data; } }
-
Icehawk78
- Posts: 230
- Joined: Tue Sep 18, 2012 4:55 pm
Re: [Tool] ftldat r7
Ah. That sucks.MrAdam wrote:You cant reference a function in the size parametre, already tried it
Maybe if you have some other way of setting a local variable to the output of a function? I'm not certain, I've never worked with that package.
-
MrAdam
- Posts: 7
- Joined: Mon Oct 08, 2012 12:56 pm
Re: [Tool] ftldat r7
Ill just keep trying and report back ^_^Icehawk78 wrote:Ah. That sucks.MrAdam wrote:You cant reference a function in the size parametre, already tried it
Maybe if you have some other way of setting a local variable to the output of a function? I'm not certain, I've never worked with that package.
-
xXSoulSlayerXx
- Posts: 15
- Joined: Sun Oct 07, 2012 8:57 am
Re: [Tool] ftldat r7
Your python version is working perfectly! Text based is always the way to go! Hooray to ftldat!!!
Ahhhhhh!!! Not the ion cannons!!!
-
LordValgor
- Posts: 3
- Joined: Sun Oct 07, 2012 6:09 pm
Re: [Tool] ftldat r7
hmm... the exe version is labled as a trojan by kaspersky, and I can't get the python version to work for the life of me...
I think I will just go the easy route and disable Kaspersky for a bit...
I think I will just go the easy route and disable Kaspersky for a bit...
-
Coolguybest
- Posts: 5
- Joined: Fri Oct 05, 2012 10:03 pm
Re: [Tool] ftldat r7
Can someone help me (again)?
I tried editing the file myself... I get a window to pop up for a split second (it has writing, at least!)
Here's what I have on the unpack_data:
@ECHO OFF
ftldat unpack C:/Program Files(x86)/Steam/steamapps/common/FTL Faster Than Light/resources
Is this right, or am I completely wrong again?
I tried editing the file myself... I get a window to pop up for a split second (it has writing, at least!)
Here's what I have on the unpack_data:
@ECHO OFF
ftldat unpack C:/Program Files(x86)/Steam/steamapps/common/FTL Faster Than Light/resources
Is this right, or am I completely wrong again?