Quote from: Tervadh on May 18, 2009, 10:39:52 PMYes 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.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.
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.
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.
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.
Quote1.) The macro looks at the last header, counts the number of effects and compares it to SOURCE_SIZE.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.
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.).
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),...
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?
Quote from: Baronius on October 23, 2008, 05:41:13 PMI am wondering why they're corrupt.
QuoteI don't get it.Perhaps I'm misinterpreting something, so let me summarize what I believed the problem is:
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.)
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.
(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.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.
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.[...]
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).
Quote[..]then we assume the last feature block didn't get filled inFilled 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).
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?