diff --git a/_DecVer.php b/_DecVer.php new file mode 100644 index 0000000..5d1e1e0 --- /dev/null +++ b/_DecVer.php @@ -0,0 +1,68 @@ +#!/usr/bin/env php +", $line, $match)){ + if(in_array($match[1], $gets)){ + echo " Detecting protocol version..."; + $linesCnt++; + $next = trim(fgets($is)); + if(preg_match('/[0-9a-f]+:[ \t]+([0-9a-f]+)/', $next, $matcha)){ + $data[$match[1]] = "0x$matcha[1]"; + echo " Detected 0x$matcha[1]"; + } + } + } +} + +echo "\rWriting to $OUTPUT"; +file_put_contents($OUTPUT, json_encode($data, JSON_UNESCAPED_SLASHES | JSON_BIGINT_AS_STRING | JSON_PRETTY_PRINT)); +echo PHP_EOL; +exit(0);