A fork of https://github.com/xensik/gsc-tool - A utility to compile & decompile IW engine game scripts.
Go to file
dependabot[bot] 8423d296ad build(deps): bump deps/fmt from e03753c to d646fd0 (#72)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 21:08:32 +01:00
.github update(github): funding (#67) 2023-02-13 21:53:04 +01:00
data move data 2021-09-17 16:46:55 +02:00
deps build(deps): bump deps/fmt from e03753c to d646fd0 (#72) 2023-02-17 21:08:32 +01:00
docs iw8 build 2021-09-13 20:00:43 +02:00
gen feature(iw9): compiler builtins (#71) 2023-02-17 18:56:19 +01:00
src feature(iw9): compiler builtins (#71) 2023-02-17 18:56:19 +01:00
tools feature(github): add workflow (#40) 2023-01-10 12:49:05 +01:00
.gitignore feature(tool): rename command (#54) 2023-02-03 00:16:25 +01:00
.gitmodules feature(refactor): big update (#41) 2023-01-23 23:31:08 +01:00
appveyor.yml fix deploy 2023-01-30 16:05:26 +01:00
LICENSE init 2021-05-08 18:15:25 +02:00
prebuild-linux.sh feature(github): add workflow (#40) 2023-01-10 12:49:05 +01:00
prebuild-macos.sh feature(github): add workflow (#40) 2023-01-10 12:49:05 +01:00
prebuild-windows.bat feature(github): add workflow (#40) 2023-01-10 12:49:05 +01:00
premake5.lua feature(refactor): big update (#41) 2023-01-23 23:31:08 +01:00
README.md feature(preprocessor): implement preprocessor & parse command (#48) 2023-01-30 13:48:27 +01:00

build license issues releases paypal

GSC Tool

A utility to compile & decompile IW engine game scripts.

Supported Games

  • IW5 (Call of Duty: Modern Warfare 3) PC PS3 Xbox 360
  • IW6 (Call of Duty: Ghosts) PC PS3 PS4 Xbox 360 Xbox One
  • 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
  • IW9 (Call of Duty: Modern Warfare II (2022) / Warzone 2) PC PS4 PS5 Xbox One Xbox Series X|S
  • S1 (Call of Duty: Advanced Warfare) PC PS3 PS4 Xbox 360 Xbox One
  • 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
  • T6 (Call of Duty: Black Ops II) PC
  • T7 (Call of Duty: Black Ops III) *WIP*
  • T8 (Call of Duty: Black Ops 4) *WIP*
  • T9 (Call of Duty: Black Ops Cold War) *WIP*

Usage

./gsc-tool.exe <mode> <game> <path>

modes: asm, disasm, comp, decomp, parse

  • note: zonetool files (.cgsc, .cgsc.stack) use: zasm, zdisasm, zcomp, zdecomp modes

games: iw5, iw6, iw7, iw8, iw9, s1, s2, s4, h1, h2, t6

  • note: PS3 & Xbox 360 use iw5ps, iw5xb, iw6ps, iw6xb, s1ps, s1xb games

paths: file or directory (recursive process all files inside the directory)

Example: ./gsc-tool.exe comp iw5 ./data/iw5/my_fancy_script.gsc

Mode Description Output
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
parse parse a file.gsc file.gsc

File Format

If you need to extract scripts from fastfiles or game memory, use Zonetool or Jekyll.

  • gsc-tool .gscbin format is a serialized ScriptFile struct:
    name: null-terminated string
    compressedLen: 4 byte uint
    len: 4 byte uint
    bytecodeLen: 4 byte uint
    buffer: byte array[compressedLen]
    bytecode: byte array[bytecodeLen]

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.

Contribute

If you like my work, feel free to contribute! Would allow me to spend more time adding new features & fixing bugs.

BTC: bc1qky7x9kpjlt6nsvt7pckc3wwzk8rk9pgtnmw98u
ETH: 0x6261BBE1a33F6Fec4b722DbCe2c28B4CC02c9C7B
pypl kofi

Credits

This project is based on RektInator's gsc-asm. Special thanks to RektInator, JTAG & Dasfonia.

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.