From ea62275f894ee9ecda18c9c7a4ba35e1ccea9319 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 27 Jul 2022 00:09:14 -0700 Subject: [PATCH] fix login commands in tests --- CMakeLists.txt | 2 +- src/License.cc | 5 + src/License.hh | 3 +- src/Main.cc | 17 ++- src/ReplaySession.cc | 140 +++++++++++++++++++++++- src/ReplaySession.hh | 7 +- tests/GC-Episode3GameSmokeTest.test.txt | 20 ++-- tests/GC-ForestGame.test.txt | 20 ++-- tests/GC-LoginSmokeTest.test.txt | 12 +- tests/PC-BasicGame.test.txt | 34 +++--- 10 files changed, 210 insertions(+), 50 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bcb968d..464af390 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ foreach(TestCase IN ITEMS ${TestCases}) add_test( NAME ${TestCase} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${CMAKE_BINARY_DIR}/newserv --replay-log=${TestCase} --config=${CMAKE_SOURCE_DIR}/tests/config.json) + COMMAND ${CMAKE_BINARY_DIR}/newserv --replay-log=${TestCase} --config=${CMAKE_SOURCE_DIR}/tests/config.json --require-password=password --require-access-key=111111111111) endforeach() diff --git a/src/License.cc b/src/License.cc index afba5a8e..904e5cdd 100644 --- a/src/License.cc +++ b/src/License.cc @@ -41,6 +41,8 @@ string License::str() const { +LicenseManager::LicenseManager() : filename(""), autosave(false) { } + LicenseManager::LicenseManager(const string& filename) : filename(filename), autosave(true) { try { @@ -65,6 +67,9 @@ LicenseManager::LicenseManager(const string& filename) } void LicenseManager::save() const { + if (this->filename.empty()) { + throw logic_error("license manager has no filename; cannot save"); + } auto f = fopen_unique(this->filename, "wb"); for (const auto& it : this->serial_number_to_license) { if (it.second->privileges & Privilege::TEMPORARY) { diff --git a/src/License.hh b/src/License.hh index b7b8b08b..6cfba6ff 100644 --- a/src/License.hh +++ b/src/License.hh @@ -46,7 +46,8 @@ struct License { class LicenseManager { public: - LicenseManager(const std::string& filename); + LicenseManager(); + explicit LicenseManager(const std::string& filename); ~LicenseManager() = default; void save() const; diff --git a/src/Main.cc b/src/Main.cc index ec9e06c8..76975b3b 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -288,6 +288,8 @@ int main(int argc, char** argv) { bool parse_data = false; bool byteswap_data = false; const char* replay_log_filename = nullptr; + const char* replay_required_access_key = ""; + const char* replay_required_password = ""; struct sockaddr_storage cat_client_remote; for (int x = 1; x < argc; x++) { if (!strcmp(argv[x], "--help")) { @@ -337,6 +339,10 @@ int main(int argc, char** argv) { } else if (!strncmp(argv[x], "--replay-log=", 13)) { behavior = Behavior::REPLAY_LOG; replay_log_filename = &argv[x][13]; + } else if (!strncmp(argv[x], "--require-password=", 19)) { + replay_required_password = &argv[x][19]; + } else if (!strncmp(argv[x], "--require-access-key=", 21)) { + replay_required_access_key = &argv[x][21]; } else if (!strncmp(argv[x], "--config=", 9)) { config_filename = &argv[x][9]; } else { @@ -461,8 +467,12 @@ int main(int argc, char** argv) { auto config_json = JSONObject::parse(load_file(config_filename)); populate_state_from_config(state, config_json); - config_log.info("Loading license list"); - state->license_manager.reset(new LicenseManager("system/licenses.nsi")); + if (!replay_log_filename) { + config_log.info("Loading license list"); + state->license_manager.reset(new LicenseManager("system/licenses.nsi")); + } else { + state->license_manager.reset(new LicenseManager()); + } config_log.info("Loading battle parameters"); state->battle_params.reset(new BattleParamTable("system/blueburst/BattleParamEntry")); @@ -515,7 +525,8 @@ int main(int argc, char** argv) { state->game_server.reset(new Server(base, state)); auto f = fopen_unique(replay_log_filename, "rt"); - replay_session.reset(new ReplaySession(base, f.get(), state)); + replay_session.reset(new ReplaySession( + base, f.get(), state, replay_required_access_key, replay_required_password)); replay_session->start(); } else if (behavior == Behavior::RUN_SERVER) { diff --git a/src/ReplaySession.cc b/src/ReplaySession.cc index b0615f24..081df002 100644 --- a/src/ReplaySession.cc +++ b/src/ReplaySession.cc @@ -44,6 +44,133 @@ shared_ptr ReplaySession::create_event( return event; } +void ReplaySession::check_for_password(shared_ptr ev) const { + auto version = this->clients.at(ev->client_id)->version; + + auto check_pw = [&](const string& pw) { + if (!this->required_password.empty() && (pw != this->required_password)) { + throw runtime_error("sent password is incorrect"); + } + }; + auto check_ak = [&](const string& ak) { + if (this->required_access_key.empty()) { + return; + } + string ref_access_key; + if (version == GameVersion::DC || version == GameVersion::PC || version == GameVersion::PATCH) { + ref_access_key = this->required_access_key.substr(0, 8); + } else { + ref_access_key = this->required_access_key; + } + if (ak != ref_access_key) { + throw runtime_error("sent access key is incorrect"); + } + }; + auto check_either = [&](const string& s) { + try { + check_ak(s); + } catch (const exception&) { + check_pw(s); + } + }; + + const void* cmd_data = ev->data.data() + ((version == GameVersion::BB) ? 8 : 4); + size_t cmd_size = ev->data.size() - ((version == GameVersion::BB) ? 8 : 4); + + switch (version) { + case GameVersion::DC: + // TODO + throw logic_error("sent passwords cannot be checked on DC"); + case GameVersion::PATCH: { + const auto& header = check_size_t( + ev->data, sizeof(PSOCommandHeaderPC), 0xFFFF); + if (header.command == 0x04) { + check_either(check_size_t(cmd_data, cmd_size).password); + } + break; + } + case GameVersion::PC: { + const auto& header = check_size_t( + ev->data, sizeof(PSOCommandHeaderPC), 0xFFFF); + if (header.command == 0x03) { + check_ak(check_size_t(cmd_data, cmd_size).access_key2); + } else if (header.command == 0x04) { + check_ak(check_size_t(cmd_data, cmd_size).access_key); + } else if (header.command == 0x9A) { + const auto& cmd = check_size_t(cmd_data, cmd_size); + check_ak(cmd.access_key); + check_ak(cmd.access_key2); + } else if (header.command == 0x9C) { + const auto& cmd = check_size_t(cmd_data, cmd_size); + check_ak(cmd.access_key); + check_pw(cmd.password); + } else if (header.command == 0x9D) { + const auto& cmd = check_size_t(cmd_data, cmd_size, + sizeof(C_Login_PC_9D), sizeof(C_LoginExtended_PC_9D)); + check_ak(cmd.access_key); + check_ak(cmd.access_key2); + } + break; + } + case GameVersion::GC: + case GameVersion::XB: { + const auto& header = check_size_t( + ev->data, sizeof(PSOCommandHeaderDCV3), 0xFFFF); + if (header.command == 0x03) { + check_ak(check_size_t(cmd_data, cmd_size).access_key2); + } else if (header.command == 0x04) { + check_ak(check_size_t(cmd_data, cmd_size).access_key); + } else if (header.command == 0x90) { + check_ak(check_size_t(cmd_data, cmd_size).access_key); + } else if (header.command == 0x9A) { + const auto& cmd = check_size_t(cmd_data, cmd_size); + check_ak(cmd.access_key); + check_ak(cmd.access_key2); + } else if (header.command == 0x9C) { + const auto& cmd = check_size_t(cmd_data, cmd_size); + check_ak(cmd.access_key); + check_pw(cmd.password); + } else if (header.command == 0x9E) { + if (version == GameVersion::GC) { + const auto& cmd = check_size_t(cmd_data, cmd_size, + sizeof(C_Login_GC_9E), sizeof(C_LoginExtended_GC_9E)); + check_ak(cmd.access_key); + check_ak(cmd.access_key2); + } else { // XB + const auto& cmd = check_size_t(cmd_data, cmd_size, + sizeof(C_Login_XB_9E), sizeof(C_LoginExtended_XB_9E)); + check_ak(cmd.access_key); + check_ak(cmd.access_key2); + } + } else if (header.command == 0xDB) { + const auto& cmd = check_size_t(cmd_data, cmd_size); + check_ak(cmd.access_key); + check_ak(cmd.access_key2); + check_pw(cmd.password); + } + break; + } + case GameVersion::BB: { + const auto& header = check_size_t( + ev->data, sizeof(PSOCommandHeaderBB), 0xFFFF); + if (header.command == 0x04) { + check_pw(check_size_t(cmd_data, cmd_size).password); + } else if (header.command == 0x93) { + check_pw(check_size_t(cmd_data, cmd_size).password); + } else if (header.command == 0x9C) { + check_pw(check_size_t(cmd_data, cmd_size).password); + } else if (header.command == 0x9E) { + check_pw(check_size_t(cmd_data, cmd_size).password); + } else if (header.command == 0xDB) { + check_pw(check_size_t(cmd_data, cmd_size).password); + } + break; + } + default: + throw logic_error("invalid game version"); + } +} + void ReplaySession::apply_default_mask(shared_ptr ev) { auto version = this->clients.at(ev->client_id)->version; @@ -157,8 +284,12 @@ void ReplaySession::apply_default_mask(shared_ptr ev) { ReplaySession::ReplaySession( shared_ptr base, FILE* input_log, - shared_ptr state) + shared_ptr state, + const string& required_access_key, + const string& required_password) : state(state), + required_access_key(required_access_key), + required_password(required_password), base(base), commands_sent(0), bytes_sent(0), @@ -191,6 +322,13 @@ ReplaySession::ReplaySession( } else { if (parsing_command->type == Event::Type::RECEIVE) { this->apply_default_mask(parsing_command); + } else if (parsing_command->type == Event::Type::SEND) { + try { + this->check_for_password(parsing_command); + } catch (...) { + print_data(stderr, parsing_command->data); + throw; + } } parsing_command = nullptr; } diff --git a/src/ReplaySession.hh b/src/ReplaySession.hh index 8824d8a9..99d0b00f 100644 --- a/src/ReplaySession.hh +++ b/src/ReplaySession.hh @@ -19,7 +19,9 @@ public: ReplaySession( std::shared_ptr base, FILE* input_log, - std::shared_ptr state); + std::shared_ptr state, + const std::string& required_access_key = "", + const std::string& required_password = ""); ReplaySession(const ReplaySession&) = delete; ReplaySession(ReplaySession&&) = delete; ReplaySession& operator=(const ReplaySession&) = delete; @@ -59,6 +61,8 @@ private: }; std::shared_ptr state; + std::string required_access_key; + std::string required_password; std::unordered_map> clients; std::unordered_map> channel_to_client; @@ -79,6 +83,7 @@ private: void update_timeout_event(); void apply_default_mask(std::shared_ptr ev); + void check_for_password(std::shared_ptr ev) const; static void dispatch_on_timeout(evutil_socket_t fd, short events, void* ctx); static void dispatch_on_command_received( diff --git a/tests/GC-Episode3GameSmokeTest.test.txt b/tests/GC-Episode3GameSmokeTest.test.txt index 63e1f1b6..32407ee3 100644 --- a/tests/GC-Episode3GameSmokeTest.test.txt +++ b/tests/GC-Episode3GameSmokeTest.test.txt @@ -23,12 +23,12 @@ I 94711 2022-07-26 00:24:56 - [Commands] Received from C-7 (version=GC command=D 0000000000000000 | DB 00 E0 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000020 | 00 00 00 00 31 30 46 38 36 32 37 38 00 00 00 00 | 10F86278 -0000000000000030 | 00 00 00 00 39 33 33 39 38 35 34 33 34 39 32 33 | 933985434923 +0000000000000030 | 00 00 00 00 31 31 31 31 31 31 31 31 31 31 31 31 | 111111111111 0000000000000040 | 00 00 00 00 00 00 00 00 00 00 00 00 41 00 00 00 | A 0000000000000050 | 31 30 46 38 36 32 37 38 00 00 00 00 00 00 00 00 | 10F86278 0000000000000060 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 39 33 33 39 38 35 34 33 34 39 32 33 00 00 00 00 | 933985434923 +0000000000000080 | 31 31 31 31 31 31 31 31 31 31 31 31 00 00 00 00 | 111111111111 0000000000000090 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 70 61 73 73 77 6F 72 64 00 00 00 00 00 00 00 00 | password @@ -41,12 +41,12 @@ I 94711 2022-07-26 00:24:56 - [Commands] Received from C-7 (version=GC command=9 0000000000000010 | 00 00 00 00 41 00 00 00 00 01 00 00 00 00 00 00 | A 0000000000000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 31 30 46 38 | 10F8 -0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 39 33 33 39 | 6278 9339 -0000000000000050 | 38 35 34 33 34 39 32 33 00 00 00 00 31 30 46 38 | 85434923 10F8 +0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 31 31 31 31 | 6278 1111 +0000000000000050 | 31 31 31 31 31 31 31 31 00 00 00 00 31 30 46 38 | 11111111 10F8 0000000000000060 | 36 32 37 38 00 00 00 00 00 00 00 00 00 00 00 00 | 6278 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 39 33 33 39 | 9339 -0000000000000090 | 38 35 34 33 34 39 32 33 00 00 00 00 00 00 00 00 | 85434923 +0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 31 31 31 31 | 1111 +0000000000000090 | 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 00 | 11111111 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 4E 4F 20 44 | NO D 00000000000000C0 | 41 54 41 00 00 00 00 00 00 00 00 00 00 00 00 00 | ATA @@ -2076,12 +2076,12 @@ I 94711 2022-07-26 00:25:14 - [Commands] Received from C-8 (version=GC command=9 0000000000000010 | 00 00 00 00 41 00 00 00 00 01 00 00 00 00 00 00 | A 0000000000000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 31 30 46 38 | 10F8 -0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 39 33 33 39 | 6278 9339 -0000000000000050 | 38 35 34 33 34 39 32 33 00 00 00 00 31 30 46 38 | 85434923 10F8 +0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 31 31 31 31 | 6278 1111 +0000000000000050 | 31 31 31 31 31 31 31 31 00 00 00 00 31 30 46 38 | 11111111 10F8 0000000000000060 | 36 32 37 38 00 00 00 00 00 00 00 00 00 00 00 00 | 6278 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 39 33 33 39 | 9339 -0000000000000090 | 38 35 34 33 34 39 32 33 00 00 00 00 00 00 00 00 | 85434923 +0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 31 31 31 31 | 1111 +0000000000000090 | 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 00 | 11111111 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 4E 4F 20 44 | NO D 00000000000000C0 | 41 54 41 00 00 00 00 00 00 00 00 00 39 98 AC 82 | ATA 9 diff --git a/tests/GC-ForestGame.test.txt b/tests/GC-ForestGame.test.txt index db29c85f..c0fd0c48 100644 --- a/tests/GC-ForestGame.test.txt +++ b/tests/GC-ForestGame.test.txt @@ -41,12 +41,12 @@ I 26579 2022-07-01 10:22:13 - [Commands] Received from C-5C (version=GC command= 0000000000000000 | DB 00 E0 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000020 | 00 00 00 00 31 30 46 38 36 32 37 38 00 00 00 00 | 10F86278 -0000000000000030 | 00 00 00 00 39 33 33 39 38 35 34 33 34 39 32 33 | 933985434923 +0000000000000030 | 00 00 00 00 31 31 31 31 31 31 31 31 31 31 31 31 | 111111111111 0000000000000040 | 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 | 1 0000000000000050 | 31 30 46 38 36 32 37 38 00 00 00 00 00 00 00 00 | 10F86278 0000000000000060 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 39 33 33 39 38 35 34 33 34 39 32 33 00 00 00 00 | 933985434923 +0000000000000080 | 31 31 31 31 31 31 31 31 31 31 31 31 00 00 00 00 | 111111111111 0000000000000090 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 70 61 73 73 77 6F 72 64 00 00 00 00 00 00 00 00 | password @@ -59,12 +59,12 @@ I 26579 2022-07-01 10:22:13 - [Commands] Received from C-5C (version=GC command= 0000000000000010 | 00 00 00 00 31 00 00 00 00 01 00 00 00 00 00 00 | 1 0000000000000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 31 30 46 38 | 10F8 -0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 39 33 33 39 | 6278 9339 -0000000000000050 | 38 35 34 33 34 39 32 33 00 00 00 00 31 30 46 38 | 85434923 10F8 +0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 31 31 31 31 | 6278 1111 +0000000000000050 | 31 31 31 31 31 31 31 31 00 00 00 00 31 30 46 38 | 11111111 10F8 0000000000000060 | 36 32 37 38 00 00 00 00 00 00 00 00 00 00 00 00 | 6278 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 39 33 33 39 | 9339 -0000000000000090 | 38 35 34 33 34 39 32 33 00 00 00 00 00 00 00 00 | 85434923 +0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 31 31 31 31 | 1111 +0000000000000090 | 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 00 | 11111111 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 4E 4F 20 44 | NO D 00000000000000C0 | 41 54 41 00 00 00 00 00 00 00 00 00 00 00 00 00 | ATA @@ -156,12 +156,12 @@ I 26579 2022-07-01 10:22:17 - [Commands] Received from C-5D (version=GC command= 0000000000000010 | 00 00 00 00 31 00 00 00 00 01 00 00 00 00 00 00 | 1 0000000000000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 31 30 46 38 | 10F8 -0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 39 33 33 39 | 6278 9339 -0000000000000050 | 38 35 34 33 34 39 32 33 00 00 00 00 31 30 46 38 | 85434923 10F8 +0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 31 31 31 31 | 6278 1111 +0000000000000050 | 31 31 31 31 31 31 31 31 00 00 00 00 31 30 46 38 | 11111111 10F8 0000000000000060 | 36 32 37 38 00 00 00 00 00 00 00 00 00 00 00 00 | 6278 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 39 33 33 39 | 9339 -0000000000000090 | 38 35 34 33 34 39 32 33 00 00 00 00 00 00 00 00 | 85434923 +0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 31 31 31 31 | 1111 +0000000000000090 | 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 00 | 11111111 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 4E 4F 20 44 | NO D 00000000000000C0 | 41 54 41 00 00 00 00 00 00 00 00 00 39 98 AC 82 | ATA 9 diff --git a/tests/GC-LoginSmokeTest.test.txt b/tests/GC-LoginSmokeTest.test.txt index 5708a317..9192f505 100755 --- a/tests/GC-LoginSmokeTest.test.txt +++ b/tests/GC-LoginSmokeTest.test.txt @@ -41,12 +41,12 @@ I 22913 2022-06-30 23:45:38 - [Commands] Received from C-2 (version=GC command=0 0000000000000000 | DB 00 E0 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000020 | 00 00 00 00 31 30 46 38 36 32 37 38 00 00 00 00 | 10F86278 -0000000000000030 | 00 00 00 00 39 33 33 39 38 35 34 33 34 39 32 33 | 933985434923 +0000000000000030 | 00 00 00 00 31 31 31 31 31 31 31 31 31 31 31 31 | 111111111111 0000000000000040 | 00 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 | 1 0000000000000050 | 31 30 46 38 36 32 37 38 00 00 00 00 00 00 00 00 | 10F86278 0000000000000060 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 39 33 33 39 38 35 34 33 34 39 32 33 00 00 00 00 | 933985434923 +0000000000000080 | 31 31 31 31 31 31 31 31 31 31 31 31 00 00 00 00 | 111111111111 0000000000000090 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 70 61 73 73 77 6F 72 64 00 00 00 00 00 00 00 00 | password @@ -59,12 +59,12 @@ I 22913 2022-06-30 23:45:38 - [Commands] Received from C-2 (version=GC command=0 0000000000000010 | 00 00 00 00 31 00 00 00 00 01 00 00 00 00 00 00 | 1 0000000000000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 31 30 46 38 | 10F8 -0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 39 33 33 39 | 6278 9339 -0000000000000050 | 38 35 34 33 34 39 32 33 00 00 00 00 31 30 46 38 | 85434923 10F8 +0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 31 31 31 31 | 6278 1111 +0000000000000050 | 31 31 31 31 31 31 31 31 00 00 00 00 31 30 46 38 | 11111111 10F8 0000000000000060 | 36 32 37 38 00 00 00 00 00 00 00 00 00 00 00 00 | 6278 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 39 33 33 39 | 9339 -0000000000000090 | 38 35 34 33 34 39 32 33 00 00 00 00 00 00 00 00 | 85434923 +0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 31 31 31 31 | 1111 +0000000000000090 | 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 00 | 11111111 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 4E 4F 20 44 | NO D 00000000000000C0 | 41 54 41 00 00 00 00 00 00 00 00 00 00 00 00 00 | ATA diff --git a/tests/PC-BasicGame.test.txt b/tests/PC-BasicGame.test.txt index 8ae1cfb8..8aed1f8c 100644 --- a/tests/PC-BasicGame.test.txt +++ b/tests/PC-BasicGame.test.txt @@ -12,7 +12,7 @@ I 80820 2022-07-07 23:33:27 - [Commands] Sending to C-1 (version=Patch command=0 I 80820 2022-07-07 23:33:27 - [Commands] Received from C-1 (version=Patch command=04 flag=00) 0000000000000000 | 70 00 04 00 00 00 00 00 01 00 00 00 00 00 00 00 | p 0000000000000010 | 31 30 46 38 36 32 37 38 00 00 00 00 00 00 00 00 | 10F86278 -0000000000000020 | 39 33 33 39 38 35 34 33 00 00 00 00 00 00 00 00 | 93398543 +0000000000000020 | 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 00 | 11111111 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000040 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000050 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | @@ -91,12 +91,12 @@ I 80820 2022-07-07 23:34:04 - [Commands] Received from C-2 (version=PC command=9 0000000000000000 | E0 00 9A 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000020 | 00 00 00 00 31 30 46 38 36 32 37 38 00 00 00 00 | 10F86278 -0000000000000030 | 00 00 00 00 39 33 33 39 38 35 34 33 00 00 00 00 | 93398543 +0000000000000030 | 00 00 00 00 31 31 31 31 31 31 31 31 00 00 00 00 | 11111111 0000000000000040 | 00 00 00 00 00 00 FF FF FF FF FF FF 29 00 00 00 | ) 0000000000000050 | 31 30 46 38 36 32 37 38 00 00 00 00 00 00 00 00 | 10F86278 0000000000000060 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 39 33 33 39 38 35 34 33 00 00 00 00 00 00 00 00 | 93398543 +0000000000000080 | 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 00 | 11111111 0000000000000090 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | @@ -109,12 +109,12 @@ I 80820 2022-07-07 23:34:04 - [Commands] Received from C-2 (version=PC command=9 0000000000000010 | FF FF FF FF 29 00 00 00 00 01 00 00 00 00 00 00 | ) 0000000000000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 31 30 46 38 | 10F8 -0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 39 33 33 39 | 6278 9339 -0000000000000050 | 38 35 34 33 00 00 00 00 00 00 00 00 31 30 46 38 | 8543 10F8 +0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 31 31 31 31 | 6278 1111 +0000000000000050 | 31 31 31 31 00 00 00 00 00 00 00 00 31 30 46 38 | 1111 10F8 0000000000000060 | 36 32 37 38 00 00 00 00 00 00 00 00 00 00 00 00 | 6278 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 39 33 33 39 | 9339 -0000000000000090 | 38 35 34 33 00 00 00 00 00 00 00 00 00 00 00 00 | 8543 +0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 31 31 31 31 | 1111 +0000000000000090 | 31 31 31 31 00 00 00 00 00 00 00 00 00 00 00 00 | 1111 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 4B 61 6C 6C | Kall 00000000000000C0 | 65 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ea @@ -197,12 +197,12 @@ I 80820 2022-07-07 23:34:10 - [Commands] Received from C-3 (version=PC command=9 0000000000000010 | FF FF FF FF 29 00 00 00 00 01 00 00 00 00 00 00 | ) 0000000000000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 31 30 46 38 | 10F8 -0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 39 33 33 39 | 6278 9339 -0000000000000050 | 38 35 34 33 00 00 00 00 00 00 00 00 31 30 46 38 | 8543 10F8 +0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 31 31 31 31 | 6278 1111 +0000000000000050 | 31 31 31 31 00 00 00 00 00 00 00 00 31 30 46 38 | 1111 10F8 0000000000000060 | 36 32 37 38 00 00 00 00 00 00 00 00 00 00 00 00 | 6278 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 39 33 33 39 | 9339 -0000000000000090 | 38 35 34 33 00 00 00 00 00 00 00 00 00 00 00 00 | 8543 +0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 31 31 31 31 | 1111 +0000000000000090 | 31 31 31 31 00 00 00 00 00 00 00 00 00 00 00 00 | 1111 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 4B 61 6C 6C | Kall 00000000000000C0 | 65 61 00 00 00 00 00 00 00 00 00 00 | ea @@ -2093,12 +2093,12 @@ I 80820 2022-07-07 23:37:10 - [Commands] Received from C-4 (version=PC command=9 0000000000000000 | E0 00 9A 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000020 | 00 00 00 00 31 30 46 38 36 32 37 38 00 00 00 00 | 10F86278 -0000000000000030 | 00 00 00 00 39 33 33 39 38 35 34 33 00 00 00 00 | 93398543 +0000000000000030 | 00 00 00 00 31 31 31 31 31 31 31 31 00 00 00 00 | 11111111 0000000000000040 | 00 00 00 00 00 00 FF FF FF FF FF FF 29 00 00 00 | ) 0000000000000050 | 31 30 46 38 36 32 37 38 00 00 00 00 00 00 00 00 | 10F86278 0000000000000060 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 39 33 33 39 38 35 34 33 00 00 00 00 00 00 00 00 | 93398543 +0000000000000080 | 31 31 31 31 31 31 31 31 00 00 00 00 00 00 00 00 | 11111111 0000000000000090 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | @@ -2111,12 +2111,12 @@ I 80820 2022-07-07 23:37:10 - [Commands] Received from C-4 (version=PC command=9 0000000000000010 | FF FF FF FF 29 00 00 00 00 01 00 00 00 00 00 00 | ) 0000000000000020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 0000000000000030 | 00 00 00 00 00 00 00 00 00 00 00 00 31 30 46 38 | 10F8 -0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 39 33 33 39 | 6278 9339 -0000000000000050 | 38 35 34 33 00 00 00 00 00 00 00 00 31 30 46 38 | 8543 10F8 +0000000000000040 | 36 32 37 38 00 00 00 00 00 00 00 00 31 31 31 31 | 6278 1111 +0000000000000050 | 31 31 31 31 00 00 00 00 00 00 00 00 31 30 46 38 | 1111 10F8 0000000000000060 | 36 32 37 38 00 00 00 00 00 00 00 00 00 00 00 00 | 6278 0000000000000070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | -0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 39 33 33 39 | 9339 -0000000000000090 | 38 35 34 33 00 00 00 00 00 00 00 00 00 00 00 00 | 8543 +0000000000000080 | 00 00 00 00 00 00 00 00 00 00 00 00 31 31 31 31 | 1111 +0000000000000090 | 31 31 31 31 00 00 00 00 00 00 00 00 00 00 00 00 | 1111 00000000000000A0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | 00000000000000B0 | 00 00 00 00 00 00 00 00 00 00 00 00 4B 61 6C 6C | Kall 00000000000000C0 | 65 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ea