How can I filter packet by matching binary content?

I want to drop some incoming UDP packet by matching binary content
e.g. \x00\x00

How can I do that?

I only found two ways to filter the packet

  1. filter content rule.
    this only match simple fixed data (\x00 is not working)
  2. L7 protocol
    cannot match \x00 and case insensitive

If I can create an dedicated firewall facility, where should I insert into?
Lan <===> 3 ADSL by PPPoE

if I put the firewall under lan port, the router will not get protected.
if I put the firewall under wan port, the firewall cannot understand pppoe.