批量+ JScript到.exe

时间:2017-02-25 10:35:51

标签: windows batch-file jscript jscript.net

我有一个包含一些JScript的批处理文件,但我想将其转换为.exe,因此其他人无法看到该脚本(已加密

我该怎么做?

我尝试使用 Bat to Exe ,但由于我JScript,因此无法正常工作。

代码基本上是启动一个站点并输入关键输入,.exe设法启动该站点,但那就是

脚本:

@if (@CodeSection == @Batch) @then

@echo off

title Top Top
color 0c

if "%inputParty%" == "0" (
  set title= %site% - Bean - Partyless
)

set /p site= Site: 
set /p Clas= Username or Email: 
set /p Party= Party: 
set /p Cars= Cars: 
set /p capture= Capture: 

set inputsite= Site: %site%
set inputClas= Clas: UNKNOWN
set inputParty= Party: %Party%
set inputCars= Cars: %Cars%
set inputcapture= Capture: %capture%
set inputhide= [hide] *Bean* [/hide] 


if "%Clas%" == "Username" (
  set inputClas= Clas: Username:Password
)

if "%Clas%" == "Email" (
  set inputClas= Clas: Email:Password
)

if "%Clas%" == "username" (
  set inputClas= Clas: Username:Password
)

if "%Clas%" == "email" (
  set inputClas= Clas: Email:Password
)


set title= %site% - Bean
if "%Party%" == "0" (
  set title= %site% - Bean - Partyless
)

set SendKeys=CScript //nologo //E:JScript "%~F0"
START https://Cear.io/xxxxx.php?fid=30
timeout /t 5

:: ACCESS TITLE INPUT BOX
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"

:: INPUT TITLE
%SendKeys% "%title%"

:: REDIRECT INPUT TO DESCRIPTION
%SendKeys% "{TAB}"

:: INPUT DESCRIPTION
%SendKeys% "%inputsite%"
%SendKeys% "{ENTER}"
%SendKeys% "%inputClas%"
%SendKeys% "{ENTER}"
%SendKeys% "%inputParty%"
%SendKeys% "{ENTER}"
%SendKeys% "%inputCars%"
%SendKeys% "{ENTER}"
%SendKeys% "%inputcapture%"
%SendKeys% "{ENTER}"
%SendKeys% "{ENTER}"
%SendKeys% "%inputhide%"

if "%Party%"=="0" (goto prefix)
ELSE (
    goto end
)

:prefix 

:: INPUT PREFIX
set x= 20
for /L %%A in (1,1,%x%) do (
    %SendKeys% "{TAB}"
)
    %SendKeys% "{DOWN}"

:end 

goto :EOF


@end
// JScript section

var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

输出:

enter image description here

2 个答案:

答案 0 :(得分:0)

Hybrid JSBatch文件基本上是'hack',如果编译,则无法按预期工作。
尝试使用Bat to Exe Converter

中的“ f2ko.de

如果你使用程序的“扩展命令”来输入键盘键,那么代替使用混合JSBatch会更容易。

示例脚本

@echo off
start notepad.exe
timeout 3 >nul
%extd% /sendkeys "Hello World"

您的脚本(已修改)

@echo off


title Top Top
color 0c

if "%inputParty%" == "0" (
  set title= %site% - Bean - Partyless
)


set /p site= Site: 
set /p Clas= Username or Email: 
set /p Party= Party: 
set /p Cars= Cars: 
set /p capture= Capture: 

set inputsite= Site: %site%
set inputClas= Clas: UNKNOWN
set inputParty= Party: %Party%
set inputCars= Cars: %Cars%
set inputcapture= Capture: %capture%
set inputhide= [hide] *Bean* [/hide] 


if "%Clas%" == "Username" (
  set inputClas= Clas: Username:Password
)

if "%Clas%" == "Email" (
  set inputClas= Clas: Email:Password
)

if "%Clas%" == "username" (
  set inputClas= Clas: Username:Password
)

if "%Clas%" == "email" (
  set inputClas= Clas: Email:Password
)



set title= %site% - Bean
if "%Party%" == "0" (
  set title= %site% - Bean - Partyless
)

START https://Cear.io/xxxxx.php?fid=30
timeout /t 5

:: ACCESS TITLE INPUT BOX
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}
%extd% /sendkey {TAB}

:: INPUT TITLE
%extd% /sendkeys "%title%"

:: REDIRECT INPUT TO DESCRIPTION
%extd% /sendkey {TAB}


:: INPUT DESCRIPTION
%extd% /sendkeys "%inputsite%"
%extd% /sendkey {ENTER}
%extd% /sendkeys "%inputClas%"
%extd% /sendkey {ENTER}
%extd% /sendkeys "%inputParty%"
%extd% /sendkey {ENTER}
%extd% /sendkeys "%inputCars%"
%extd% /sendkey {ENTER}
%extd% /sendkeys "%inputcapture%"
%extd% /sendkey {ENTER}
%extd% /sendkey {ENTER}
%extd% /sendkeys "%inputhide%"

if "%Party%"=="0" (goto prefix)
ELSE (
goto end
)


:prefix 
:: INPUT PREFIX
set x= 20
for /L %%A in (1,1,%x%) do (
%extd% /sendkey {TAB}
)
%extd% /sendkey {DOWN}

:end 
goto :EOF

答案 1 :(得分:0)

尽管在所有情况下将.bat转换为.exe都是个坏主意,但这种方法可以解决您的问题:

@echo off

title Top Top
color 0c

if "%inputParty%" == "0" (
   set title= %site% - Bean - Partyless
)


set /p site= Site: 
set /p Clas= Username or Email: 
set /p Party= Party: 
set /p Cars= Cars: 
set /p capture= Capture: 

set inputsite= Site: %site%
set inputClas= Clas: UNKNOWN
set inputParty= Party: %Party%
set inputCars= Cars: %Cars%
set inputcapture= Capture: %capture%
set inputhide= [hide] *Bean* [/hide] 


if /I "%Clas%" == "Username" (
   set inputClas= Clas: Username:Password
)

if /I "%Clas%" == "Email" (
   set inputClas= Clas: Email:Password
)


set title= %site% - Bean
if "%Party%" == "0" (
   set title= %site% - Bean - Partyless
)


rem // JScript section

echo var WshShell = WScript.CreateObject("WScript.Shell"); > SendKeys.js
echo WshShell.SendKeys(WScript.Arguments(0)); >> SendKeys.js

set SendKeys=CScript //nologo SendKeys.js
START https://Cear.io/xxxxx.php?fid=30
timeout /t 5

:: ACCESS TITLE INPUT BOX
for /L %%i in (1,1,14) do %SendKeys% "{TAB}"

:: INPUT TITLE
%SendKeys% "%title%"

:: REDIRECT INPUT TO DESCRIPTION
%SendKeys% "{TAB}"

:: INPUT DESCRIPTION
%SendKeys% "%inputsite%{ENTER}"
%SendKeys% "%inputClas%{ENTER}"
%SendKeys% "%inputParty%{ENTER}"
%SendKeys% "%inputCars%{ENTER}"
%SendKeys% "%inputcapture%{ENTER}{ENTER}"
%SendKeys% "%inputhide%"

if "%Party%" neq "0" goto end

:: INPUT PREFIX
for /L %%A in (1,1,20) do %SendKeys% "{TAB}"
%SendKeys% "{DOWN}"

:end 
del SendKeys.js

goto :EOF