Convert back from executable to Powershell script

May 31, 2013 at 11:26 AM
Hi,

I have lost original powershell script and need to convert back the executable to powershell script.

Is this possible?

Regards,
Paresh
Coordinator
May 31, 2013 at 11:37 AM
Hi!

No problem! You could you the -extract parameter! - There are other ways too...

Ingo
May 31, 2013 at 11:47 AM
Hi,

Thanks for quick reply. May I get the syntax for -extract parameter? I cant see it in help as well.

I tried following and it didn't work.

ps2exe.ps1 -inputfile 'path to exe' -outputfile 'path to ps1' -extract

Paresh
May 31, 2013 at 12:24 PM
NM. I've got it from the home page.

It was executable.exe -extract:"Filename.ps1"

Thanks.
Apr 29, 2014 at 4:50 PM
ikarstein wrote:
Hi!

No problem! You could you the -extract parameter! - There are other ways too...

Ingo
Hey, great script - very useful!

I've got an exe created with this that needs modification, but when i use the -extract parameter, it is ignored.

What are the other ways I can get my script extracted then back up and running without rewriting it from scratch?
Coordinator
Apr 29, 2014 at 6:20 PM
Hi!

You can open the EXE file in ILSpy and look for the Base64-Encoded string. This string you can decode using an online tool or PowerShell.

Does it work?

Regards
Ingo
Jun 19, 2014 at 2:18 PM
Hi,

is there a way to disable the -extract parameter?

is there a way to avoid any attempt to get the code?

Thanks!
Leo
Coordinator
Jun 19, 2014 at 9:33 PM
Hi!

It is easy to remove the the code for "-extract" so that the parameter will do nothing!!

Regards
Ingo
Jun 20, 2014 at 9:05 AM
Ok, it worked as I disabled "-extract" in the code. Thanks!

Then I tryed to understand how to use ILSPY 2.1 and get "Base64-Encoded string" as you suggested in a previous post but I couldn't manage to find this string. Please, could I have a little help?

Thank You!
Leo
Apr 1, 2015 at 5:59 PM
Someone has successfully extract information using the ILSpy ??
Apr 1, 2015 at 6:28 PM
The executable is not safe.
I succeeded to extract the files using 7-zip and open the extracted .text file. Within this file contained the base64 code that was easily reversed.
Apr 1, 2015 at 6:29 PM
ikarstein wrote:
Hi!

You can open the EXE file in ILSpy and look for the Base64-Encoded string. This string you can decode using an online tool or PowerShell.

Does it work?

Regards
Ingo
Yes, It Works.