There are two places in the code you should look at. The PDF input plugin (ebooks/pdf/input.py)
and the heuristic processing code which IIRC is in ebooks/oeb/preprocess.py
Notice to all: I can not
provide assistance with DRM removal, for legal reasons, so please do not contact me about it.