Unpacking digital book formats is pretty straightforward with Calibre and similar tools.
There is a very large number of freely-available books through Library Genesis and other sites, approaching 5 million. Some are newer, but I find this most useful for turning up old and hard-to-find books, generally published between 1925 and 2000.
More recent books are frequently available in ripped digital formats. Earlier can be found through the Internet Archive, WikiSource, and Project Gutenberg. A large number of the scanned-in books are actually very likely out of copyright due to failures to renew registration, but the fact cannot readily be determined.
There's a project that's taken machine-readable US Copyright Office records to find such works. The Internet Archive don't yet make use of this though per an email discussion a week or so back, that's in the works, though no announcement or dates have yet been made.
What's tremendously frustrating to me is the HathiTrust archive, which has access to scanned copies of library works, but won't make these generally available to either the general public or anything outside a small set of research libraries (your local public library, or even community college or small liberal arts school doesn't qualify). Again, frequently works that are out of copyright (known-public-domain works cannot be viewed or downloaded), hoarded for no reason.