Jump to content

autorun for USB using U3


orange
 Share

Recommended Posts

So here is what I have done. Using the Universal Hacker U3 program, I have sucessfully loaded an ISO of mine that I thought would be useful to many people out there.

The ISO contains two files, one that is the AUTORUN.inf, and the second that is the run_autorun.exe executeable.

othe RUN_AUTORUN program searches for removable drives and returns an array of all drives found. Next, it searches on those drives for a file named AUTORUN.inf. Once it finds this file, it searches in it for the "open=" line, then it executes the program following.

Summary:

By loading this ISO, you can give autorun capability to the Flash Drive partition of the U3 device. This works on ANY windows machine.

I am hosting the files at my own site from Case Western Reserve University:

******Code is Updated as of 2/9 *******************

http://schedulerpro.case.edu/Hak5/

The program is written in AutoItv3:

#include<file.au3>

#compiler_icon=cd.ico

#compiler_allow_decompile=n



$drive_array = DriveGetDrive("REMOVABLE")

while @error = 1 

    $drive_array = DriveGetDrive("REMOVABLE")

    sleep (10)

WEnd



$drive_letter = find_autorun($drive_array)



if $drive_letter =0 then 

    sleep(5000)

    $drive_letter = find_autorun($drive_array)

    EndIf



dim $line_ = '' 



if FileExists($drive_letter & "autorun.inf") = 0 then $drive_letter =find_autorun($drive_array)

    

for $line = 1 to _FileCountLines($drive_letter & "autorun.inf")

    if stringinstr(filereadline($drive_letter & "autorun.inf",$line),"open=")<>0 then 

        $line_ = $line

        ExitLoop

    EndIf

Next



if $line_ = '' then Exit



$program_path = filereadline($drive_letter & "autorun.inf",$line_)

$program_path = stringreplace($program_path,"open=","")

$program_path = stringreplace($program_path,'"',"")

$program_path = stringreplace($program_path,"'","")



if stringinstr($program_path,":") <> 0 Then

    if FileExists($drive_letter & "" & $program_path)=0 then exit

    run($drive_letter & "" & $program_path)

    if @error then Exit

    Exit

EndIf



if FileExists($drive_letter & "" & $program_path)=0 then exit

run($drive_letter & "" & $program_path)



Func find_autorun($drive_array1)

    $drive_letter1 = 0

    for $var = 0 to ubound($drive_array1)-1

    if FileExists($drive_array1[$var] & "autorun.inf") then 

        $drive_letter1 = $drive_array1[$var]

        ExitLoop

    EndIf

Next

return $drive_letter1

EndFunc

EDIT: Source Code Update

Link to comment
Share on other sites

  • 4 weeks later...

I put the LaunchPad.iso into the BIN directory and did nothing else. Than I double clicked the Universal_Customizer.exe. It got to step 5 and said failed to access something ..universal customizer now shutting down. this is the error log...

[MUSK] [5644][21:52:31]: CCDServiceImpl::burnImage - failed to open image file C:Documents and SettingsDavid SzetoDesktopUniversal_CustomizerbinU3CUSTOM.ISO

wats wrong?

edit: just kidding im an idiot..i forgot to rename it U3CUSTOM

anyways

i do get the same error message as the guy above me...and you said you updated files already ...but it doesnt seem to work..

Link to comment
Share on other sites

ok, I think I know what is going wrong. I can fix it tonight when I get back to the house.

Are there any feature requests for this program? Being that there is some serious intersest in this, I can devote a little more time to it.

Let me know what you all want.

Link to comment
Share on other sites

OK

Files are updated. Everything works (famous last words)

Also note that if you want to run a file that is on the target computer you can include the full file path ala "C:RunME.exe" or you can just write the standard autorun file:

[autorun]

open=something.exe

Questions? Comments?

Link to comment
Share on other sites

that error means that the program that you are trying to run off of the USB key is not there or is named differently.

Keep in mind that the autorun file that is on the USB key has to point to a real file! lol

FIles are updated so that if the file does not exist, the program will exit.

Link to comment
Share on other sites

note that the ISO is an ISO of the other files that are on the server.

this might not be clear, I hope that it is.

The ISO is there for convenience -- it is ALL that you need to get this program to work.

Here is what to do:

Load the ISO on your U3 partion

write an AUTORUN file (as a valid shortcut)

save the autorun.inf to the root directory of the USB thumb drive.

the program that you specify on the USB key to run will run on autorun

So far, I haven't gotten any of the error that you all are....

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.

 Share

  • Recently Browsing   0 members

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