How can I extract a PDF file from an EXE?

1

I have a book which is inside EXE, how can I extract the PDF file from EXE?

This is the book that is in EXE: https://drive.google.com/open?id=0B6qvDUQA_4lscGR3OVZFQ05mTHM

Here are the screenshots, I want this book to be unpacked inside the EXE so I could read it on any device.

enter image description here

enter image description here

Universal Extractor contains a virus, and 7-zip doesn't do the job.

pekka

Posted 2016-10-06T06:09:24.807

Reputation: 21

2It is entirely possible that whatever file you have has the data stored in some proprietary format specific to the people who made it. How exactly do you know that there is a PDF involved? – Mokubai – 2016-10-06T06:24:11.733

1PeaZip, WinRar are other possible extracting applications. What would help is the maker of the exe name. – Darius – 2016-10-06T06:30:19.983

it is a book and you can search through it – pekka – 2016-10-06T06:30:33.580

3That doesn't make it a PDF though. – Daniel B – 2016-10-06T06:33:53.613

Thanks Darius but it didn't work – pekka – 2016-10-06T06:40:00.397

How do you know it's a PDF? Does the "PDF" load in the application, or load in a seperate PDF viewer? – Dave – 2016-10-06T10:56:33.957

it loads in the application – pekka – 2016-10-06T11:39:52.663

Without knowing what created this exe, or where you got it from or even just see a screenshot of this application it is impossible to say how to extract data from it. It might be a PDF file, but it could just as easily be any number of other PDF-like formats or some other format. Executables can be simple compressed archives that extract and run an executable all the way up to self-contained encrypted containers and viewers that leave nothing behind. – Mokubai – 2016-10-06T12:27:45.023

I just provided the screenshots, thanks for your help – pekka – 2016-10-06T12:30:55.087

I just provided the EXE book – pekka – 2016-10-06T13:29:58.727

Where did you get this book from? – thilina R – 2016-10-06T17:51:19.133

Answers

5

Your EXE file doesn't contain a PDF, it contains a standalone flash player. I could tell this by making an educated guess after opening it up a resource viewer and could see references to flash/flash player:

enter image description here

The pages are individual SWF (flash) resource files. To extract them, you can use this tool:

http://swftools.sourceforge.net/exe-to-swf.html

That will give you an individual flash file for each page, plus a few more for the controls/prompts within the embedded flash player, which can be deleted. I was able to do this pretty quickly with your executable:

enter image description here

You'll then have to convert the first frame from each SWF file to an image (like a jpg or png) at a given resolution, order them correctly by page number then compile them into a PDF.

The only batch SWF to image software I could find is payware here:

http://www.verypdf.com/flash-to-image/swf-to-jpg-converter.html

Once you have individual page images, you're home free and can use software or an online service to compile them all together in a PDF. An example is here:

http://www.convert-jpg-to-pdf.net/


I would recommend doing all of this in a virtual machine: VirusTotal came back with a few hits on this file.

I also wouldn't recommend doing it at all if this book is under any copyright. I would recommend checking your local laws to make sure duplicating it isn't illegal in any way. I'm not responsible for misuse of these instructions.

Moses

Posted 2016-10-06T06:09:24.807

Reputation: 10 813

1Funnily enough, the EXE also contains references to a PDF library, together with a number of CMAPs in the win resources (though I couldn't find actual PDF pages). It also contains references to Borland Delphi. :-) So maybe the the flash content is not all there is. – dirkt – 2016-10-07T08:06:14.850

3

These exes you download from various darker corners of the internet often doesn't have the pdf (or whatever) embedded in it at all. The pdf will be downloaded by the exe when you run it. If you are lucky the pdf will be the only thing the exe will download. Other stuff may include:

  • a virus
  • an adware
  • a super new web browser you never heard about before (adware

If I're realy need that pdf, I'd try to run the exe in a virtual machine like VirtualBox, let the exe download all it wants, pick the pdf and then reset the machine.

robyschek

Posted 2016-10-06T06:09:24.807

Reputation: 354

I have the same problem as that one, any help. http://askubuntu.com/questions/311471/extract-documents-from-exe-file

– pekka – 2016-10-06T08:23:16.893

2

@pekka Sorry for suspecting in piracy. If the exe is from trusted source and you are on windows why not just run it? If you are on linux how you supposed to run UniversalUnpacker? 7zip inability to open this exe probably means that the pdf is packed in a custom way to protect from copying, and the only way to extract it is to revese engineer it. Can't help, sorry again:(

– robyschek – 2016-10-06T08:50:52.720

I am on windows but I want to read the book on my iPad. the person in the other thread said that he managed to get the PDF by using some sort of thing but I didn't understand – pekka – 2016-10-06T09:01:12.923

@pekka - If you wanted to view the book on the iPad why did you purchase or download the book that makes that difficult. Is the book not avaible in another format from say Amazon or the iOS Book Store? – Ramhound – 2016-10-06T17:10:39.163

This answer doesn’t really answer the question. It’s really just a rant about pirated ebooks or whatever. – Daniel B – 2016-10-06T17:16:57.813