i think 90 untill 90 days its legal, even on transit visa? plus if 90 days period is legal, can I apply for work permit if able to find some employer to hire me as a software engineer in quebec, as I know in quebec 2173, 2174 are exempted for LMIA
You just seem desperate to stay in Canada.
For what you've shared your chances of doing so in the country are almost null. Even if you haven't yet overstayed, if you're planning to get a study permit or even work permit you have no time to do so while you are still in Canada and the clock is ticking. Once you have overstayed, the doors will be closed for you.
Honestly, and I am doing you a favor by saying this, go home, do some research and plan to either get a study permit (apply to a DLI --> apply for permit --> come to Canada --> go back or get a PGWP) or get a work permit (find an employer --> get a permit)
These two processes are usually lengthy, several months at least. Not something you can do with such limited time and improper planning. You will most certainly not even be able to get all the supporting documents you will need to go either way.
Just go home, and plan.