Jump to content
Tuts 4 You

how create owen dongle usb ?


okaydoit

Recommended Posts

hi


 


i have one program


 


i want put my owen usb flash copylock


 


like dongle usb


 


when i put usb program work else say usb not found


 


any tools?  or any soft have to do this?


Link to comment

how ? ts esay for you  not me :(

 

i foudn some program like this soft

 

http://www.isohelpline.com/usb_dongle_usb_key_usb_drive_software_protection.htm

 

but price is veryyyyyyyyyyyyyyyyyyyy :(

Price:

Basic Edition : USD 550 / INR 30,250/-
Standard Edition: USD 991 / INR 55,505/-

Note: The product will be protected with a USB dongle and will run only if dongle is connected. Upon payment we will send you a program CD and a dongle. Price includes courier charges anywhere in the world.
VAT : In India 5% Vat will be charged extra. Customer from other countries may have to pay customs duty extra as may be applicable in that country.

How to Protect EXE

Its very simple. We have two versions of the envelope. Just download from the licks given below on this page.

To protect your EXE, simply select the EXE and select the USB drive number displayed on the form. Click Create EXE and you have a new EXE which is protected.

The new EXE will run only if the USD pen drive is attached to the system. You can also restrict it to run only from the specified USB drive

 

 

 

 

i want like this soft or any idea?

Link to comment

Hmmm... Hey RDG,

Think you would have to use a sys driver module

Or would you just be able to hook the API?

Anyone know if you can hook a kernel API like ZwCreatefile from user space; I dont hook so I wouldn't know?

Edited by JMC31337
Link to comment

true true.. but im thinking on his idea, you could lock access to the USB only allowing a certain program to write/read it... of course this would require some serious coding... maybe hook any user level API to read write data but then you're gonna have to detect where the data is being read/written too as you dont want to stop the OS from reading / writing other crap from user level...  maybe have a driver, "lock" all sectors on the usb as read-only.. but then you would need crypto to keep regular prying eyes out of your docs...


 


yea im thinking a driver... anyone else think this could be done from user level?


its gotta be a driver, (requires admin privs) and i say that because the OS is going to load its own USB driver for whichever flash device you insert... thats a tricky thing there... ill have to think about it.. definitely worth it, its just not worth installing a bunch of unnecessary stuff like TrueCrypt (which is a great tool btw) or these other "lockers" that he mentioned above...


Link to comment

createfile - deviceiocontrol is pretty much the only interface to it...

most just load the generic usb stick driver, and the hardware on the device handles specific ioctl commands sent to it..

Edited by evlncrn8
Link to comment

Anyone know if you can hook a kernel API like ZwCreatefile from user space; I dont hook so I wouldn't know?

 

no you cannot hook Zw* functions without a kernel driver.

Link to comment
 

no you cannot hook Zw* functions without a kernel driver.

 

very nice info.. thnx...

so "okaydoit" you're going to need to control/code your own USB driver... some examples come with the DDK

However, you dont necessarily need the DDK to "write" a sys driver module.. i did an example with Dev-C++ on this forum (which i learned from china)... 

 

createfile - deviceiocontrol is pretty much the only interface to it...
most just load the generic usb stick driver, and the hardware on the device handles specific ioctl commands sent to it..

thinking a KERNEL DRIVER hook with ZwCreateFile, ZwWriteFile, ZwReadfile,CreateFile,WriteFile would take care of all ya need, and checking the UNICODE UNC path for your USB drive and if it matches just cancel the OS' attempt.. Remember though; these drive letters change sometimes... One Minute its drive K: another its L:  .. But yu can get the "usb stick name" and try to use that as a way..

Their are also some other seriously complex API that are undocumented;  such as IOCreateFile, IOCreateDevice  etc etc...

OSR is a good place to start for undocumented NT API....

 

you got your work cut out for you....

 

 

Examples:

 

"If your USB Flash Drive (UFD) has a Silicon Motion Inc. (SMI) controller inside it (such as many of the UFDs from Lexar), then you can use the SMI_UFDiskUtilities application (hereafter called SMIUFD.exe) to make a CD/DVD partition, write-protect the mass storage area, or even split the mass storage area into two and password protect and hide the 2nd area"

 

same site http://www.rmprepusb.com/tutorials/54---how-to-fix-write-protected-disks

 

GOOGLE:

read write protect usb   (about 2 million results)

Edited by JMC31337
Link to comment

dear see this

 

http://www.isohelpline.com/usb_dongle_usb_key_usb_drive_software_protection.htm

 

 i want like this soft

 

i have one exe    want protect from usb

 

mean when usb connect soft open

 

else say usb not foundd

"To protect your EXE, simply select the EXE and select the USB drive number displayed on the form. Click Create EXE and you have a new EXE which is protected. The new EXE will run only if the USD pen drive is attached to the system. You can also restrict it to run only from the specified USB drive"

so if you goto run your EXE and your USB is NOT in the computer, you dont want it to run?  

or do you want it the other way around... USB is in the computer EXE not run?

 

lemme try logic

 

USB inserted = yes

EXE run = yes

 

or

 

USB inserted = YES

EXE run = no

 

sorry if i dont understand , just clarify and ill help ya out

Edited by JMC31337
Link to comment

here it is in C#.. and it was pretty easy to code.. but i find the idea interesting... 


changed some of this pre-written stuff around


http://stackoverflow.com/questions/123986/how-to-determine-usb-flash-drive-manufacturer



//C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
//csc /unsafe /target:exe /out:usbkey.exe usbkey.cs
using System;
using System.Collections.Generic; using System.Windows.Forms;
using System.Management;
using System.IO; static class Program
{
static void Main()
{ Console.Write("ENTER USB KEY LETTER:");
string ch = Console.ReadLine();
ch =ch.ToUpper();
ch += ":";
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_DiskDrive"); foreach (ManagementObject queryObj in searcher.Get())
{
//Console.WriteLine("DeviceID: {0}", queryObj["DeviceID"]);
//Console.WriteLine("PNPDeviceID: {0}", queryObj["PNPDeviceID"]);
//Console.WriteLine("Manufacturer: {0}", queryObj["Manufacturer"]);
//Console.WriteLine("Model: {0}", queryObj["Model"]);
foreach (ManagementObject b in queryObj.GetRelated("Win32_DiskPartition"))
{
// Console.WriteLine(" Name: {0}", b["Name"]);
foreach (ManagementBaseObject c in b.GetRelated("Win32_LogicalDisk"))
{ string usb = c["Name"].ToString();
string model = queryObj["Model"].ToString(); //CHANGE NAME HERE!!
if(usb == ch && model == "SanDisk Cruzer Crossfire USB Device")
{
Console.WriteLine(usb);
Console.WriteLine("Model: {0}", queryObj["Model"]);
MessageBox.Show("ALL OBJECTS MATCH, ACCESS GRANTED!!!");
} Console.WriteLine(c); // here it will print drive letter }
}
// ...
Console.WriteLine("--------------------------------------------");
}
}
catch (ManagementException e)
{
Console.WriteLine(e.StackTrace);
}
Console.WriteLine("PRESS ENTER");
Console.ReadLine(); }
}

if it all matches i have it print a message box, of course if you're savvy you can make it do whatever you want


 


TEST:


put your USB in the cpu


get its drive letter  (in this case M)


just type ONLY the drive letter, the code will uppercase it and add the :


(hopefully you know the name of your usb name) uncomment //Console.WriteLine("Model: {0}", queryObj["Model"]);


to get it.. 


one you have it, change its string name 


model == "SanDisk Cruzer Crossfire USB Device"


 


if its all correct your code can do whatever... 


 


you want something more extravagant you'll need a sys driver... add crypto   bla bla etc etc... hav fun 


 


 


 



 

 


Edited by JMC31337
Link to comment

chose this way after seeing that some USB flash drives dont have serial numbers they have PnPID (plug n play ID) and i dunno if those change from OS to OS or cpu to cpu...
besides i liked the idea okaydoit brought up...

 

to do this in "C++" "ManagementObjectSearcher" anyone gotta better info site than

http://social.msdn.microsoft.com/Forums/vstudio/en-US/1ba183a5-71bb-4601-beb6-73ba20b087cd/getting-the-propertydata-of-managementobject-in-c?forum=vcgeneral

Edited by JMC31337
Link to comment

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
×
×
  • Create New...