Skip to content

Instantly share code, notes, and snippets.

@Nerahikada
Created April 4, 2024 09:34
Show Gist options
  • Save Nerahikada/e0b39e57a2ea30408319e2334f0d8755 to your computer and use it in GitHub Desktop.
Save Nerahikada/e0b39e57a2ea30408319e2334f0d8755 to your computer and use it in GitHub Desktop.
Simple PHP script to convert Flipper Zero nfc files to binary data
<?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