Sirius Black gave Harry Potter a magical penknife for Christmas in 1994. It had attachments designed to open any lock and untie any knot, even if they have been protected against Alohomora or similar spells. To use the device to open a locked door, one inserted its blade into the crack between door and doorframe, then slide it up and down. However, there are some doors that cannot be opened by this knife, such as the door to the Love Chamber in the Department of Mysteries. That particular lock caused the blade to melt.
1994-1995 school year
During the Second Task of the Triwizard Tournament, Harry was required to free a hostage bound to a statue in the Merpeople village in Black Lake, and he regretted not bringing Sirius' knife with him. He was forced to make do with a sharp rock.
1995-1996 school year
In the Department of Mysteries, Harry tried to use the knife to open the door to the Love Chamber, but the blade melted. It is not known whether he ever managed to have it repaired, although it may have had multiple blades among its "attachments." In any case, following the failed attempt to unlock the door, he placed the "now-useless" handle of the knife in his pocket.