treesitter-reverse-engineering/02-ws-js
2024-02-03 05:59:41 -05:00
..
queries fix: repeated, map, and edge cases 2024-02-03 05:59:41 -05:00
src fix: repeated, map, and edge cases 2024-02-03 05:59:41 -05:00
Cargo.lock fix: repeated, map, and edge cases 2024-02-03 05:59:41 -05:00
Cargo.toml fix: repeated, map, and edge cases 2024-02-03 05:59:41 -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