The flag code isn’t about legality. It is considered improper to fly the flag different ways but they aren’t illegal. So yes, the 1st amendment of the constitution would mean you could fly the flag however you wished without being arrested. That doesn’t mean someone won’t punch you over it though
The majority of hacking is this right here.