From b04bd5fa746ef37f4b26eeafe3fd31a6050edfe9 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 12 Apr 2022 09:26:05 +0200 Subject: [PATCH] patch_manager: check if address has hex format --- Utilities/bin_patch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Utilities/bin_patch.cpp b/Utilities/bin_patch.cpp index 7a6516bd6c..b61ee7a3d7 100644 --- a/Utilities/bin_patch.cpp +++ b/Utilities/bin_patch.cpp @@ -464,6 +464,13 @@ bool patch_engine::add_patch_data(YAML::Node node, patch_info& info, u32 modifie return false; } + if (!addr_node.Scalar().starts_with("0x")) + { + append_log_message(log_messages, fmt::format("Skipping patch node %s. Address element has wrong format %s. (key: %s, location: %s)", info.description, addr_node.Scalar(), info.hash, get_yaml_node_location(node))); + patch_log.error("Skipping patch node %s. Address element has wrong format %s. (key: %s, location: %s)", info.description, addr_node.Scalar(), info.hash, get_yaml_node_location(node)); + return false; + } + struct patch_data p_data{}; p_data.type = type; p_data.offset = addr_node.as(0) + modifier;