mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
fix: Editing binary value in data inspector not working correctly
Fixes #941
This commit is contained in:
@@ -139,16 +139,15 @@ namespace hex::plugin::builtin {
|
||||
ImGui::TextUnformatted(binary.c_str());
|
||||
return binary;
|
||||
};
|
||||
}, [](const std::string &value, std::endian endian) -> std::vector<u8> {
|
||||
}, [](std::string value, std::endian endian) -> std::vector<u8> {
|
||||
hex::unused(endian);
|
||||
|
||||
std::string copy = value;
|
||||
if (copy.starts_with("0b"))
|
||||
copy = copy.substr(2);
|
||||
if (value.starts_with("0b"))
|
||||
value = value.substr(2);
|
||||
|
||||
if (value.size() > 8) return { };
|
||||
u8 byte = 0x00;
|
||||
for (char c : copy) {
|
||||
for (char c : value) {
|
||||
byte <<= 1;
|
||||
|
||||
if (c == '1')
|
||||
|
||||
Reference in New Issue
Block a user