It's a lot of work to delouse your installation. Step #1 really is to make a full backup of how it is now and put that backup somewhere safe.
Make sure your PC is clean, change all of your passwords, make that backup, and start reading up on those links. They'll help you get out of yourself out of this mess.
Is there a way to reinstall wordpress without losing my pages, posts?
Make that full backup. Just reinstalling the software only will not harm your existing posts, pages, and comments.
If your database isn't compromised then your posts and pages are good. But you really need to check the data, once you've been hacked its really straight forward for a bad guy to insert things into that database such as admins, exploit code, etc.