treesitter-reverse-engineering/02-ws-js
2024-01-30 19:38:42 -05:00
..
queries Initial commit 2024-01-30 19:38:42 -05:00
src Initial commit 2024-01-30 19:38:42 -05:00
Cargo.lock Initial commit 2024-01-30 19:38:42 -05:00
Cargo.toml Initial commit 2024-01-30 19:38:42 -05:00
example_define.js Initial commit 2024-01-30 19:38:42 -05:00
example_protocol.js Initial commit 2024-01-30 19:38:42 -05:00
parse.py Initial commit 2024-01-30 19:38:42 -05:00
README.md Initial commit 2024-01-30 19:38:42 -05:00

WW Proto Dumper (Tree-Sitter ❤️ Reverse Engineering)

This is a PoC and demo to show how one can use tree-sitter on dumped javascript netcode files for a certain game to extract fully intact proto files. To see its potential, you can run the following (replace "REPLACEME" in enum_2.scm with "e"):

The Python code was my initial attempt at this, but my partially-implemented matches API had a bug, so I just opted to go with Rust.

tree-sitter query queries/message.scm example_protocol.js
tree-sitter query queries/enum.scm example_protocol.js
tree-sitter query queries/enum_2.scm example_protocol.js
tree-sitter query queries/id.scm example_define.js