proverb

Necessity knows no law.

necessity

used to say that

If someone is in great need of something, he will do everything, he will even break the law in order to get it.