Post reply

The message has the following error or errors that must be corrected before continuing:
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Other options
Shortcuts: ALT+S post or ALT+P preview

Topic summary

Posted by Galactygon
 - February 06, 2010, 06:46:00 PM
This issue has been fixed.

-Galactygon
Posted by Leomar
 - May 20, 2009, 04:04:09 AM
Quote from: Tervadh on May 18, 2009, 10:39:52 PM
Quote from: Leomar on May 17, 2009, 03:37:04 AMSo I'll let you know, that we have included the deitm049.itm fix in the BiG World Fixpack.
This was fixed some time ago with Nythrun's macro and I think also the "Resource Fixer" which is buried in one of your old BWP threads, unless that is what you used.
Yes we use the "Resource Fixer", but only for BP like you've told us. So we install the fixer directly before BP and only with it together. Therefore the deitm049.itm fix is very useful for us.

Greetings Leomar
Posted by Tervadh
 - May 18, 2009, 10:39:52 PM
Quote from: Leomar on May 17, 2009, 03:37:04 AMSo I'll let you know, that we have included the deitm049.itm fix in the BiG World Fixpack.
This was fixed some time ago with Nythrun's macro and I think also the "Resource Fixer" which is buried in one of your old BWP threads, unless that is what you used.

Of course, it has not much to do with LC, except LC could use the same macro to avoid bombing out when modding erroneous items like that one.
Posted by Leomar
 - May 17, 2009, 03:37:04 AM
A nice treasure is hidden in this thread.  :)

So I'll let you know, that we have included the deitm049.itm fix in the BiG World Fixpack.

Greetings Leomar
Posted by Baronius
 - October 23, 2008, 09:24:06 PM
QuoteSOURCE_SIZE returns the initial size of the file (and is not correct if you use INNER_ACTION or similar). BUFFER_SIZE returns the current size.
I also meant SOURCE_SIZE in that way (my wording was unfortunate), I should have written 'the size of the complete resource to be "patched"' instead. Either way, I think he needs to include the main and extended headers in the algorithm he outlined.
Posted by The Bigg
 - October 23, 2008, 08:30:05 PM
Quote from: Baronius on October 23, 2008, 07:06:10 PMFirst, just a quick note: SOURCE_SIZE in WeiDU returns the size of the complete "patched" resource, doesn't it?
SOURCE_SIZE returns the initial size of the file (and is not correct if you use INNER_ACTION or similar). BUFFER_SIZE returns the current size.

QuoteThe fact that the base of FR_ROV (DEITM049.ITM ) and NEJ (mentioned by you) is relatively old, it's possible that some older files in these mods were made with an early item editor which might have generated faulty indices to feature blocks in extended headers. Of course, I would like to emphasize that this is also just an assumption.
I recall that CTB had (or still has) such a broken file as well, so that one falls under "old tools" as well (don't these mods predate even IEEP?). I guess somebody at SHS knows which files are broken in both CTB and NEJ.
Posted by Baronius
 - October 23, 2008, 07:06:10 PM
Quote1.) The macro looks at the last header, counts the number of effects and compares it to SOURCE_SIZE.

2.) If the (number of effects times the feature block size plus whatever other offsets there might be) is larger than the SOURCE_SIZE but not by more than 48 bytes, then we assume the last feature block didn't get filled in. So we expand the SOURCE_SIZE gets with zeroes as needed.

3.) If the (number of effects times the feature block size plus whatever other offsets there might be) is larger than the SOURCE_SIZE by at least 48 bytes, then we assume there is something wrong with the number of effects. We then start counting the number of effects manually until we run out of bounds, counting feature blocks that might be less than 48 bytes. In that case, we go to 2.).
First, just a quick note: SOURCE_SIZE in WeiDU returns the size of the complete "patched" resource, doesn't it? In this case, you need to take into account the item header size and the extended headers as well in your calculation when making a comparison with SOURCE_SIZE. In your current algorythm, you're comparing the total size of feature blocks with the file size, instead of comparing it with the expected size of the feature block section. You write "plus whatever other offsets there might be", if this is meant to cover the item header and the extended headers, then ignore what I've written above.

It will be an interesting discovery if your suspicion about partial effect blocks proves to be true. To tell the truth, I don't give much chance to it, but we will see. Instead, I assume that the case is similar to the present problem of DEITM049.ITM: the feature block indices of extended headers are incorrect, they point beyond the end of file (but the feature blocks themselves are okay, i.e. their total size is a whole multiple of 48 bytes). I don't find your suspicion too likely, because the original game doesn't contain such files, which means they must have been generated by an editor. I doubt any item editors of the past generated partial blocks (such severely damaged data structures in this case can only be the result of some extraordinary problem such as damage on files on the media or during their transfer). On the other hand, faulty calculation of feature block indices is much more likely for an editor software, so perhaps one of the old editors has this bug. The fact that the base of FR_ROV (DEITM049.ITM ) and NEJ (mentioned by you) is relatively old, it's possible that some older files in these mods were made with an early item editor which might have generated faulty indices to feature blocks in extended headers. Of course, I would like to emphasize that this is also just an assumption.
Posted by Galactygon
 - October 23, 2008, 05:52:02 PM
Quote from: Baronius on October 23, 2008, 05:41:13 PMIs this correct? If yes, my question was simple: your words gave the impression that we're talking about more than just 1-2 corrupt files (you said that the typical problem of read-out-bounds occured with more files),...

Correct.

Quote from: Baronius on October 23, 2008, 05:41:13 PM...so I ask where do the corrupt files come from? What mod installed them before SpellPack?

So far, I only know of NeJ. But people have hinted of other mods, and chances are they are right. In that case, the macro is worth the effort.

Quote from: Baronius on October 23, 2008, 05:41:13 PMI am wondering why they're corrupt.

I really don't know.

-Galactygon
Posted by Baronius
 - October 23, 2008, 05:41:13 PM
QuoteI don't get it.
Perhaps I'm misinterpreting something, so let me summarize what I believed the problem is:
- when SpellPack is installed, it modifies (with WeiDU parlance: "patches") many game files, often based on regular expression matching
- some files SpellPack tries to modify are corrupt (e.g. bad offsets/indexes in extended headers)
- SpellPack's installer refers to an invalid offset (due to the invalid data it read from the file) which obviously results in an out-of-bounds error

Is this correct? If yes, my question was simple: your words gave the impression that we're talking about more than just 1-2 corrupt files (you said that the typical problem of read-out-bounds occured with more files), so I ask where do the corrupt files come from? What mod installed them before SpellPack? I am wondering why they're corrupt. For example, they are a few corrupt BAM files (even in the original game), but I haven't really seen items corrupted in the way we've discussed.
Posted by Galactygon
 - October 23, 2008, 05:26:56 PM
Quote from: Baronius on October 21, 2008, 08:32:22 PMSo you don't want to reveal where do these "corrupted files" come from (i.e. original game, some mod etc.) -- as you wish, though I don't see the reason. :) (As I said, it would help identify the problem, because as far as I can see, even the exact nature of the problem isn't known.)

I don't get it.

Quote from: Baronius on October 21, 2008, 08:32:22 PMWhy do you make guesses when you could check it for sure? Opening the file in a hex editor to check the last header (or even the other headers) isn't really rigorous testing, it takes 1-2 minutes at most.

I will have to figure out the correct offsets that lead to the last effect of the last header and compare it with whatever that file says.

Due to my studies, that will happen late-December the earliest.

-Galactygon
Posted by Baronius
 - October 21, 2008, 08:32:22 PM
So you don't want to reveal where do these "corrupted files" come from (i.e. original game, some mod etc.) -- as you wish, though I don't see the reason. :) (As I said, it would help identify the problem, because as far as I can see, even the exact nature of the problem isn't known.)


QuoteI once ran a test on one of the corrupted files, and found out there was nothing wrong with any part of the file except the last effect in the last header. When I READ_SHORT the opcode, the installer ran out of bounds and bailed out. When I opened the .spl in DLTCEP and looked at that effect, I noticed that all fields except the opcode number were filled in their default values - zeroes.

Therefore, I am making a guess that the last effect in the last header wasn't filled out to 48 bytes and that DLTCEP filled it out correctly.[...]
Why do you make guesses when you could check it for sure? Opening the file in a hex editor to check the last header (or even the other headers) isn't really rigorous testing, it takes 1-2 minutes at most.
Posted by Galactygon
 - October 21, 2008, 07:02:21 PM
Quote from: Baronius on October 21, 2008, 03:55:04 PMFilled in by what? A WeiDU installer of a mod? If so, we're talking about mods which produce broken files (I don't refer to the question of mod quality now, I am just wondering).

A .spl or .itm file consists of a single 114 byte header, multiple (56 bit for .itm and 40 bit for .spl) extended headers, and multiple 48 byte feature blocks or "effects".

I once ran a test on one of the corrupted files, and found out there was nothing wrong with any part of the file except the last effect in the last header. When I READ_SHORT the opcode, the installer ran out of bounds and bailed out. When I opened the .spl in DLTCEP and looked at that effect, I noticed that all fields except the opcode number were filled in their default values - zeroes.

Therefore, I am making a guess that the last effect in the last header wasn't filled out to 48 bytes and that DLTCEP filled it out correctly. What I am talking about if I could replicate this correctly in WeiDU, and correct corrupted files on the fly rather than worry about them individually or going up to each modder or skipping them altogether.

But then again, I could be completely wrong, since I did not do -- what they call -- rigorous testing.

-Galactygon
Posted by Baronius
 - October 21, 2008, 03:55:04 PM
I see, but I asked what mods (or perhaps the original game?) add these corrupt files. Normally, such horribly broken files shouldn't occur often at all. If they do, it means something is corrupting or has corrupted game/mod files.

Quote[..]then we assume the last feature block didn't get filled in
Filled in by what? A WeiDU installer of a mod? If so, we're talking about mods which produce broken files (I don't refer to the question of mod quality now, I am just wondering).

On a side note, in case of DEITM049, nothing was broken in such a cruel way (i.e. end-of-file in the middle of a block). It just had incorrect feature block offsets (indexes) assigned (if I remember correctly, their value was greater -- or smaller? -- by one than the actual position).
Posted by Galactygon
 - October 21, 2008, 10:32:44 AM
Quote from: Baronius on October 21, 2008, 08:57:06 AMWhere do such corrupt files occur? The algorythm you outlined is a general one, but still only solves one type of problem (with certain assumptions). There are many
ways a file can be corrupt, is this "broken effect" problem typical to certain files encountered by SpellPack (and this is why you find it reasonable to add generic fix code for it)? Where do these files originate from?

Yes, this would solve only one type of problem, but it happens frequently to warrant my attention. I can still have my macros bail out and skip that .itm/.spl file if the file is hopelessly corrupted and all else fails.

-Galactygon
Posted by Baronius
 - October 21, 2008, 08:57:06 AM
Where do such corrupt files occur? The algorithm you outlined is a general one, but still only solves one type of problem (with certain assumptions). There are many
ways a file can be corrupt, is this "broken effect" problem typical to certain files encountered by SpellPack (and this is why you find it reasonable to add generic fix code for it)? Where do these files originate from?