Created
April 4, 2024 09:34
-
-
Save Nerahikada/e0b39e57a2ea30408319e2334f0d8755 to your computer and use it in GitHub Desktop.
Simple PHP script to convert Flipper Zero nfc files to binary data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
foreach (glob('*.nfc') as $filename) { | |
$blocks = array_filter(yaml_parse_file($filename), fn (string $key) => str_starts_with($key, 'Block '), ARRAY_FILTER_USE_KEY); | |
ksort($blocks, SORT_NATURAL); | |
file_put_contents("$filename.bin", hex2bin(str_replace(' ', '', implode('', $blocks)))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment