How to know if my iOS contains pirated contents
I'm not a lawyer but I doubt you will have an issue here. After all a pirated eBook looks rather the same as a bought one (same for other media). 

Having said that the only way possible is to open each and every app and check the content stored there. If you want to be really thorough you also may want to check old mails etc.