Add BPS patch utility functions and integrate into CLI handlers

This commit is contained in:
scawful
2025-01-19 18:46:56 -05:00
parent 80b84caca8
commit 38d34fd40c
11 changed files with 257 additions and 213 deletions

View File

@@ -2,6 +2,8 @@
#include "asar-dll-bindings/c/asar.h"
#include "util/bps.h"
namespace yaze {
namespace cli {
@@ -17,7 +19,7 @@ absl::Status ApplyPatch::handle(const std::vector<std::string>& arg_vec) {
// Apply patch
std::vector<uint8_t> patched;
core::ApplyBpsPatch(source, patch, patched);
util::ApplyBpsPatch(source, patch, patched);
// Save patched file
std::ofstream patched_rom("patched.sfc", std::ios::binary);
@@ -50,7 +52,7 @@ absl::Status CreatePatch::handle(const std::vector<std::string>& arg_vec) {
std::vector<uint8_t> target;
std::vector<uint8_t> patch;
// Create patch
core::CreateBpsPatch(source, target, patch);
util::CreateBpsPatch(source, target, patch);
// Save patch to file
// std::ofstream patchFile("patch.bps", ios::binary);