If you have a poor academic record, it is bound to have an impact on your chances to admitted to a good PhD program. But, in life, bad the things happen, sometimes due to life and sometimes due to mistakes.
If I tell you that it is impossible for you to get admission to a PhD program, would you stop trying? That would be one more mistake in your life.
There is no sweet answer to this. My master's supervisor once told me: "You judge yourself by what you think you could do and the world judges you by what you have done." I do not know if it is his own words or he quoted from somewhere.
Your job is to narrow this gap. You have a poor academic record. But what you could do is improve it by doing extra-curricular activities. Start a Github project and contribute to open source, particularly in the area in which you wish to do a PhD. Try to collaborate with academicians in your university and try to write research papers, preferably as the first author. Interact with industry over meetups. Keep track of research blogs and read recent papers.
Build your profile and forget your past record. If you do this properly, it might delay your admission but once you get it, your PhD could be a lot easier considering you already know what is a failure, literally. And you know how to succeed after failing.
Best of luck!