2023-01-10 11:49:05 +00:00
[](https://github.com/xensik/gsc-tool/actions)
2020-05-21 13:32:38 +02:00

2022-09-20 16:47:02 +02:00
[](https://github.com/xensik/gsc-tool/issues)
[](https://github.com/xensik/gsc-tool/releases)
[](https://www.paypal.me/xensik)
2022-07-16 19:55:31 +02:00
2020-05-21 13:32:38 +02:00
# GSC Tool
A utility to compile & decompile IW engine game scripts.
2022-07-16 19:55:31 +02:00
2022-01-19 20:01:12 +01:00
## Supported Games
2022-08-23 15:59:29 +02:00
- **IW5** *(Call of Duty: Modern Warfare 3)* `PC` `PS3` `Xbox 360`
2022-09-20 16:47:02 +02:00
- **IW6** *(Call of Duty: Ghosts)* `PC` `PS3` `PS4` `Xbox 360` `Xbox One`
2022-08-23 15:59:29 +02:00
- **IW7** *(Call of Duty: Infinite Warfare)* `PC` `PS4` `Xbox One`
- **IW8** *(Call of Duty: Modern Warfare (2019) / Warzone)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S`
2023-01-23 23:31:08 +01:00
- **IW9** *(Call of Duty: Modern Warfare II (2022) / Warzone 2)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S`
2022-09-20 16:47:02 +02:00
- **S1** *(Call of Duty: Advanced Warfare)* `PC` `PS3` `PS4` `Xbox 360` `Xbox One`
2022-08-23 15:59:29 +02:00
- **S2** *(Call of Duty: WWII)* `PC` `PS4` `Xbox One`
- **S4** *(Call of Duty: Vanguard)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S`
- **H1** *(Call of Duty: Modern Warfare Remastered)* `PC` `PS4` `Xbox One`
- **H2** *(Call of Duty: Modern Warfare 2 Campaign Remastered)* `PC` `PS4` `PS5` `Xbox One` `Xbox Series X|S`
2023-05-13 19:24:57 +02:00
- **T6** *(Call of Duty: Black Ops II)* `PC` `PS3` `Xbox 360` `Wii U`
- **T7** *(Call of Duty: Black Ops III)* `PC` *(Decompiler)*
2022-08-23 15:59:29 +02:00
- **T8** *(Call of Duty: Black Ops 4)* ** *\*WIP\****
- **T9** *(Call of Duty: Black Ops Cold War)* ** *\*WIP\****
2022-07-16 19:55:31 +02:00
2020-05-21 13:32:38 +02:00
## Usage
2023-05-13 19:24:57 +02:00
``./gsc-tool.exe <mode> <game> <system> <path>` `
2021-11-15 17:35:00 +01:00
2023-05-13 19:24:57 +02:00
**mode**: `asm` , `disasm` , `comp` , `decomp` , `parse`
2022-09-20 16:47:02 +02:00
- *note:* zonetool files (*.cgsc*, *.cgsc.stack* ) use: `zasm` , `zdisasm` , `zcomp` , `zdecomp` modes
2021-11-15 17:35:00 +01:00
2023-05-13 19:24:57 +02:00
**game**: `iw5` , `iw6` , `iw7` , `iw8` , `iw9` , `s1` , `s2` , `s4` , `h1` , `h2` , `t6` `t7` `t8` `t9`
2021-11-15 17:35:00 +01:00
2023-05-13 19:24:57 +02:00
**system**: `pc` , `ps3` , `ps4` , `ps5` , `xb2` (*360*), `xb3` (*One*), `xb4` (*Series X|S*), `wiiu`
2020-05-21 13:32:38 +02:00
2023-05-13 19:24:57 +02:00
**path**: `file` or `directory` (recursive process all files inside the directory)
Example: ``./gsc-tool.exe comp iw5 pc ./data/iw5/my_fancy_script.gsc` `
2022-07-16 19:55:31 +02:00
2020-05-21 13:32:38 +02:00
| Mode |Description | Output |
|:---------|:--------------------------|:------------|
2021-11-15 17:35:00 +01:00
|`asm` |assemble a `file.gscasm` |`file.gscbin` |
|`disasm` |dissasemble a `file.gscbin` |`file.gscasm` |
|`comp` |compile a `file.gsc` |`file.gscbin` |
|`decomp` |decompile a `file.gscbin` |`file.gsc` |
2023-01-30 13:48:27 +01:00
|`parse` |parse a `file.gsc` |`file.gsc` |
2020-05-21 13:32:38 +02:00
2022-02-19 16:22:11 +01:00
## File Format
2022-05-01 13:52:25 +02:00
If you need to extract scripts from fastfiles or game memory, use [Zonetool ](https://github.com/ZoneTool/zonetool ) or [Jekyll ](https://github.com/EthanC/Jekyll ).
2022-09-20 16:47:02 +02:00
- gsc-tool `.gscbin` format is a serialized ScriptFile struct: < br />
2022-07-16 19:55:31 +02:00
***name***: null-terminated string < br / >
***compressedLen***: 4 byte uint < br / >
***len***: 4 byte uint < br / >
***bytecodeLen***: 4 byte uint < br / >
***buffer***: byte array[compressedLen] < br / >
***bytecode***: byte array[bytecodeLen] < br / >
2020-05-21 13:32:38 +02:00
2022-09-20 16:47:02 +02:00
note: for PS3 & Xbox 360 `.gscbin` files *(compressedLen, len, bytecodeLen)* are saved as little-endian!!
- zonetool (IW5) format made of bytecode file `.cgsc` and decompressed stack buffer `.cgsc.stack` .
- treyarch (T6) format is a single buffer with gscobj data `.gsc` or `.csc` .
2023-06-12 23:21:43 +02:00
## Build
- install [*premake5* ](https://premake.github.io ) on your system PATH
- clone this repository
- update the submodules ``git submodule update --init --recursive` `
- run prebuild script ``premake5 vs2022`` (windows) or ``premake5 gmake2` ` (linux/macos)
2022-09-20 16:47:02 +02:00
## Contribute
2023-05-13 19:24:57 +02:00
If you like my work, consider sponsoring/donating! Would allow me to spend more time adding new features & fixing bugs.
2022-02-19 16:22:11 +01:00
2022-09-20 16:47:02 +02:00
BTC: bc1qky7x9kpjlt6nsvt7pckc3wwzk8rk9pgtnmw98u\
ETH: 0x6261BBE1a33F6Fec4b722DbCe2c28B4CC02c9C7B\
[](https://www.paypal.me/xensik) [](https://ko-fi.com/xensik)
2022-05-01 13:52:25 +02:00
2020-05-21 13:32:38 +02:00
## Credits
2022-09-20 16:47:02 +02:00
This project is based on [*RektInator's* gsc-asm ](https://github.com/ZoneTool/gsc-asm ). Special thanks to **RektInator** , **JTAG** & **Dasfonia** .
2022-07-16 19:55:31 +02:00
2020-05-21 13:32:38 +02:00
## Disclaimer
This software has been created purely for the purposes of academic research. Project maintainers are not responsible or liable for misuse of the software. Use responsibly.