Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 13:45

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: AutoIt Steam Password Problem
PostPosted: 11 Mar 2009 14:58 

Joined: 11 Mar 2009 14:53
Posts: 2
I'm trying to create a password recovery tool in AutoIt, however I'm having no luck at the moment. This is what I have so far after scanning through a few other threads:

Code:
$steamPath = RegRead("HKEY_CURRENT_USER\Software\Valve\Steam", "SteamPath")
$k1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProductId")
$k2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid")
$k3 = RegRead("HKEY_CURRENT_USER\Software\Valve\Half-Life\Settings", "io")
$cKey = $k1&$k2&$k3
$cKeyLength = StringLen($cKey)
$Len = DllStructCreate("int")
$sBuffer = String($sBuffer)
$steamdll = DLLOpen($steamPath & "/Steam.dll")
$password = DllCall($steamdll, "int", "SteamDecryptDataForThisMachine", "str", $cKey, "int", $cKeyLength, "str", $sBuffer, "int", "65535", "ptr*int", DllStructGetPtr($Len))
DLLClose($steamdll)
MsgBox(0, "test", $password)


I don't know what i'm doing wrong, but whenever I run it it just prints 0.


Top
 Profile  
 
 
 Post subject: Re: AutoIt Steam Password Problem
PostPosted: 19 Mar 2009 03:32 

Joined: 16 Jan 2009 22:16
Posts: 19
did you ever figure out what the problem was?


Top
 Profile  
 
 Post subject: Re: AutoIt Steam Password Problem
PostPosted: 22 Mar 2009 14:19 

Joined: 22 Mar 2009 06:59
Posts: 5
Because $password will hold the result of the function call (0 = no error), try printing the contents of $sBuffer instead.


Top
 Profile  
 
 Post subject: Re: AutoIt Steam Password Problem
PostPosted: 31 Mar 2009 20:08 

Joined: 31 Mar 2009 20:04
Posts: 3
$sBuffer seems to contain nothing.
Code:
Code:
$steamPath = RegRead("HKEY_CURRENT_USER\Software\Valve\Steam", "SteamPath")
$k1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProductId")
$k2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid")
$k3 = RegRead("HKEY_CURRENT_USER\Software\Valve\Half-Life\Settings", "io")
$cKey = $k1&$k2&$k3
$cKeyLength = StringLen($cKey)
$Len = DllStructCreate("int")
$sBuffer = ""
$sBuffer = String($sBuffer)
$steamdll = DLLOpen($steamPath & "/Steam.dll")
$password = DllCall($steamdll, "int", "SteamDecryptDataForThisMachine", "str", $cKey, "int", $cKeyLength, "str", $sBuffer, "int", "65535", "ptr*int", DllStructGetPtr($Len))
DLLClose($steamdll)
MsgBox(0, "test", $sBuffer)


Top
 Profile  
 
 Post subject: Re: AutoIt Steam Password Problem
PostPosted: 31 Mar 2009 21:20 

Joined: 11 Mar 2009 14:53
Posts: 2
In the end I just embedded Luigi's decrypter and read the output from it.


Top
 Profile  
 
 Post subject: Re: AutoIt Steam Password Problem
PostPosted: 01 Apr 2009 08:48 

Joined: 31 Mar 2009 20:04
Posts: 3
Where would be the fun in that? :P
It would be nice if it could read it from the dll instead.
I've been comparing in to how-steampwd-works-t19-30.html but haven't found anything out of the ordinary yet.

aluigi, Andrew, do you have any idea of what is forgotten?

Thanks!


Top
 Profile  
 
 Post subject: Re: AutoIt Steam Password Problem
PostPosted: 01 Apr 2009 16:48 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
the error is in the arguments of the dll.
the encryption key is retrieved by the same dll so you don't need to think to it.

SteamDecryptDataForThisMachine has the following arguments:
arg1 (string): the encrypted password, like 9f102583f923572523..2352
arg2 (int): length of the encrypted password
arg3 (string): the buffer where will be put the decrypted password
arg4 (int): the max size of the output buffer
arg5 (int ptr): the output length of the decrypted password
return (int): 0 for success, any other for error


Top
 Profile  
 
 Post subject: Re: AutoIt Steam Password Problem
PostPosted: 02 Apr 2009 22:08 

Joined: 16 Aug 2007 06:25
Posts: 367
The code below works... some credits goto the autoit forums user trancexx where I got the dllcall code from (post here).

Code:
$steamPath = RegRead("HKEY_CURRENT_USER\Software\Valve\Steam", "SteamPath")
$cKey = "ABCDEF16272713712637163716371627621736217361726ABCBABCBACBABCABBCDBBDEBDEDBDEBBB323123123123"
$steamdll = DLLOpen($steamPath & "/Steam.dll")
$aCall = DllCall($steamdll, "int:cdecl", "SteamDecryptDataForThisMachine", _
        "str", $cKey, _
        "int", StringLen($cKey), _
        "str", "", _
        "int", 65535, _
        "dword*", 0)
MsgBox(0, "test", $aCall[3])


Note: you will have to retrieve the encrypted password ($cKey) on your own... I entered it manually for my tests. If you are not sure how to get it from your clientregistry.blob file, Luigi provides a good explanation here: steam-password-recovery-t488.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: