How to get my data off of my old iPhone?

I have an old iPhone 4 and I need to get all of my pictures and messages off. However, I forgot the passcode and I can't find a software that will rip off the data I want without having the phone unlocked. IS THERE ANY WAY?

Simple; look for the trash can icon, or the word "Delete" on your pictures and messages.

If you plug it in to your computer go to iTunes and there's a restore button that deletes EVERYTHING and restores it to factory settings as if you just took it out of the box.