Jump to content

Need help with a script


Dtpk

Recommended Posts

Hello everyone I normally don't ask for help but been having a hard time coding a script for twin duck that will copy off a version of DevCon and make it loop the keyboard and mouse disable commands. What I am aiming to do is plug in my duck it creates a loop disabling the keyboard and mouse till another flash drive with the name of "key" is found and then breaks the loop of DevCon. Now I got the idea from the video on pod slurping but instead of copying I want it to give me access to my keyboard and mouse. I made a video kinda explaining what I need help with better but it isn't done yet so hopefully someone figures out what I am aiming for. 

Link to comment
Share on other sites

I finally started scripting the code for this and I think I got something working as of right now well at least the part where devcon copies off the duck then creates a batch to loop it which gets runned by a vbs script to make it invisible I also made another batch to launch a wait file for the usb drive with the drive labeled key which has a batch on it to terminate the loop. But for some reason I can't loop devcon remove command when its on the pc but I can fine from another drive. If anyone has a clue to why this is let me know. But other then that i'm almost done with what i'm trying to make.

Eventually will just add the required batches and vbs files to the duck sd card and copy them off since it would make the code so much faster. 

Edited by Dtpk
Link to comment
Share on other sites

This is the loop i'm trying to start after devcon gets copied off the duck on to the pc 


:loop
devcon32.exe remove =keyboard *
devcon32.exe remove =mouse *
devcon64.exe remove =keyboard *
devcon64.exe remove =mouse *
goto :loop

Afterwards I have another batch made via the duck copied onto the pc that waits for the flash drive by the name of "key" and once it's found it runs another batch on that flash drive thats hidden to terminate the loop made earlier.

Link to comment
Share on other sites

I test it
need run as Admin
laptop built-in not disabled , I think you cannot

all other keyboard and mouse will disabled till insert USB Flash Disk named: key

command-line:
show        =visible gui[default:na]
stay        =not exit even if found usb flash drive name key[default:na]
anything    =Your Usb Flash LabelName will stop when found it[default:key]
start        =check usb flash immediately no need insert new usb to start[default:start]

Example
DevCon.exe show stay XBOOT start

 

key.zip

Edited by xcoder
Link to comment
Share on other sites

Thanks Xcoder I don't know what you did to get DevCon to do this automatically but it seems to work for the most part it but it has a issue I get mouse and keyboard control once the usb is in labeled as "key" but I only get it for like 5 seconds also this might be my fault but I don't know is the default flash disk name "key" all lower case or does it work in upper case cause by default it will stay in all caps.
-------------------------------------------------------------------------------------------------------------
I know its a bit much to ask you done so much to help me with this and if I make a video on it i'll credit you for sure but if you can explain how you made the application or a quick run down it would be so sweet.

Link to comment
Share on other sites

I used
devcon remove =keyboard *

devcon remove =mouse *

program automatically will check if system is [x32] or [x64] and use correct devcon

always loop till USB insert with specific Name will stop loop command, if USB unattached then repeat command loop and wait USB
 


default USB name is key (now I fix it no matter if its Upper or Lower case) and framework downgrade to .net 2.0
you can change USB name by use this command :

DevCon.exe AnyName start

anything you want change it just tell me

key.zip

Link to comment
Share on other sites

New Zip has Issue I listed it below but the old zip is fine I also typed why it didn't work for me at first I was just stupid lol.

Xcoder I think this is perfect I found out it just my mouse not being reconnected but when the drive is in my keyboard is fine it might just be my mouse that is the issue it gets re enabled but only for like 5 second. The keyboard on the other hand seems to stay enabled till I pull out the flash drive which is awesome.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Fixed my issue with the old zip I was just a idiot:

 Oh this is just something I figured out but the old zip you sent is perfect I was just mistyping the commands my bad. Also for some ever reason the old zip keeps my mouse working and keyboard once drive is in which is great. I'll have to start making the script for this now for my Usb ducky thanks for all the help you will definitely get credit for this when ever I make the video on this.

Link to comment
Share on other sites

sorry I fix it
now start invisible mouse and keyboard disable at the same time and when find key will be ready to use by using:
devcone64 restart =keyboard *
devcone64 restart =mouse*
devcone64 rescan


command-line:
show        =visible gui[default:na]
stay        =not exit even if found usb flash drive name key[default:na]
urflashname =Your Usb Flash LabelName will stop when found it[default:key]

Example:
DevCon.exe show stay urflashname 

or if you want change USB name use this:key.zip

DevCon.exe urflashname

key.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...