Hello all, I actually wrote a BAT script and I want to protect it and does not allow it to be modified or it's source being seen by other. I converted to EXE with many programs and tested it, everything was OK but the problem is when you run an EXE file which is converted from BAT file, it's complete source will be saved to User Temp folders. Although you can set it to remove after application closed, but while it's running, it's source can be reached easily. Is there anyway to make it protected or encrypted or any other way for running a BAT file without any readable Temp file? Thanks,
This is a problem I spotted more than once and researched at least for several days... I haven't found any workaround that more or less doesn't need 3rd party tools or in the end will become pretty messy (several wrappers, problems with working directory)
Try this P.S. Take a look at MSMG Toolkit, it was created with batch code, but when we try to view the code by putting it in notepad, the code is encrypted
Me, too. Compiled EXE does not run properly in my case, it opens and suddenly closes and can not use it. Other applications work fine, but it's source can easily be reached in temp folder. Any more ideas?
As I said I searched very very long on this topic but haven't found anything that satisfied my needs. Working with call, pipes <> and so on are always ending up in a mess. I haven't worked with recent http://www.abyssmedia.com/quickbfc/ but this application made at least less errors as all others I tested - but I don't remember if this also writes the source to temp. This programm works best for cmd 2 exe and is freeware, but it also exports the source to temp and the parsing of the working directory is not function correctly. http://www.f2ko.de/programs.php?lang=de&pid=b2e I know the idea is just to crypt the CMD but it seems you need a wrapper at all.
I remember that i found 2 command line tools that should work for the purpose but one of them was paid and didn't fit the requirements (deployment for several machines) as this needed license for every pc. The other one had pretty much complicated syntax and I wasn't able to get it running. Unfortunatly I forget both names... - I only remember that one of them had a very very simple website (white background, black text, no images). Both do basic encryption and work with a password. The resulting file than is your encrypted batch.
Why not design your own exe wrapper, but instead of %temp%, only decrypt it to a file.io.memorystream. Spoiler
ALL of the bat to exe programs use about the same compression with pkzip and upx to convert over to a .exe file, only problem is you get all kind of FP malware-virus alarms going off! See my simplebatch and then .exe below that I just converted with Advanced Bat to Exe to a .exe then ran a scan with virus total with 7 of 49 virus hits! DP Code: @echo off title DEMO BATCH FILE by: ~DosProbie echo Hello MDL Forum! This is a basic batch file for demonstration.. timeout /t 5 >nul SimpleBatch.cmd code above to .exe ==>http://www.datafilehost.com/d/27806628 https://www.virustotal.com/en/file/...0ec27e9b4ae3ee3e57dc007d/analysis/1392575846/
Sweet, What did you use to create to a .exe? Here is another lazy solution via Winrar==>https://copy.com/qVjpXXNZpaKk
nsis, now take look at test.bat with notepad after cmd has opened with winrar sfx leaves the bat file exposed after extraction. nsis sfx should not.
Here you go have fun as you can see once .bat file is loaded in memory we simply overwrite test.bat with useless bits. Code: batch.nsi: ; The name of the installer Name "test" SetCompressor "/SOLID" "lzma" SilentInstall "silent" SubCaption 2 " " ; The file to write OutFile "batch.exe" ; The default installation directory InstallDir $TEMP ; Request application privileges for Windows Vista RequestExecutionLevel admin XPStyle on Dirtext "extacting files...." ;-------------------------------- ; Pages Page directory Page instfiles ;-------------------------------- ; The stuff to install Section "" ;No components page, name is not important SetOutPath $TEMP File "test.bat" ExecShell "open" "$TEMP\test.bat" "SW_SHOWNORMAL" FindWindow $1 "ConsoleWindowClass" IntCmp $1 0 fail ok ok fail: Goto -2 ok: sleep "2000" ClearErrors FileOpen $0 "$TEMP\test.bat" w IfErrors done FileWrite $0 "F<=?@<?@B>D<??>@B>DCDF?=<F@EBFAC@>>ACAD=B=?@F@@AECC>EAACDFF=D?@?>EF=EB>@=ADDA@C?@FDCC<?FE=@<<F<C@>FDBEC<CE<ECEAA@<AACC<A<@=ECDE><AF?@D=E?A" FileClose $0 done: SectionEnd ; end the section