Module: PWN::SDR::Decoder

Defined in:
lib/pwn/sdr/decoder.rb,
lib/pwn/sdr/decoder/apt.rb,
lib/pwn/sdr/decoder/dsp.rb,
lib/pwn/sdr/decoder/gps.rb,
lib/pwn/sdr/decoder/gsm.rb,
lib/pwn/sdr/decoder/lte.rb,
lib/pwn/sdr/decoder/p25.rb,
lib/pwn/sdr/decoder/rds.rb,
lib/pwn/sdr/decoder/adsb.rb,
lib/pwn/sdr/decoder/base.rb,
lib/pwn/sdr/decoder/dect.rb,
lib/pwn/sdr/decoder/flex.rb,
lib/pwn/sdr/decoder/lora.rb,
lib/pwn/sdr/decoder/rfid.rb,
lib/pwn/sdr/decoder/rtty.rb,
lib/pwn/sdr/decoder/wifi.rb,
lib/pwn/sdr/decoder/morse.rb,
lib/pwn/sdr/decoder/pager.rb,
lib/pwn/sdr/decoder/pocsag.rb,
lib/pwn/sdr/decoder/rtl433.rb,
lib/pwn/sdr/decoder/zigbee.rb,
lib/pwn/sdr/decoder/iridium.rb,
lib/pwn/sdr/decoder/bluetooth.rb

Overview

Decoder namespace for SDR signals. Every child module exposes a uniform .decode(freq_obj:) entry point (see PWN::SDR::Decoder::Base) so PWN::SDR::GQRX can dispatch on a decoder: key from PWN::SDR::FrequencyAllocation.band_plans.

100 % ruby-native — no decoder in this namespace shells out to an external binary. Three pipelines (Base):

run_native   — GQRX 48 kHz audio tap (POCSAG/FLEX/Morse/RTTY/APT/Pager)
run_iq       — true-air I/Q via PWN::FFI::{RTLSdr,AdalmPluto,HackRF}
             or a .cu8/.cs16 capture file; all modules use this when
             hardware/file is present (ADS-B fully slices Mode-S PPM)
run_detector — energy/burst characteriser fallback when no I/Q source

Defined Under Namespace

Modules: ADSB, APT, Base, Bluetooth, DECT, DSP, Flex, GPS, GSM, Iridium, LTE, LoRa, Morse, P25, POCSAG, Pager, RDS, RFID, RTL433, RTTY, WiFi, ZigBee

Constant Summary collapse

REGISTRY =

symbol → module map. Keys are what a band_plan's :decoder value (or PWN::SDR::GQRX.init_freq's decoder: kwarg) may be set to.

{
  adsb: :ADSB,
  apt: :APT,
  bluetooth: :Bluetooth,
  dect: :DECT,
  flex: :Flex,
  gprs: :GSM,
  gps: :GPS,
  gsm: :GSM,
  iridium: :Iridium,
  ism: :RTL433,
  keyfob: :RTL433,
  lora: :LoRa,
  lte: :LTE,
  morse: :Morse,
  p25: :P25,
  pager: :Pager,
  pocsag: :POCSAG,
  rds: :RDS,
  rfid: :RFID,
  rtl433: :RTL433,
  rtty: :RTTY,
  wifi: :WiFi,
  zigbee: :ZigBee
}.freeze

Class Method Summary collapse

Class Method Details

.authorsObject

Author(s)

0day Inc. support@0dayinc.com



87
88
89
# File 'lib/pwn/sdr/decoder.rb', line 87

public_class_method def self.authors
  "AUTHOR(S):\n  0day Inc. <support@0dayinc.com>\n"
end

.helpObject

Display a List of Every PWN::SDR::Decoder Module



93
94
95
# File 'lib/pwn/sdr/decoder.rb', line 93

public_class_method def self.help
  constants.sort
end

.resolve(opts = {}) ⇒ Object

Supported Method Parameters

mod = PWN::SDR::Decoder.resolve( decoder: 'required - Symbol/String key from REGISTRY (e.g. :pocsag)' )



77
78
79
80
81
82
83
# File 'lib/pwn/sdr/decoder.rb', line 77

public_class_method def self.resolve(opts = {})
  key = opts[:decoder].to_s.downcase.to_sym
  const = REGISTRY[key]
  raise "ERROR: Unknown decoder key #{key.inspect}. Supported: #{REGISTRY.keys.sort.join(', ')}" unless const

  const_get(const)
end