Home > Back-end >  O U disk independently obtain IP
O U disk independently obtain IP

Time:09-29


I want to plug a usb on computer I have remote to know his IP (ADSL) ways to obtain the best can be hidden

CodePudding user response:

Trojans,,

CodePudding user response:



Find the data; Recorded;
Development can be automatically run the program of the U disk
two Developing thinking

We know that drives insert disk can run automatically, so we can let U disk in the form of a simulated area into CD, so that we can use the autorun. J inf, let the program run automatically,

3. Development steps
1. Let U disk showing a region into a CD
This for development through U disk should be very simple, is in the operating system sends the SCSI device INQUIRY instruction, return to indicate the device type of INQUIRY, we are set to CD equipment, specific instructions can be reference for related information (spc3r23. PDF), I developed the INQUIRY to return to the first few bytes of data are as follows: 0 x05, 0 x80, 0 x02, 0 x02 for reference only,

2. Response operation system for the CD
the instructionsInto discs, the operating system might send some SCSI commands to the disc area, should respond to certain instruction, some do not need to response, I'll appendix a I get behind a U disk BusHound monitoring file, you can reference, best buy such a U disk, and then use BusHound monitoring communication process,

3. Written to a CD file
Should be able to get the CD area into CDRW, such written directly is ok, but need to know such a lot of agreement, in the interest of time, I used the simple way, the documents that are required to be written to the CD with ISO production tools into an ISO image file, write a small program to write ISO image file, this CD area program code attached at the back of the document, for reference only, write the program final call DeviceIoControl function, after the file is written to, again pull inserted U disk,

Four. Description
Here is simply explained the principle, if they are new to this, there is still much to understand, I am in a ordinary usb development board to add this function on the basis of, finally have a good grasp of, the feeling is very not easy, also have no hardware firmware program before, hope to help novice, have what problem, can contact email exchanges,

Appendix:
1. The Write ISO program code:
UINT CWriteIsoFileDlg: : ThreadWrite (LPVOID pParam)
{
PParam CWriteIsoFileDlg * p=(CWriteIsoFileDlg *);

CSDsk sd;
CString str;

HANDLE fh, hFind;
WIN32_FIND_DATA FindFileData;
ULONGLONG fSize=0;
CFileFind ff;

DWORD startAddr=0;
DWORD nBytesRead=0;
PBYTE buf=new BYTE [20480].
Memset (buf, 0204, 80);

Try
{
if(! Ff. FindFile (p - & gt; Filename))
{
STR. The Format (" can't find the file % s ", p - & gt; Filename);
Throw 1;
}
Ff. The FindNextFile ();

Fh=CreateFile (ff) GetFilePath (), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
If (fh==INVALID_HANDLE_VALUE)
{
STR. The Format (" failure "opens the file % s, p - & gt; Filename);
Throw 1;
}

if(! Sd. The Open ())
Throw 0;

Int index=sd. GetDevNum () - 1;

if(! Sd. ReadCapacity (index 0, fSize))
Throw 0;

If (ff) GetLength () & gt; FSize)
{
STR="disc space is insufficient, can't write,";
Throw 1;
}
FSize=ff. GetLength ();

if(! Sd. GetFlashParam (index, 0, 1, buf))
Throw 0;
Buf [0] & amp; XBF=0;
if(! Sd. SetFlashParam (index, 0, 1, buf, false))
Throw 0;

While (1)
{
If (ReadFile (fh, buf, 20480, & amp; NBytesRead, NULL))
{
If (nBytesRead!=0)
{
if(! Sd. Write (index, 0, startAddr, 40, buf))
{
Throw 0;
}
StartAddr +=40;
Memset (buf, 0204, 80);
}
The else
break;
}
The else
{
STR="read file error!" ;
Throw 1;
}
}
//p - & gt; MessageBox (" write image file success!" , NULL, MB_OK | MB_ICONINFORMATION);
Sd. PlugDisk (index 0, true);

The delete [] buf;
exit(0);
}
The catch (int) e
{
If (e==0)
{
p-> MessageBox (sd. Err. GetErrMsg (), NULL, MB_OK | MB_ICONERROR);
}
The else
p-> MessageBox (STR, NULL, MB_OK | MB_ICONERROR);
}
The delete [] buf;
exit(-1);
return 1;
}

2. Can since the launch of the BusHound U disk monitoring under the Windows xp file


Put written program automatically obtain IP in usb drive, according to the above methods to try

CodePudding user response:

U disk development can be automatically run the program, the focus!

CodePudding user response:

My computer's external drive have been playing automatically shut down, unless it is to make double click on the program to run automatically,

CodePudding user response:

refer to the second floor abclm response:


Find the data; Recorded;
Development can be automatically run the program of the U disk
two Developing thinking

We know that drives insert disk can run automatically, so we can let U disk in the form of a simulated area into CD, so that we can use the autorun. J inf, let the program run automatically,

3. Development steps
1. Let U disk showing a region into a CD
This for development through U disk should be very simple, is in the operating system sends the SCSI device INQUIRY instruction, return to indicate the device type of INQUIRY, we are set to CD equipment, specific instructions can be reference for related information (spc3r23. PDF), I developed the INQUIRY to return to the first few bytes of data are as follows: 0 x05, 0 x80, 0 x02, 0 x02 for reference only,

2. Response operation system for the CD
the instructionsInto discs, the operating system might send some SCSI commands to the disc area, should respond to certain instruction, some do not need to response, I'll appendix a I get behind a U disk BusHound monitoring file, you can reference, best buy such a U disk, and then use BusHound monitoring communication process,

3. Written to a CD file
Should be able to get the CD area into CDRW, such written directly is ok, but need to know such a lot of agreement, in the interest of time, I used the simple way, the documents that are required to be written to the CD with ISO production tools into an ISO image file, write a small program to write ISO image file, this CD area program code attached at the back of the document, for reference only, write the program final call DeviceIoControl function, after the file is written to, again pull inserted U disk,

Four. Description
Here is simply explained the principle, if they are new to this, there is still much to understand, I am in a ordinary usb development board to add this function on the basis of, finally have a good grasp of, the feeling is very not easy, also have no hardware firmware program before, hope to help novice, have what problem, can contact email exchanges,

Appendix:
1. The Write ISO program code:
UINT CWriteIsoFileDlg: : ThreadWrite (LPVOID pParam)
{
PParam CWriteIsoFileDlg * p=(CWriteIsoFileDlg *);

CSDsk sd;
CString str;

HANDLE fh, hFind;
WIN32_FIND_DATA FindFileData;
ULONGLONG fSize=0;
CFileFind ff;

DWORD startAddr=0;
DWORD nBytesRead=0;
PBYTE buf=new BYTE [20480].
Memset (buf, 0204, 80);

Try
{
if(! Ff. FindFile (p - & gt; Filename))
{
STR. The Format (" can't find the file % s ", p - & gt; Filename);
Throw 1;
}
Ff. The FindNextFile ();

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related