diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..2affaad --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,27 @@ +# Contributing and working on Kawari + +Here are various helpful resources and tips when working on Kawari. + +## Packet capture + +The well-tested packet capturing solutions are [TemporalStasis](https://github.com/WorkingRobot/TemporalStasis/) and [Project Chronofoil](https://github.com/ProjectChronofoil). You should use Project Chronofoil under most circumstances, but it requires Dalamud. TemporalStasis works like a standalone proxy server, and can work with a vanilla game. + +To extract `.cfcap` captures from Project Chronofoil, use `cfcap-expand` from [XIVPacketTools](https://github.com/redstrate/XIVPacketTools). + +## Updating to new patches + +Here are the various things that should be checked when updating Kawari to a newer patch: + +* Bump the supported game versions in `lib.rs` so the patch server lets you through. +* Double check IPC struct sizes in `calc_size()` if the structures changed. +* Replace testing data in `resources/tests` and re-run the tests. +* The IPC opcodes _will_ change and must all be replaced. +* Check the game version used in the encryption key in `lib.rs`. + +## Contributing + +Before making a pull request, make sure: + +* Kawari compiles and runs fine. At a minimum, you should be able to login to the World server. +* Run `cargo fmt` to ensure your code is formatted. +* Run `cargo clippy` and fix all of the warnings for any new code, to the best of your ability. diff --git a/README.md b/README.md index a08a504..2230d59 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ Only the Global region is supported. Only the Windows client is supported. Suppo ## Running -A guide to running Kawari can be followed [here](USAGE.md). +Kawari is designed to be easy to run. A guide to running Kawari can be followed [here](USAGE.md). + +## Contributing + +Pull requests for new features, patch updates, and documentation are welcome. A guide for contributing and updating Kawari can be found [here](CONTRIBUTING.md). ## Credits & Thank You diff --git a/src/lib.rs b/src/lib.rs index b2748df..313c96b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,6 +32,9 @@ pub mod login; /// Patch server-specific code. pub mod patch; +/// Used in the encryption key. +const GAME_VERSION: u16 = 7000; + /// Supported boot version. pub const SUPPORTED_BOOT_VERSION: Version = Version("2025.01.10.0000.0001"); diff --git a/src/packet/encryption.rs b/src/packet/encryption.rs index 8164dd5..07c1d45 100644 --- a/src/packet/encryption.rs +++ b/src/packet/encryption.rs @@ -2,12 +2,10 @@ use std::io::Cursor; use binrw::BinResult; -use crate::blowfish::Blowfish; +use crate::{GAME_VERSION, blowfish::Blowfish}; use super::ReadWriteIpcSegment; -const GAME_VERSION: u16 = 7000; - pub fn generate_encryption_key(key: &[u8], phrase: &str) -> [u8; 16] { let mut base_key = vec![0x78, 0x56, 0x34, 0x12]; base_key.extend_from_slice(key);