A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol
C arduinobluetoothcan-busdebuggingeepromesp32flipperzerogpiohardware-hackingi2cjtagopenocdprotocolspwmradiorfidspisubghzuartwifi
add method to parse hex list
Geo5368313fb997
diff --git a/src/Transformers/ArgTransformer.cpp b/src/Transformers/ArgTransformer.cppindex c4d80f82..85efc346 100644--- a/src/Transformers/ArgTransformer.cpp+++ b/src/Transformers/ArgTransformer.cpp@@ -35,6 +35,23 @@ std::vector<uint8_t> ArgTransformer::parseByteList(const std::string& input) conreturn bytes;}+std::vector<uint8_t> ArgTransformer::parseHexList(const std::string& input) const {+ std::vector<uint8_t> result;+ std::istringstream iss(input);+ std::string token;++ while (iss >> token) {+ try {+ // Convertir chaque token en uint8_t+ uint8_t value = static_cast<uint8_t>(std::stoul(token, nullptr, 16));+ result.push_back(value);+ } catch (...) {+ }+ }++ return result;+}+uint8_t ArgTransformer::parseHexOrDec(const std::string& str) const {if (str.empty()) return 0;diff --git a/src/Transformers/ArgTransformer.h b/src/Transformers/ArgTransformer.hindex 791188cd..1c57d1e6 100644--- a/src/Transformers/ArgTransformer.h+++ b/src/Transformers/ArgTransformer.h@@ -13,6 +13,7 @@class ArgTransformer {public:std::vector<uint8_t> parseByteList(const std::string& input) const;+ std::vector<uint8_t> parseHexList(const std::string& input) const;uint8_t parseByte(const std::string& str, int index = -1) const;uint8_t parseHexOrDec(const std::string& s) const ;uint16_t parseHexOrDec16(const std::string& str) const;