Skip to content

Instantly share code, notes, and snippets.

@versionsix
Created December 21, 2023 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save versionsix/97a4389661546d973bd44df88b85636d to your computer and use it in GitHub Desktop.
Save versionsix/97a4389661546d973bd44df88b85636d to your computer and use it in GitHub Desktop.
PM3 <> flipper RfidRecord
from flipper_raw_rfid.rifl import Rifl
from flipper_raw_rfid.utils import batched, pad_to_signal, signal_to_pad, autocorrelate, smooth, binarize, find_first_transition_index, find_peaks, histogram, smooth, binarize
from flipper_raw_rfid.bits import decode_lengths, decode_manchester, decode_em_4100, to_str
from matplotlib import pyplot as plt
from scipy import signal as scipy_signal
import numpy as np
import numpy
import sys
rifl = Rifl.load('Red354b.ask.raw')
pad = rifl.pulse_and_durations
# Convert it into something more usable (vector of 0 and 1)
signal = pad_to_signal(pad)
with open("sig-Red354b.ask.div8", "w") as txt_file:
for line in signal[::8]:
txt_file.write(str(line) + "\n")
usb] pm3 --> data load -f sig-Red354b.ask.div8.trim
[+] loaded 31000 samples
[usb] pm3 --> data convertbitstream
[usb] pm3 --> data rawdemod --ar
[+] ASK/Raw - clock 32 - decoded bitstream
[=] ----------------------------------------
[+] DemodBuffer:
[+] 00110101010011001100101011001010
[+] 10101010101011001100110100101101
[+] 01010101010101010101001101001100
[+] 10101011010011010010101011001011
[+] 00110101010011001100101011001010
[+] 10101010101011001100110100101101
[+] 01010101010101010101001101001100
[+] 10101011010011010010101011001011
[+] 00110101010011001100101011001010
[+] 10101010101011001100110100101101
[+] 01010101010101010101001101001100
[+] 10101011010011010010101011001011
[+] 00110101010011001100101011001010
[+] 10101010101011001100110100101101
[+] 01010101010101010101001101001100
[+] 10101011010011010010101011001011
[usb] pm3 --> data print --hex
[+] DemodBuffer:
[+] 354CCACAAAACCD2D5555534CAB4D2ACB354CCACAAAACCD2D5555534CAB4D2ACB354CCACAAAACCD2D5555534CAB4D2ACB354CCACAAAACCD2D5555534CAB4D2ACB
[usb] pm3 --> lf em 410x demod
[+] EM 410x ID 56009F4EA2
[+] EM410x ( RF/64 )
[=] -------- Possible de-scramble patterns ---------
[+] Unique TAG ID : 6A00F97245
[=] HoneyWell IdentKey
[+] DEZ 8 : 10440354
[+] DEZ 10 : 0010440354
[+] DEZ 5.5 : 00159.20130
[+] DEZ 3.5A : 086.20130
[+] DEZ 3.5B : 000.20130
[+] DEZ 3.5C : 159.20130
[+] DEZ 14/IK2 : 00369377627810
[+] DEZ 15/IK3 : 000455282881093
[+] DEZ 20/ZK : 06100000150907020405
[=]
[+] Other : 20130_159_10440354
[+] Pattern Paxton : 1454607522 [0x56B38CA2]
[+] Pattern 1 : 7309541 [0x6F88E5]
[+] Pattern Sebury : 20130 31 2051746 [0x4EA2 0x1F 0x1F4EA2]
[+] VD / ID : 086 / 0010440354
[=] ------------------------------------------------
[usb] pm3 --> data print --hex
[+] DemodBuffer:
[+] FFA98004BC9ED0AEFFA98004BC9ED0AE
[usb] pm3 --> lf simask --clk 64 --am -d FFA98004BC9ED0AEFFA98004BC9ED0AE
[=] Press <Enter> or pm3-button to abort simulation
[#] ASK simulating with rf/64, invert 0, encoding ASK/MAN (1), separator 0, n 8704
NOTE: last nibble (0x0B) missing on purpose. Doesn't work otherwise
[usb] pm3 --> lf simask --clk 64 --ar -d 354CCACAAAACCD2D5555534CAB4D2ACB354CCACAAAACCD2D5555534CAB4D2AC
[=] Press <Enter> or pm3-button to abort simulation
[#] ASK simulating with rf/32, invert 0, encoding RAW/MAN (0), separator 0, n 16384
[usb] pm3 --> lf em 410x sim --clk 64 --id 56009F4EA2
[+] Starting simulating EM Tag ID 56009F4EA2 clock: 64
[=] ............
[=] Press <Enter> or pm3-button to abort simulation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment