Sirius Black gave Harry Potter a magicalpenknife 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.
On two occasions during his fifth year, Harry used the knife to break into Dolores Umbridge's office, as all other fireplaces but hers were being watched, and he desperately wanted to contact Sirius.
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.