CyBoRgWaR

Command Line Parameter Help

8 posts in this topic

Hi , 

i need to know about what is exactly commandline parameter 

following questions :

how to get the values which was assigned in command line parameter....

i have to decode a password of ex employee , he is no more in my office but i have got the EXE and decoded , but unable to understand about the command line , 

 

please find the script adn tell me what will be the reference values of command line  and how to decode if it was phrase.....

 

 

 

 

If $cmdline[0] = 4 Then
    $neid = $cmdline[1]
    $neip = $cmdline[2]
    $userid = $cmdline[3]
    $password = $cmdline[4]
    BlockInput(1)
    Local $sfldr1 = "C:\Users\" & @UserName & "\hit3"
    If DirGetSize($sfldr1) <> -1 Then
    Else
        DirCreate($sfldr1)
    EndIf
    Local $sfile = $sfldr1 & "\hit_devices.ini"
    If FileExists($sfile) Then
        FileDelete($sfile)
    EndIf
    WinWaitActive("HIT-W-R-3.3.0c(0)", "", 60)
    Sleep(1000)
    If WinExists("Welcome to Hit 3") Then
        Send("{TAB 3}")
        Sleep(1500)
        Send("{SPACE}")
        WinClose("Welcome to Hit 3")
    EndIf
    Send("^{d}")
    Sleep(1500)
    $winhandle1 = WinGetHandle("Create new device ini file")
    ControlClick($winhandle1, "", "[CLASS:Button; INSTANCE:2]")
    $winhandle2 = WinGetHandle("Device settings")
    ControlClick($winhandle2, "", "[CLASS:QWidget; INSTANCE:10]")
    ControlClick($winhandle2, "", "[CLASS:QWidget; INSTANCE:10]")
    Sleep(1000)
    Send("{TAB 2}")
    Sleep(1000)
    Send("{SPACE}")
    Sleep(1000)
    Send("hit_devices.ini")
    Sleep(1000)
    Send("+{TAB 6}")
    Sleep(1000)
    Send("{SPACE}")
    Sleep(1000)
    Send($sfldr1)
    Sleep(2500)
    Send("{ENTER}")
    Sleep(1500)
    Send("+{TAB 2}")
    Sleep(1000)
    Send("{ENTER}")
    Sleep(1000)
    Send("{TAB 5}")
    Sleep(1000)
    Send("{SPACE}")
    Sleep(1000)
    $winhandle3 = WinGetHandle("Edit new device details")
    Send("{TAB}")
    Send($neip)
    Sleep(500)
    Send("{TAB 2}")
    Sleep(500)
    Send("{DOWN 4}")
    Sleep(1000)
    Send("+{TAB 8}")
    Sleep(1000)
    Send($neid)
    Send("^{TAB 2}")
    Sleep(1000)
    Send("{TAB 2}")
    Send($userid)
    Send("{TAB}")
    Send($password)
    Sleep(1000)
    Send("{TAB 9}")
    Sleep(500)
    Send("^{TAB 2}")
    Sleep(500)
    Send("+{TAB 5}")
    Sleep(500)
    Send("{DOWN}")
    Sleep(500)
    Send("{SPACE}")
    Sleep(500)
    Send("+{TAB 3}")
    Sleep(500)
    Send("{SPACE}")
    Sleep(1000)
    Send("{TAB 4}")
    ControlClick($winhandle2, "", "[CLASS:QWidget; INSTANCE:10]")
    ControlClick($winhandle2, "", "[CLASS:QWidget; INSTANCE:10]")
    Sleep(1000)
    Send("{TAB 10}")
    Sleep(1000)
    Send("{SPACE}")
    Sleep(4000)
    BlockInput(0)
    Sleep(1000)
    Exit (0)
Else
    MsgBox(0, "Error", "Invalid number of argument(s).  Contact System Administrator.", 5000)
    BlockInput(0)
    Exit (0)
EndIf

Please help me out...

Share this post


Link to post
Share on other sites



Read it all a couple of times, not easy to understand.

So you want to know the parameters for the cmd line, it seems more or less obvious..

$neid = $cmdline[1]    Some ID

$neip = $cmdline[2]     Some IP

$userid = $cmdline[3]     A User ID

$password = $cmdline[4] A Password

What else do you need?


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites
16 hours ago, careca said:

Read it all a couple of times, not easy to understand.

So you want to know the parameters for the cmd line, it seems more or less obvious..

$neid = $cmdline[1]    Some ID

$neip = $cmdline[2]     Some IP

$userid = $cmdline[3]     A User ID

$password = $cmdline[4] A Password

What else do you need?

Hi

i can understand that $cmdline[1] , 2 , 3 and 4 refers a var ,

 

but i want to know what these values refers... i mean what will be the values and where i can find in the script

 

example $cmdline[1] refers $neid ... but what is the value of $neid..... is it A or B or C or ....... X ?

which i need to find , and also where i can find.. since im very much confused about the Cmdline parameters so i cant understand.. 

 

please help me out...

Share this post


Link to post
Share on other sites

I've no idea, all 4 are used in send..

What happens if you run the exe in cmd line and with a help cmd or something?

like:

someapp.exe /?


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites

Okay, let's try and stop confusing one another, shall we?:lol: CyBoRgWaR, as I understand your question, you just want to know what values your former employee used at the command line when starting this script, right? The script receives username and password at the command line, which it then parses to some other programme through Send commands later on.

Well. bad news,:P because once the process itself is no longer running, the command line parameters are (usually) no longer retrievable either, which makes perfect sense, because you wouldn't want somebody else to be able to retrieve your secret password by storing it in your start-up script or an ini file. So that's probably why this script was designed this way in the first place, so the password was only ever going to exist transiently as a command line parameter, and not physically stored anywhere.

Share this post


Link to post
Share on other sites
4 hours ago, RTFC said:

Okay, let's try and stop confusing one another, shall we?:lol: CyBoRgWaR, as I understand your question, you just want to know what values your former employee used at the command line when starting this script, right? The script receives username and password at the command line, which it then parses to some other programme through Send commands later on.

Well. bad news,:P because once the process itself is no longer running, the command line parameters are (usually) no longer retrievable either, which makes perfect sense, because you wouldn't want somebody else to be able to retrieve your secret password by storing it in your start-up script or an ini file. So that's probably why this script was designed this way in the first place, so the password was only ever going to exist transiently as a command line parameter, and not physically stored anywhere.

great explaination  ... thanks a lot , 

 

i have 2 more questions , 

well if i want to do a same script like that , example i want to create a $username and $password , so where can i mention that in script so that i can get a script as similar as the one which i posted..

need some examples plz plz..

second one , it that any way i can get the values of $username and $password ???????

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

You need to actually read the material on $CmdLine in the help file; you would find most of your own answers. If you do a search on Command Line Parameters, you will find an explanation of how to incorporate these into your script. In the case of the script in your OP, $neid is the first parameter, $neip is the second, $userid is third, and $password if last. So if you create a similar script, when you compile it to an executable you would run it like this:

<ExecutableName> /neid /neip /userid /password

Example: C:\MyExe.exe /neid1 /neip1 /JLogan3o13 /MyPassword2016!

Again, all spelled out for you in the help file.

Edit: As for decompiling an executable to retrieve the script, or the username and password, both subjects are off limits on this forum. Please familiarize yourself with the forum rules.

Edited by JLogan3o13
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
1 hour ago, JLogan3o13 said:

You need to actually read the material on $CmdLine in the help file; you would find most of your own answers. If you do a search on Command Line Parameters, you will find an explanation of how to incorporate these into your script. In the case of the script in your OP, $neid is the first parameter, $neip is the second, $userid is third, and $password if last. So if you create a similar script, when you compile it to an executable you would run it like this:

<ExecutableName> /neid /neip /userid /password

Example: C:\MyExe.exe /neid1 /neip1 /JLogan3o13 /MyPassword2016!

Again, all spelled out for you in the help file.

Edit: As for decompiling an executable to retrieve the script, or the username and password, both subjects are off limits on this forum. Please familiarize yourself with the forum rules.

Hi ,

This is what im expected....  you are awesome bro... thanks......

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now