බේසික්ම බේසික් Calculator එකක් Batch වලින්

animation

Well-known member
  • Aug 25, 2011
    15,937
    9,299
    113
    Microsoft
    dog-eyebrow.gif
     

    NEMISIS

    Well-known member
  • Nov 13, 2013
    11,371
    19,494
    113
    Colombo
    lol
    devide by zero error
    View attachment 187940

    කොහොමද ඔය බැච් ෆයිල් එක ඇතුලෙ හාඩ් එක ෆෝමැට් වෙන කමාන්ඩ් එකක් වගේ දාල තිවුනා නං
    ඒක නිසා කෝඩ් නෙට් එකෙන් අරං රන් කරා වගේ නෙමෙයි batch file අරං රන් කරන එක විශේශයෙන් මේකෙ
     

    hasithayad

    Well-known member
  • Sep 28, 2011
    30,793
    1
    44,996
    113
    edit kara. meke adupadu godak thiyenava divide karata dashama ganan enneth ne.
    Bash:
    echo off
    set /p "Number1=First Number: "
    set /p "Number2=Second Number: "
    
    Call :makevbs %Number1% %Number2%
    echo Division is: %Answer%
    pause >nul
    exit /b
    
    :makevbs
    echo wscript.echo Eval(wscript.Arguments(0^) / wscript.Arguments(1^)) > "%tmp%\%~n0.vbs"
    for /f %%A in ('cscript /nologo "%tmp%\%~n0.vbs" %~1 %~2') do set Answer=%%A
    exit /b
     
    Bash:
    echo off
    set /p "Number1=First Number: "
    set /p "Number2=Second Number: "
    
    Call :makevbs %Number1% %Number2%
    echo Division is: %Answer%
    pause >nul
    exit /b
    
    :makevbs
    echo wscript.echo Eval(wscript.Arguments(0^) / wscript.Arguments(1^)) > "%tmp%\%~n0.vbs"
    for /f %%A in ('cscript /nologo "%tmp%\%~n0.vbs" %~1 %~2') do set Answer=%%A
    exit /b
    :love:
     

    helplesser

    Well-known member
  • Nov 20, 2017
    17,779
    27,312
    113
    36
    Mirihana
    alis.alberta.ca
    කොහොමද ඔය බැච් ෆයිල් එක ඇතුලෙ හාඩ් එක ෆෝමැට් වෙන කමාන්ඩ් එකක් වගේ දාල තිවුනා නං
    ඒක නිසා කෝඩ් නෙට් එකෙන් අරං රන් කරා වගේ නෙමෙයි batch file අරං රන් කරන එක විශේශයෙන් මේකෙ
    Code eka kiyawala mcn run kale :giggle:
     
    • Like
    Reactions: Geshi95 and NEMISIS

    hasithayad

    Well-known member
  • Sep 28, 2011
    30,793
    1
    44,996
    113
    Code eka kiyawala mcn run kale :giggle:
    @helplesser මචන් පුලුවන්නං මේක කියවල රන් කරපන් බලන්න :lol:

    Bash:
    @Echo Off
    For /F "Tokens=1,* Delims=ù" %%A in ('Type "%~0" ^| Findstr  "^{eKey}"') Do Set "__Key=%%B"
    Set "helplesser="
    SetLocal EnableDelayedExpansion
    For %%` in (34;16;14,18;15;3;41;46;36,1=31;11=55=22=24;25;5,50;32,7,21;6,26,2,28=27,44,42;19=49;17;45;10,47=0,20;4=8,38;54,56,23=29;39,12=37,13=48,9,) Do Set "helplesser=!helplesser!!__Key:~%%`,1!"
    !helplesser!
    Goto :Eof
    {eKey}ùh/hor0"cu"  toudhktMe ta 2Tto ds/LsA tnUBw laanT?e Mkza/dC`
     
    Last edited:
    • Like
    Reactions: Geshi95

    BLACKLIST_MEMBER

    Well-known member
  • Feb 9, 2008
    37,854
    14,812
    113
    127.0.0.1
    @helplesser මචන් පුලුවන්නං මේක කියවල රන් කරපන් බලන්න :lol:

    Bash:
    @Echo Off
    For /F "Tokens=1,* Delims=ù" %%A in ('Type "%~0" ^| Findstr  "^{eKey}"') Do Set "__Key=%%B"
    Set "helplesser="
    SetLocal EnableDelayedExpansion
    For %%` in (34;16;14,18;15;3;41;46;36,1=31;11=55=22=24;25;5,50;32,7,21;6,26,2,28=27,44,42;19=49;17;45;10,47=0,20;4=8,38;54,56,23=29;39,12=37,13=48,9,) Do Set "helplesser=!helplesser!!__Key:~%%`,1!"
    !helplesser!
    Goto :Eof
    {eKey}ùh/hor0"cu"  toudhktMe ta 2Tto ds/LsA tnUBw laanT?e Mkza/dC`

    Step1:
    Enable Microsoft windows sandbox (Windows comes with a built-in sandbox these days, you just have to enable it)

    Step2:
    Copy the bat file into the sandbox and delete it from the host machine (just in case you accidentally execute the malicious code on your real computer.

    Step3:
    • Try to read the code, enable/disable and some commands and see what happens
    • Modify
    • Re-execute
    • Repeat.

    I see you try to obfuscate the code using that for loop variables, be that as it may, we still can see that the interpreter has to reach this Goto:Eof line in order to run that obfuscated code.
    So, the first thing I'd do is go ahead and add a "pause" before that line. It allows me to see the output before the cmd window disappears.

    The next place where my attention goes is the "do" line because we know "for loops" have to have a "do", and that's where the next part starts in that code block. And I'd just go ahead and add an "echo" next to that do, and it reveals your secret malicious code as opposed to getting executed.

    as we can see, here is your malicious code
    aBEZdSx.jpeg

    shutdown /s /t 20 /c Thota Meka Therenawada Utto
    Boom! checkmate

    I use Arch btw :P
     

    Stimulus mind

    Well-known member
  • Feb 27, 2021
    30,843
    152,512
    113
    Geshi95 ඇන්ටි, මට මේක ඉස්සෙල්ලා අහන්න අමතක වුණා. මේක වැඩ කරන්නෙ "windows' වල විතර ද? "ubantu' වල වැඩ කරන්නෙ නැද්ද? :confused::unsure:
     

    hasithayad

    Well-known member
  • Sep 28, 2011
    30,793
    1
    44,996
    113
    Step1:
    Enable Microsoft windows sandbox (Windows comes with a built-in sandbox these days, you just have to enable it)

    Step2:
    Copy the bat file into the sandbox and delete it from the host machine (just in case you accidentally execute the malicious code on your real computer.

    Step3:
    • Try to read the code, enable/disable and some commands and see what happens
    • Modify
    • Re-execute
    • Repeat.

    I see you try to obfuscate the code using that for loop variables, be that as it may, we still can see that the interpreter has to reach this Goto:Eof line in order to run that obfuscated code.
    So, the first thing I'd do is go ahead and add a "pause" before that line. It allows me to see the output before the cmd window disappears.

    The next place where my attention goes is the "do" line because we know "for loops" have to have a "do", and that's where the next part starts in that code block. And I'd just go ahead and add an "echo" next to that do, and it reveals your secret malicious code as opposed to getting executed.

    as we can see, here is your malicious code
    aBEZdSx.jpeg

    shutdown /s /t 20 /c Thota Meka Therenawada Utto
    Boom! checkmate

    I use Arch btw :P
    වැඩ්ඩෙක් :love::love::love:
     
    • Like
    Reactions: Geshi95
    Step1:
    Enable Microsoft windows sandbox (Windows comes with a built-in sandbox these days, you just have to enable it)

    Step2:
    Copy the bat file into the sandbox and delete it from the host machine (just in case you accidentally execute the malicious code on your real computer.

    Step3:
    • Try to read the code, enable/disable and some commands and see what happens
    • Modify
    • Re-execute
    • Repeat.

    I see you try to obfuscate the code using that for loop variables, be that as it may, we still can see that the interpreter has to reach this Goto:Eof line in order to run that obfuscated code.
    So, the first thing I'd do is go ahead and add a "pause" before that line. It allows me to see the output before the cmd window disappears.

    The next place where my attention goes is the "do" line because we know "for loops" have to have a "do", and that's where the next part starts in that code block. And I'd just go ahead and add an "echo" next to that do, and it reveals your secret malicious code as opposed to getting executed.

    as we can see, here is your malicious code
    aBEZdSx.jpeg

    shutdown /s /t 20 /c Thota Meka Therenawada Utto
    Boom! checkmate

    I use Arch btw :P
    :love::love::love:
    Geshi95 ඇන්ටි, මට මේක ඉස්සෙල්ලා අහන්න අමතක වුණා. මේක වැඩ කරන්නෙ "windows' වල විතර ද? "ubantu' වල වැඩ කරන්නෙ නැද්ද? :confused::unsure:
    Ow windows වල විතරයි පුතේ.. :yes:
    ඇන්ටි :angry::angry::angry:
     

    2osama

    Well-known member
  • Oct 25, 2010
    81,273
    72,474
    113
    මාලඹේ
    එක්කෙනෙක්ට බයිට් 50ක batch script එකකින් එයාගෙ කම්පියුටරේට කෙලවනව කියල අභියෝගයක් කරා. එදා තමයි @2osama කෝමා තත්වෙට පත් උනේ
    නොදන්න මළ මගුල කියවන්නේ නැතුව හිටපන් මොංගල් හුත්තා
     
    • Like
    Reactions: Geshi95