Author Topic: Have you been customising the Premium Modules?  (Read 1371 times)

Legacy_DrMcCoy

  • Newbie
  • *
  • Posts: 33
  • Karma: +0/-0
Have you been customising the Premium Modules?
« Reply #15 on: November 13, 2015, 10:46:27 pm »


               

All of the GFF type files inside of the modules have headers that need to be fixed. They're missing the first 8 bytes(like "IFO V3.2" or "ARE V3.2"), and all of the byte offsets in the headers are too high by a certain amount(different per module, no clue how the game determines the amount. With basic knowledge of the GFF format you can quickly work out the value).


It looks to me that that amount is the first byte of the MD5sum of the premium module's NWM file.

If the MD5 of the NWN is, say, c14b9f0ba5eef976b8860ef147076e52 (fictional value), the offsets are all off by 0xC1 (i.e. 193). And then you have to take into account the 8 bytes of the missing header.

For example, the first 4 bytes of a GFF within an encrypted HAK that belongs to a premium module with the NWM MD5 of c14b9f0ba5eef976b8860ef147076e52 would be 0xF1. Because 0xF1 - 0xC1 = 0x30, which is the place directly after the whole GFF header (with the offsets to the different parts). If you want add the "IFO V3.2", you need to correct the 0xF1 to 0x38. This means you need to substract 0xB9 (0xC1 - 0x08) from all offsets within the GFF.
               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Have you been customising the Premium Modules?
« Reply #16 on: November 14, 2015, 01:47:45 am »


               


It looks to me that that amount is the first byte of the MD5sum of the premium module's NWM file.


If the MD5 of the NWN is, say, c14b9f0ba5eef976b8860ef147076e52 (fictional value), the offsets are all off by 0xC1 (i.e. 193). And then you have to take into account the 8 bytes of the missing header.


For example, the first 4 bytes of a GFF within an encrypted HAK that belongs to a premium module with the NWM MD5 of c14b9f0ba5eef976b8860ef147076e52 would be 0xF1. Because 0xF1 - 0xC1 = 0x30, which is the place directly after the whole GFF header (with the offsets to the different parts). If you want add the "IFO V3.2", you need to correct the 0xF1 to 0x38. This means you need to substract 0xB9 (0xC1 - 0x08) from all offsets within the GFF.




 


Well, we can already play premium modules offline, but it would still be great if they could be decrypted, so that we might open them in the toolset. Windwakr's version of decrypted modules allow them to be opened, but there are no script sources and you can't save any changes you made without expecting an error.