Binary read .lod
#10

To get the structure of a file, u need to know a little bit how to work with a hex editor.
Most lodfiles are almost the same structure like the corresponding database table, just with less info in it.
I would suggest to start with the most simple file, mobname.lod

Open that file with a hex editor.

Ignore the first 4 bytes for now.

 

The second 4 bytes are 01 00 00 00 which is the decimal value 1 this could be the ID of the monster

The second 4 bytes are 08 00 00 00 hmm what could this be, ok lets ignore that for now. 

Then we see a whole bunch of weird bytes, but looking on the right we will see that it is text. 

But how can your tool know, how long the name is, since a computer cant figure this out on its own, so let u count the length of the name. 

Oh, exactley 8 letters, that reminds me on the 4 bytes before the name.  so this must define the length of the name. 

 

After the name comes 4 bytes again 02 00 00 00 (2), then 0b 00 00 00 (11) then again a name, the name is 11 characters long. 

This keeps going on exactley like this, until the end of the file. 

 

On the very last record in this file, we will notice that the id of the monster is, F3 05 00 00

Look again, to the first 4 bytes in the file, they match.

 

so probably this means that the first 4 bytes can tell the tool u are making to keep reading records, until u find a record with that id, read that and then end reading the file. 

 

 

 

In this case it is easy because the file is pretty much straight forwards. 

Now if u want to read itemAll.lod for example, u can just do the exact same, but then use the database as reference



Messages In This Thread
[No subject] - by Evanpp7 - 01-05-2014, 06:42 PM
[No subject] - by Wizatek - 01-05-2014, 08:16 PM
[No subject] - by Paramount - 01-05-2014, 08:50 PM
[No subject] - by Evanpp7 - 01-05-2014, 09:47 PM
[No subject] - by soryjero - 01-05-2014, 11:21 PM
[No subject] - by Evanpp7 - 01-06-2014, 12:21 AM
[No subject] - by soryjero - 01-06-2014, 09:41 PM
[No subject] - by Nymphetamine - 01-06-2014, 09:45 PM
[No subject] - by soryjero - 01-06-2014, 10:45 PM
[No subject] - by Wizatek - 01-06-2014, 11:33 PM
[No subject] - by Evanpp7 - 01-07-2014, 01:26 AM
[No subject] - by Evanpp7 - 01-07-2014, 07:24 AM
[No subject] - by Wizatek - 01-07-2014, 10:29 AM
[No subject] - by Evanpp7 - 01-08-2014, 02:59 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)