use debug

Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>
factor out hack_match

Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>