Difference between revisions of "Talk:IMG archive"

From GTAMods Wiki
Jump to navigation Jump to search
(SA - Streaming size/archive size: new section)
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== SA - Streaming size/archive size ==
+
== SA - Streaming size/archive size (IGNORE) ==
  
 
Why is it thought that there are two sizes in each directory entry? To me, the fact that the second size is always zero suggests that the two 2-byte size values are actually just one 4-byte value. If you read a 4-byte value there, you always get the same number as you would get by reading the first 2-byte value (by virtue of the fact that the second 2 bytes are always 0). Additionally, it would make sense for Rockstar to have used a <code>uint32_t</code> for the size, because they used one for the offset. All my tools use a <code>uint32_t</code> here and it has never caused any issues. – [[User:Squ1dd13|Squ1dd13]] ([[User talk:Squ1dd13|talk]]) 20:37, 29 October 2020 (UTC)
 
Why is it thought that there are two sizes in each directory entry? To me, the fact that the second size is always zero suggests that the two 2-byte size values are actually just one 4-byte value. If you read a 4-byte value there, you always get the same number as you would get by reading the first 2-byte value (by virtue of the fact that the second 2 bytes are always 0). Additionally, it would make sense for Rockstar to have used a <code>uint32_t</code> for the size, because they used one for the offset. All my tools use a <code>uint32_t</code> here and it has never caused any issues. – [[User:Squ1dd13|Squ1dd13]] ([[User talk:Squ1dd13|talk]]) 20:37, 29 October 2020 (UTC)
 +
:Game reads this as uint16.
 +
 +
<pre>
 +
.text:005B61E6 058                movzx  eax, word ptr [esp+60]                                  ; streaming size
 +
.text:005B61EB 058                mov    ecx, CStreaming__ms_streamingBufferSize
 +
.text:005B61F1 058                add    esp, 0Ch
 +
.text:005B61F4 04C                cmp    eax, ecx
 +
.text:005B61F6 04C                jle    short loc_5B61FD
 +
.text:005B61F8 04C                mov    CStreaming__ms_streamingBufferSize, eax
 +
</pre>
 +
 +
[[User:Seemann|Seemann]] ([[User talk:Seemann|talk]]) 18:55, 31 October 2020 (UTC)
 +
::Sorry, I probably should have checked the <code>CStreaming</code> class before posting this. I've been looking at the stripped iOS binary too long... Thanks for clearing this up. (FWIW, sorry about the original tone – I've just read it back and it sounds awful!) – [[User:Squ1dd13|Squ1dd13]] ([[User talk:Squ1dd13|talk]]) 17:34, 2 November 2020 (UTC)

Latest revision as of 18:02, 2 November 2020

SA - Streaming size/archive size (IGNORE)

Why is it thought that there are two sizes in each directory entry? To me, the fact that the second size is always zero suggests that the two 2-byte size values are actually just one 4-byte value. If you read a 4-byte value there, you always get the same number as you would get by reading the first 2-byte value (by virtue of the fact that the second 2 bytes are always 0). Additionally, it would make sense for Rockstar to have used a uint32_t for the size, because they used one for the offset. All my tools use a uint32_t here and it has never caused any issues. – Squ1dd13 (talk) 20:37, 29 October 2020 (UTC)

Game reads this as uint16.
.text:005B61E6 058                 movzx   eax, word ptr [esp+60]                                  ; streaming size
.text:005B61EB 058                 mov     ecx, CStreaming__ms_streamingBufferSize
.text:005B61F1 058                 add     esp, 0Ch
.text:005B61F4 04C                 cmp     eax, ecx
.text:005B61F6 04C                 jle     short loc_5B61FD
.text:005B61F8 04C                 mov     CStreaming__ms_streamingBufferSize, eax

Seemann (talk) 18:55, 31 October 2020 (UTC)

Sorry, I probably should have checked the CStreaming class before posting this. I've been looking at the stripped iOS binary too long... Thanks for clearing this up. (FWIW, sorry about the original tone – I've just read it back and it sounds awful!) – Squ1dd13 (talk) 17:34, 2 November 2020 (UTC)