Jump to content



Photo

AutoIt Unlocker


  • Please log in to reply
12 replies to this topic

#1 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,217 posts

Posted 06 April 2012 - 06:41 PM

Posted Image

This was made with the intention to mimic the well known unlocker.exe.

Credits to Yashied, monoceres, wraithdu, Manko, Trancexx, JScript, Larry, SmOke_N, mrRevoked, Melba23 & guinness.

Spoiler


Attached File  Unlocker Source.rar   11.01K   578 downloads - [152] Previous Downloads

Alternately, download the exe from my site here, but sometimes my site is offline (a lot).
Some say taking and closing handles from a process can produce unwanted side effects in the targeted process, use with caution.

History
Spoiler

Edited by ApudAngelorum, 26 May 2012 - 06:36 PM.

Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.







#2 guinness

guinness

    guinness

  • MVPs
  • 10,430 posts

Posted 06 April 2012 - 06:59 PM

I keep getting the an error message saying 'Error Code: 1 Extended 13.' I'm using the latest version on Windows 7 x64.

Edit: Credits to me? What did I do?

Edited by guinness, 06 April 2012 - 07:01 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#3 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 4,022 posts

Posted 06 April 2012 - 07:00 PM

Thanks for sharing!

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#4 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,877 posts

Posted 06 April 2012 - 07:10 PM

I'm getting the same error:

---------------------------
Error Code: 1 Extended: 13
---------------------------
The application has encounterd an error and will now close, sorry for the inconviniance.
---------------------------
OK
---------------------------

Also, don't limit the FileSelectFolder to the homedrive, because that's not allowing me to change drives to any other drive. My homedrive is set to a network share with only a few folders on it, none of which should be locked.

BTW, inconvenience is spelled wrong in that error message. ;)

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#5 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,217 posts

Posted 06 April 2012 - 07:13 PM

I keep getting the an error message saying 'Error Code: 1 Extended 13.' I'm using the latest version on Windows 7 x64.

Edit: Credits to me? What did I do?


Well... I guess this would be a good time to post this...

Posted Image

But in all seriousness, I haven't tested this on any x64 bit systems and your post might prove it doesn't work on them, but aside from that I've tested this on windows xp sp3 x86 and windows 7 x86.

And the error you're getting means that the File and Process object handle types were not found, which is File = 28 and process = 5 on windows xp and windows 7 I believe.

And why not credits to you? Remember this thread? If it weren't for your help there this probably wouldn't be here.

I'm getting the same error:

Also, don't limit the FileSelectFolder to the homedrive, because that's not allowing me to change drives to any other drive. My homedrive is set to a network share with only a few folders on it, none of which should be locked.

BTW, inconvenience is spelled wrong in that error message. :)


Thanks for pointing that out, I hadn't noticed and too bad scite doesn't spell check like my browser ;)

Ieme fix that..

Thanks for sharing!

You're welcome! :D

Edited by ApudAngelorum, 06 April 2012 - 08:34 PM.

Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.

#6 guinness

guinness

    guinness

  • MVPs
  • 10,430 posts

Posted 06 April 2012 - 08:08 PM

Just a question, but the functions you used from WinAPIEx.au3 did you alter them in anyway, because the UDF has been tested on x64 thoroughly.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#7 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,217 posts

Posted 06 April 2012 - 08:26 PM

Just a question, but the functions you used from WinAPIEx.au3 did you alter them in anyway, because the UDF has been tested on x64 thoroughly.

If you notice, I only took the one function from that UDF and it's ZwQuerySystemInformation, and since you got to error level 13 returned in the extended macro, then this means the function taken from winapiex works flawlessly, I don't have an x64 bit machine handy but maybe you could try commenting out this line~

If DllStructGetData($tHandle, 1) <> @AutoItPID Then ContinueLoop; only search our process for now

What it's doing is making sure we're trying to look for the object handle types in our process only (I.e., File = 28 on win xp and file = 25 on vista), but I doubt it will work, there must be something else at play here..


For an object of type file, the value bObjectType in SYSTEM_HANDLE is 28 in Windows XP, Windows 2000, and Window 7; 25 in Windows Vista; and 26 in Windows 2000.

If you comment out that line then maybe it will work? give it a try.

Or else just populate the $FileObject array yourself with the valid object type values depending on your system, read the link above.
On windows vista this would probably be right.

$aObject[$Ready][0] = DllStructGetData($tHandle, 2);return it so we can use it to find them $aObject[$Ready][1] = DllStructGetData($tString, 1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $aObject[$Ready][0] = 25 $aObject[$Ready][1] = "File"

Edited by ApudAngelorum, 06 April 2012 - 08:38 PM.

Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.

#8 guinness

guinness

    guinness

  • MVPs
  • 10,430 posts

Posted 06 April 2012 - 09:09 PM

I tried commenting out but to no avail. I'll have a look over the next week or so. Thanks.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#9 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 06 April 2012 - 09:13 PM

monoceres started a script like this a while back, and I did some work on it too. It proved tricky and ultimately incomplete. Maybe you can borrow something from it: http://www.autoitscript.com/forum/topic/83145-basic-file-unlocker/

#10 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,217 posts

Posted 06 April 2012 - 09:18 PM

monoceres started a script like this a while back, and I did some work on it too. It proved tricky and ultimately incomplete. Maybe you can borrow something from it: http://www.autoitscript.com/forum/topic/83145-basic-file-unlocker/

Thanks, I've actually already scavenged that post, hence the credits to monoceres, what I took from there that I needed was the part of the script that determines what drive label to use. If you downloaded the script, look closely and you'll recognize some of the code, I didn't change the variables.

 Local $struct = DllStructCreate("char[255];") Local $Temp = DriveGetDrive("ALL") Local $drivesinfo[UBound($Temp) - 1][2] For $I = 0 To UBound($drivesinfo) - 1   $drivesinfo[$I][0] = $Temp[$I + 1]   DllCall($hKERNEL32, "dword", "QueryDosDevice", "str", $drivesinfo[$I][0], "ptr", DllStructGetPtr($struct), "dword", 255)   $drivesinfo[$I][1] = DllStructGetData($struct, 1) Next ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     DllCall($hNTDLL, "ulong", "NtQueryObject", "ptr", $hObject, "int", 1, "ptr", DllStructGetPtr($poti), "ulong", DllStructGetSize($poti), "ulong*", "")     $devicestr = DllStructCreate("wchar[" & Ceiling(DllStructGetData($poti, "Length") / 2) & "];", DllStructGetData($poti, "buffer"))     $devicestr = DllStructGetData($devicestr, 1)

Edit: wow, after taking a closer look I noticed that code is actually by you, let me fix my first post ;)

Edited by ApudAngelorum, 06 April 2012 - 09:20 PM.

Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.

#11 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,217 posts

Posted 06 April 2012 - 10:08 PM

I tried commenting out but to no avail. I'll have a look over the next week or so. Thanks.


Ok, so I hit up a friend with a 64bit system and I tried debugging the script for a few minutes and found out that it is in fact the function that I previously said executed flawlessly, it turns out that even in its original form (straight out of the winapiex UDF) it does not return the desired information.

The function in question is _WinAPI_EnumProcessHandles() which should return file handles in an array and is basically the heart of this script...

MSDN mentions nothing about incompatibility on any system so I'm guessing this is a bug in the function?

Anyway, with a little help from the community running 64bit OSs, this could turn out to be a pretty handy tool, I use it a lot to unlock directories locked by scite and other apps, but as for debugging this for 64bit systems, I just don't have the resources or the know how to do it.

Edited by ApudAngelorum, 06 April 2012 - 11:30 PM.

Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.

#12 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,217 posts

Posted 26 May 2012 - 06:39 PM

Added support for 64bit systems as it seems thanks to yashied for an update he made to a function from his winapiex udf that I use that is critical to everything in the script.
Spoiler
Warning: Posts by this user are subject to change or may disappear without notice.

#13 wazer

wazer

    Wayfarer

  • Active Members
  • Pip
  • 52 posts

Posted 20 October 2012 - 10:55 PM

i really liked unlocker back in the days on XP, but then i moved to windows 7/8, since then unlocker has never really worked well,

Now i saw this topic, yours dont work as i expected, i run it, select the folder then it gets stuck at 3/6, at last the windows ask if you want to end it since its not responding anymore.

So is there an update coming for windows 8?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users