Forgot the firmware password that you recently setup on your Mac? Look no further. The king of OS X himself, Topher Kessler posted an article on how to crack Mac firmware passwords using Apple’s stock Calculator (assuming you have admin access). However, if you don’t feel like reading so much, you can simply copy and paste this Python script created by davidwtbuxton (and edited by Kessler) into Terminal and it’ll do all the work for you:
python -c "print ''.join(chr(int(c, 16) ^ 170) for c in '`sudo nvram security-password`'.split('%')[1:])"