Skip to content

How needed are file integrity checks before patching? Do you use them in your mods?

AbelAbel Member Posts: 785
I think all of you modders now about the simple resource size check. My question is: do you add additional checks? Do you try to repair corrupted files? I'm not sure how frequently you may encounter those. So what's your stance on that?

Comments

  • [Deleted User][Deleted User] Posts: 0
    edited March 2016
    The user and all related content has been deleted.
  • AbelAbel Member Posts: 785
    edited March 2016
    Ha, my bad! @subtledoctor
    Here's the simple check I mentioned:
    COPY_EXISTING_REGEXP ~.*\.itm~ ~override~
      PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
      END
    BUT_ONLY_IF_IT_CHANGES
    I just wondered if you extended this approach to more complex checks (not only size but values for example) maybe fixes.
  • CamDawgCamDawg Member, Developer Posts: 3,438
    A lot of the SOURCE_SIZE checks were an outgrowth of ALLOW_MISSING. In the olden days, if you wanted to patch, say, four files in a BG2 game and one of them was ToB-exclusive, you'd list the ToB file in ALLOW_MISSING and then copy all four without having to do an SoA/ToB game check. This would cause WeiDU to not crap out when copying a non-present file by pretending it was there but 0 bytes in length. You then added SOURCE_SIZE checks so that you would only patch legitimately present files instead of ALLOW_MISSING phantoms.

    I generally don't bother these days unless there's a legitimate reason to think the regexp is going to catch malformed files.
  • The user and all related content has been deleted.
Sign In or Register to comment.