tsdecrypt reads and decrypts CSA encrypted incoming mpeg transport stream over UDP/RTP using code words obtained from OSCAM or similar CAM server. tsdecrypt communicates with CAM server using cs378x (camd35 over tcp) protocol or newcamd protocol. https://georgi.unixsol.org/programs/tsdecrypt/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FILTERING 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. tsdecrypt EMM filtering support
  2. ===============================
  3. tsdecrypt have no specific knowledge about EMMs of each of the
  4. supported CA systems. This allows tsdecrypt to work even when
  5. the CA system is unknown. It just sends the EMM/ECM streams to the
  6. CAMD server for processing and filtering. The lack of specific
  7. knowledge about each of the supported CA systems is a feature.
  8. However there are cases where limiting the number of EMMs that
  9. reach CAMD is a must have feature. Since there is no code in
  10. tsdecrypt to detect whether the EMM type is GLOBAL, SHARED,
  11. UNIQUE, there is no detection of provider IDs, channel IDs or
  12. card numbers a simpler approach to filtering was implemented.
  13. The basic idea was implemented by Julian Gardner in his emm-buffer-mask
  14. patches. These patches were never merged in tsdecrypt but they
  15. inspired the current filtering implementation.
  16. tsdecrypt's EMM filters describe whether EMM should be processed
  17. or not based on an offset and data bytes that are compared with the
  18. incoming EMM.
  19. The option responsible for defining EMM filters is --emm-filter (-a)
  20. followed by the filter definition. Up to 16 filters can be defined.
  21. Filter definitions
  22. ==================
  23. Filter definition contain command and command settings. The command
  24. and the settings are separated by / (forward slash) symbol, the
  25. settings are separated by ^ symbol.
  26. Command Settings
  27. ------- --------
  28. command[/setting1=abc,setting2=xyz...]
  29. Since filter definitions are passed as command line parameters, you must
  30. ensure that they are enclosed in quotes if they contain spaces.
  31. Filter commands
  32. ===============
  33. Currently defined commands are:
  34. accept_all - Set the default to allow all EMMs to reach CAMD except
  35. EMMs that match "reject" command.
  36. When no "accept_all" or "reject_all" commands were used it
  37. is assumed that "accept_all" was the first command.
  38. reject_all - Set the default to skip all EMMs except those that
  39. are accepted by "accept" command.
  40. * Both "accept_all" and "reject_all" can be used without command settings.
  41. accept - This command instructs tsdecrypt to allow EMM that matches
  42. the definition to be processed.
  43. reject - This command instructs tsdecrypt to skip EMM that matches
  44. the definition to be processed.
  45. * Both commands must have at least two settings (offset and data).
  46. Filter settings
  47. ===============
  48. Currently defined command settings are:
  49. * name=X - Sets the filter name (used when displaying filters).
  50. The name can not be longer than 32 symbols.
  51. * offset=X - Sets the offset at which data bytes would be checked
  52. against EMM. The default offset is 0.
  53. * data=XX YY ZZ - Data bytes are series of hex numbers separated by
  54. space " " or dot ".". When data bytes are processed 0x
  55. prefix is removed from them. The maximum data bytes is 16.
  56. Filter processing
  57. =================
  58. Filters are processed one by one until "accept" or "reject" filter matches.
  59. If no "accept" or "reject" filters match, then the default match determined
  60. by "accept_all" or "reject_all" is returned.
  61. Example filters
  62. ===============
  63. Bulcrypt white list example:
  64. Accept all EMMs except those starting with 8a 70 b4, 8b 70 b4, 8c or 8d.
  65. tsdecrypt ... \
  66. --emm-filter accept_all \
  67. --emm-filter "reject/name=Bulcrypt_unknown_EMMs,offset=0,data=8a 70 b4" \
  68. --emm-filter "reject/name=Bulcrypt_unknown_EMMs,offset=0,data=8b 70 b4" \
  69. --emm-filter "reject/name=Some EMM,data=0x8c" \
  70. --emm-filter reject/data=0x8d \
  71. Bulcrypt black list example:
  72. Reject all EMMs that don't start with 82, 84 or 85.
  73. tsdecrypt ... \
  74. --emm-filter reject_all \
  75. --emm-filter accept/name=Bulcrypt_EMMs,offset=0,data=82 \
  76. --emm-filter accept/name=Bulcrypt_EMMs,data=84 \
  77. --emm-filter accept/name=Bulcrypt_EMMs,data=85 \
  78. Example combination that builds white/black list.
  79. Accept EMMs that start with 8a and 8b also accept EMMs which have
  80. 70 b4 at offset 1, and reject everything else.
  81. tsdecrypt ... \
  82. --emm-filter accept_all \
  83. --emm-filter reject/name=Bulcrypt_unknown_EMMs,data=8a \
  84. --emm-filter reject/name=Bulcrypt_unknown_EMMs,data=8b \
  85. --emm-filter reject_all \
  86. --emm-filter "accept/name=Bulcrypt_EMMs_with_correct_size,offset=1,data=70 b4" \