How can I extract a PDF file from an EXE?

5,257

Solution 1

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.

Solution 2

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.

Share:
5,257

Related videos on Youtube

pekka
Author by

pekka

Updated on September 18, 2022

Comments

  • pekka
    pekka over 1 year

    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.

    • Mokubai
      Mokubai over 7 years
      It 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?
    • Darius
      Darius over 7 years
      PeaZip, WinRar are other possible extracting applications. What would help is the maker of the exe name.
    • pekka
      pekka over 7 years
      it is a book and you can search through it
    • Daniel B
      Daniel B over 7 years
      That doesn't make it a PDF though.
    • pekka
      pekka over 7 years
      Thanks Darius but it didn't work
    • Dave
      Dave over 7 years
      How do you know it's a PDF? Does the "PDF" load in the application, or load in a seperate PDF viewer?
    • pekka
      pekka over 7 years
      it loads in the application
    • Mokubai
      Mokubai over 7 years
      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.
    • pekka
      pekka over 7 years
      I just provided the screenshots, thanks for your help
    • pekka
      pekka over 7 years
      I just provided the EXE book
    • thilina R
      thilina R over 7 years
      Where did you get this book from?
  • pekka
    pekka over 7 years
    I have the same problem as that one, any help. askubuntu.com/questions/311471/extract-documents-from-exe-fi‌​le
  • robyschek
    robyschek over 7 years
    @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:(
  • pekka
    pekka over 7 years
    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
  • Ramhound
    Ramhound over 7 years
    @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?
  • Daniel B
    Daniel B over 7 years
    This answer doesn’t really answer the question. It’s really just a rant about pirated ebooks or whatever.
  • dirkt
    dirkt over 7 years
    Funnily 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.