Advertisement
BitEmE

GTA V - SCRIPT STRUCTURE (.xsc/.csc)

Jun 22nd, 2014
1,539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.65 KB | None | 0 0
  1. /*****************************************************************************\
  2.  
  3. Copyright (C) 2013-2014 - bitE mE - <bitE0mE at outlook dot com>
  4.  
  5. This software is provided 'as-is', without any express or implied
  6. warranty.  In no event will the authors be held liable for any damages
  7. arising from the use of this software.
  8.  
  9. Permission is granted to anyone to use this software for any purpose,
  10. including commercial applications, and to alter it and redistribute it
  11. freely, subject to the following restrictions:
  12.  
  13. 1. The origin of this software must not be misrepresented; you must not
  14. claim that you wrote the original software. If you use this software
  15. in a product, an acknowledgment in the product documentation would be
  16. appreciated but is not required.
  17. 2. Altered source versions must be plainly marked as such, and must not be
  18. misrepresented as being the original software.
  19. 3. This notice may not be removed or altered from any source distribution.
  20.  
  21. \*****************************************************************************/
  22.  
  23. // Script are located in "script.rpf" -> "levels/gta5/script/script.rpf"
  24. class CRSC { // for xbox 360 and playstation 3 script files (.xsc and .csc)
  25. public:
  26.     int hdr; //0x00 - 0x03
  27.     short ptr1; // 0x04 - 0x05
  28.     short size1; // 0x06 - 0x07
  29.     short ptr2; // 0x08 - 0x09
  30.     short ptrptrCodeStart; //0x0A-0x0B
  31.     int unk; // 0x0C-0x0F (checksum?)
  32.     int scriptSize; // 0x10 - 0x13
  33.     int unk2; // 0x14 - 0x17
  34.     int sizeUnk1; // 0x18-0x1B
  35.     int unk3; // 0x1C-0x1F
  36.     int sizeUnk2; //0x20 - 0x24
  37.     short ptr3; // 0x24 - 0x27
  38.     short offset3; // 0x26 - 0x29
  39.     int unk4; // 0x28 - 0x2D
  40.     short ptr4; // 0x2C - 0x2F
  41.     short offset4; // 0x2E - 0x2F
  42.     int unk5; // 0x30 - 0x35
  43.     int unk6; // 0x34 - 0x37
  44.     int unk7; // 0x38 - 0x3B
  45.     int unk8; // 0x3C - 0x41
  46.     short ptr5; // 0x40 - 0x41
  47.     short namePtr; // 0x42 - 0x43
  48.     short ptr6; // 0x44 - 0x45
  49.     short ptrptrStringTable; // 0x46 - 0x47
  50.     int stringTableSize; // 0x48 - 0x4F
  51.     int unk9; // 0x50 - 0x53
  52.  
  53.     /*
  54.         XSC.sys file format (Xenon Script Container(XSC) - XBOX360)
  55.             ---------------- -
  56.             0x00 - 0x03 - Header(0x34274500)
  57.             0x04 - Padding(0x50)
  58.             0x05 - 0x07 - Size 1
  59.             0x08 - Padding(0x50)
  60.             0x09 - 0x0B - Size 2
  61.             0x0C - 0x0F - Magic ? (0xFDF69E36)
  62.             0x10 - 0x13 - Size of Script(starting with(byte 0x2D->byte 0x2E) with 2 nulls
  63.             0x14 - 0x17 - Padding(0x00)
  64.             0x18 - 0x1B - Size(? )
  65.             0x1C - 0x1F - Padding(0x00)
  66.             0x20 - 0x23 - Size(? )
  67.             0x24 - Padding(0x50)
  68.             0x25 - 0x27 - Size(? )
  69.             0x28 - 0x2B - Padding(0x00)
  70.             0x2C - Padding(0x50)
  71.             0x2D - 0x2F - Size(? )
  72.             0x30 - 0x33 - Padding(0x00)
  73.             0x34 - 0x37 - Padding(0x00)
  74.             0x38 - 0x3B - Checksum(probably CRC32)
  75.             0x3C - 0x3F - Count(? )
  76.             0x40 - Padding(0x50)
  77.             0x41 - 0x43 - Offset of string table.
  78.             0x44 - Padding(0x50)
  79.             0x45 - 0x47 - Offset of data / flags for string table(? )
  80.             0x48 - 0x4B - Padding(0x00)
  81.             0x4C - 0x4F - Padding(0x00)
  82.             0x50 - Start of Script.
  83.         if 0x50 not start of script
  84.             0x50 - Padding(0x50)
  85.             0x51 - 0x53 - Offset of start of script.
  86.     */
  87.    
  88.     /*
  89.         CSC.sys file format (Cell Script Container(CSC) - PLAYSTATION 3)
  90.             ---------------- -
  91.             0x00 - 0x03 - Header(0x34274500)
  92.             0x04 - Padding(0x50)
  93.             0x05 - 0x07 - Size 1
  94.             0x08 - Padding(0x50)
  95.             0x09 - 0x0B - Size 2
  96.             0x0C - 0x0F - Magic ? (0xFDF69E36)
  97.             0x10 - 0x13 - Size of Script(starting with(byte 0x2D->byte 0x2E) with 2 nulls
  98.             0x14 - 0x17 - Padding(0x00)
  99.             0x18 - 0x1B - Size(? )
  100.             0x1C - 0x1F - Padding(0x00)
  101.             0x20 - 0x23 - Size(? )
  102.             0x24 - Padding(0x50)
  103.             0x25 - 0x27 - Size(? )
  104.             0x28 - 0x2B - Padding(0x00)
  105.             0x2C - Padding(0x50)
  106.             0x2D - 0x2F - Size(? )
  107.             0x30 - 0x33 - Padding(0x00)
  108.             0x34 - 0x37 - Padding(0x00)
  109.             0x38 - 0x3B - Checksum(probably CRC32)
  110.             0x3C - 0x3F - Count(? )
  111.             0x40 - Padding(0x50)
  112.             0x41 - 0x43 - Offset of string table.
  113.             0x44 - Padding(0x50)
  114.             0x45 - 0x47 - Offset of data / flags for string table(? )
  115.             0x48 - 0x4B - Padding(0x00)
  116.             0x4C - 0x4F - Padding(0x00)
  117.             0x50 - Start of Script.
  118.         if 0x50 not start of script
  119.             0x50 - Padding(0x50)
  120.             0x51 - 0x53 - Offset of start of script.
  121.     */
  122. };
  123.  
  124. // Example script(streaming.scs)
  125.  
  126.         0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 (DECIMAL)
  127. Pos|    0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F  (HEX)
  128. 0x00:   37 43 53 52 00 00 00 09 00 02 00 00 90 00 00 00
  129. 0x10:   A6 80 A6 58 96 18 2A 4F CB DF 65 DB 36 31 B9 07
  130. 0x20:   9F CA D2 D3 3E 01 83 77 16 DF 9A 84 49 88 95 37
  131. 0x30:   9A 4A C7 BE 8A F1 52 5A B8 B4 A5 7F 78 BB 33 DB
  132. 0x40:   FB 4A 35 52 DA 86 0F 28 8E 4A D9 A8 88 F4 93 83
  133. 0x50:   88 AB DF 2D 22 59 80 4B 34 6A 41 A7 6E 02 D1 D4
  134. 0x60:   54 A9 27 5B D7 88 89 EB B3 7B 43 CA BF 32 E7 D0
  135. 0x70:   00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement