Dobby is the house elf in the series of books, Harry Potter. Perhaps Pseudo's write-up gives some insight on how to predict what Dobby was doing for Harry in Harry Potter and the Chamber of Secrets (This word being slang for good, J.K. Rowling being knowledgable enough to give hints by this form). You would have at first thought Dobby to be evil, preventing Harry from getting to school, calling the Dementors on him at his Quidditch games, in general, being a huge pain in the ass for him.

He was owned by the Malfoy family but after Lucius Malfoy gave him a sock in The Chamber of Secrets, Dobby was free again. Later in Harry Potter and The Goblet of Fire, Dobby is seen working at Hogwart's in the kitchen.